jaydon | experimental control panel written for a niche reason | SSH Utils library
kandi X-RAY | jaydon Summary
kandi X-RAY | jaydon Summary
This is an experimental control panel written for a niche reason. Use at your own risk.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of jaydon
jaydon Key Features
jaydon Examples and Code Snippets
Community Discussions
Trending Discussions on jaydon
QUESTION
I'm building a web app using ReactJS that will allow employees to view various video training sessions and then answer quiz questions about them. I would like to use HTML5 video elements to maximize compatibility across devices, but users can always just scrub through the video to get to the end and trigger the next operation in the app. It is necessary for them to watch the entire video before moving on.
I need a way to tell if the whole video has been played before allowing the user to move on. I was looking at the Video JS Advanced Examples page, and I found exactly what I was looking for. They have a 'played' data field that updates with what time ranges the user has played through. The problem is that I have no idea of how to implement that feature in my app. I can include and get VideoJS up and running just fine, but I don't know how to access the 'played' property of the video player.
If anyone could give me a direction to go in, I would really appreciate it. If this is a stupid question, I'm really sorry. I'm still fairly new to all of this. Thank you so much.
Cheers,
Jaydon
...ANSWER
Answered 2017-Mar-30 at 02:04played
comes form the html5 media spec. It returns a TimeRanges object.
Video.js provides most of the functionality of the native video element via methods. So, the played
property on the video element (as vidEl.played
) becomes a method call on the Video.js's player
object (as player.played()
).
The API to time ranges is a bit weird. But essentially, it has a three properties: length
, start
, and end
.
This is what they do:
* length
: how many ranges are there? In the case of played
, how many different sections of the video have been played?
* start()
: a method that tells you the start time of a given range
* end()
: a method that tells you the end time of a given range
It's likely that you will only have one range, but it's possible you'll have more. So, you'll want to loop over the length of the ranges. To know exactly how much the user as played, you'll basically want to loop over each range and calculate it's duration (end(i) - start(i)
and then compare it to the duration of the video (player.duration()
). If they are close, that means that the user has watched the entire video.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install jaydon
Unlike other control panels with Jaydon you control the versions of your softwares such as Nginx, Node.js etc.
MongoDB
Certbot
Nginx
Git
Node.js & NPM
Yarn
PM2
If you have all the dependencies above now you can install Jaydon.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page