In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article focuses on "sharing HTML5 video event application examples". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "sharing HTML5 video event application examples"!
Use the onloadedmetadata event to obtain the duration of the video, and use the ontimeupdate event to obtain the progress of the current video playback. The sample code is as follows:
1. Obtain the video time length
After the video is loaded into video, use the onloadedmetadata event to get the length of time for the video.
The code is as follows:
Video.onloadedmetadata = function () {
Var vLength = video.duration
Console.log (vLength)
}
2. Progress of the current video playback
When the video starts to play, you can use the ontimeupdate event to get the progress of the current video playback. The ontimeupdate event is triggered when the currentTime property of the video object changes. The currentTime property is a floating-point decimal place that can be fetched to a decimal place of 12 places.
The code is as follows:
Video.ontimeupdate = function () {
Var vTime = video.currentTime
Console.log (vTime)
}
At this point, I believe you have a deeper understanding of "sharing HTML5 video event application examples". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.