html5-video

Save HTML5 video currentTime before user leaves or closes page

混江龙づ霸主 提交于 2019-12-21 20:38:30
问题 I would like to save the position of HTML5 video's currentTime to the database when user leaves a web page. It seems like window.onbeforeunload is not a reliable way to do it (not to mention it gives an undesirable popup window!). Is there a better way to do this? I can't think of anything other than saving the position to the server periodically. But that seems wasteful resource/bandwidth wise. Netflix seems to do a good job at remembering your last viewed position. How would they be able to

How can I make the vjs-big-play-button appear when the video is paused?

六眼飞鱼酱① 提交于 2019-12-21 18:04:49
问题 I am presently tinkering with video.js, an open source HTML5 video player. There is this big-play-button ( button name ) which is shown before the video is started. Upon clicking the button "play" , it disappears until the page is refreshed and the video has reloaded. I would like to modify the code so that the button re-appears when the video is paused. 回答1: You can hide / show the big play button at any time using the VJS API, so no need to go about creating a new button. bigPlayButton.show

How to stream videos through HTML5?

微笑、不失礼 提交于 2019-12-21 17:01:34
问题 I need to stream videos through HTML5. Is that possible, are there any free sources to try that into my own application? Thanks! 回答1: If you mean just deliver video like Youtube or any other video site, you just use the <video> element to deliver it. Its pretty much like displaying an image (JPEG). Its just progressively downloaded to the user's browser. More details about Video at Dive into HTML5. However, if you mean live-stream or streamed to a user such that its not really downloaded, I'm

HTML5 Video - Chrome - Error settings currentTime

こ雲淡風輕ζ 提交于 2019-12-21 14:14:12
问题 When I try to set the currentTime of the HTML5 Video element in Chrome 5.0.375.86 like: video.currentTime = 1.0; I am getting the following javascript exception: Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 It works fine in Safari. Has anybody experienced this?? 回答1: Try something like this (JS): function loadStart(event) { video.currentTime = 1.0; } function init() { video.addEventListener('loadedmetadata', loadStart, false); } document.addEventListener("DOMContentLoaded", init, false);

HTML5 Video - Chrome - Error settings currentTime

混江龙づ霸主 提交于 2019-12-21 14:13:50
问题 When I try to set the currentTime of the HTML5 Video element in Chrome 5.0.375.86 like: video.currentTime = 1.0; I am getting the following javascript exception: Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 It works fine in Safari. Has anybody experienced this?? 回答1: Try something like this (JS): function loadStart(event) { video.currentTime = 1.0; } function init() { video.addEventListener('loadedmetadata', loadStart, false); } document.addEventListener("DOMContentLoaded", init, false);

iOS Safari detect when user clicks “Done” in native player

雨燕双飞 提交于 2019-12-21 14:00:30
问题 I am basically trying to open a new tab in the Safari iPhone Mobile Browser (iOS 7) when the user clicks the "Done" button in the Native video player. This is the action flow: User Plays HTML5 Video (Clicks the Play Icon) Mobile Safari Opens Fullscreen Player 3 User Clicks Done I tried various approaches and none of these events are working. ended webkitendfullscreen pause Any ideas on on what may be a suitable solution? If you want to check out the work I have done so far here is the code

Determine DRM system supported by browser

不羁的心 提交于 2019-12-21 11:37:44
问题 I've trying to find out how to determine which DRM system browser is using. And in fact, only chrome say it is use 'com.widevine.alpha' where IE & Safari (Win) throw error on 'requestMediaKeySystemAccess', and firefox do not even try to say it use 'com.adobe.acccess' =] function isKeySystemSupported(keySystem) { var dfd = Q.defer(); console.log('check: ', keySystem); navigator.requestMediaKeySystemAccess(keySystem, [{contentType: 'video/webm; codecs="vp9"'}]).then(function() { dfd.resolve

Determine DRM system supported by browser

蹲街弑〆低调 提交于 2019-12-21 11:37:12
问题 I've trying to find out how to determine which DRM system browser is using. And in fact, only chrome say it is use 'com.widevine.alpha' where IE & Safari (Win) throw error on 'requestMediaKeySystemAccess', and firefox do not even try to say it use 'com.adobe.acccess' =] function isKeySystemSupported(keySystem) { var dfd = Q.defer(); console.log('check: ', keySystem); navigator.requestMediaKeySystemAccess(keySystem, [{contentType: 'video/webm; codecs="vp9"'}]).then(function() { dfd.resolve

Subtitles not showing using WebVTT

时间秒杀一切 提交于 2019-12-21 08:07:06
问题 So I'm trying to add subtitles to a html5 video and found WebVTT. I've done some research on it and have even copied some example code to see if that'll work and yet I have no luck. The subtitles just simply don't show up on the video. Here's the HTML. <video id="video" class="video" controls> <source src="solar.mp4" type="video/mp4"> <source src="client2.ogv" type="video/ogv"> <source src="solar.webm" type="video/webm"> <source src="solar.flv" type="video/flv"> <track label="English Captions

How to keep a live MediaSource video stream in-sync?

假装没事ソ 提交于 2019-12-21 07:14:04
问题 I have a server application which renders a 30 FPS video stream then encodes and muxes it in real-time into a WebM Byte Stream. On the client side, an HTML5 page opens a WebSocket to the server, which starts generating the stream when connection is accepted. After the header is delivered, each subsequent WebSocket frame consists of a single WebM SimpleBlock. A keyframe occurs every 15 frames and when this happens a new Cluster is started. The client also creates a MediaSource, and on