html5-video

How do I capture keyboard events while watching an HTML5 video in fullscreen mode?

强颜欢笑 提交于 2019-12-02 04:41:47
I need to know when the user presses the escape key when watching an HTML5 video in fullscreen mode. Unfortunately any configured listeners on the document don't apply since when the user is watching an HTML5 video in fullscreen mode the system focus is on the native video player rather than the browser. An alternative is listening for when focus reverts back from the native video player to the browser, but I'm unsure as to how I would capture this. document.addEventListener('keydown', function (e) { console.log(e.keyCode); }, false); The above successfully logs to the console when I press

<video>.currentTIme doesn't want to be set

有些话、适合烂在心里 提交于 2019-12-02 02:46:56
问题 I'm trying to write a piece of Javascript that switches between two videos at timed intervals (don't ask). To make matters worse, each video has to start at specific place (about ten seconds, and again, don't ask.) I got the basics working by just using the YUI Async library to fire to switch the videos at intervals: YUI().use('async-queue', function (Y) { // AsyncQueue is available and ready for use. var cumulativeTime = 0; var q = new Y.AsyncQueue() for (var x = 0; x < settings.length; x++)

<video>.currentTIme doesn't want to be set

旧街凉风 提交于 2019-12-02 02:33:38
I'm trying to write a piece of Javascript that switches between two videos at timed intervals (don't ask). To make matters worse, each video has to start at specific place (about ten seconds, and again, don't ask.) I got the basics working by just using the YUI Async library to fire to switch the videos at intervals: YUI().use('async-queue', function (Y) { // AsyncQueue is available and ready for use. var cumulativeTime = 0; var q = new Y.AsyncQueue() for (var x = 0; x < settings.length; x++) { cumulativeTime = cumulativeTime + (settings[x].step * 1000) q.add( { fn: runVideo, args: settings[x]

Efficiently detect if a device will play silent videos that have the autoplay attribute

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 00:52:40
With Chrome 53 and iOS 10 both out now, there are now Android and iOS devices that are capable of automatically playing videos that are silent and have the autoplay attribute. I'd like to know how to detect this with JavaScript. For Chrome 53, the <video> must have the autoplay and muted attributes (yes, the muted attribute is required even if the video file doesn't have any audio tracks). For iOS 10, the <video> must have the autoplay attribute and, for non-iPad iOS 10 devices, the playsinline attribute too (yes, it must be playsinline ; webkit-playsinline won't work). So a <video> will

Image in <img> tag is defaulting to 0 x 0 pixels despite setting its size

荒凉一梦 提交于 2019-12-01 22:17:21
问题 For some reason I'm unable to set the image size when using an <img> tag inside an html5 video element. It is always defaulting back to 0 x 0 pixels . The reason I'm using this img is as a fallback for ancient browsers where the video tag just will not work. Here's my code NOTE I have deliberately removed "myVideo.mp4" to mimic the fallback : <video id="welcome" height="1080" width="1920" preload="auto" loop autoplay> <source type="video/mp4" src="@Url.Content("~/_video/myVideo.mp4")" /> <img

HTML 5 Autoplay Google Chrome Android Not Playing

风格不统一 提交于 2019-12-01 21:33:23
问题 I'm trying to play automatically a video when the user open the page on browser. On my laptop autoplay works on all browsers, but on android it doesn´t work on Google Chrome and in Iphone it doesn't works in safari. I already did a search and google chrome in android doesn't support html5 video tag so i used some javascript but it doesn't work too. Why? What should i do? Here's my code <video id="video" autoplay autobuffer controls="controls" allowFullScreen > <source src="video.mp4" type=

Image in <img> tag is defaulting to 0 x 0 pixels despite setting its size

我是研究僧i 提交于 2019-12-01 20:58:57
For some reason I'm unable to set the image size when using an <img> tag inside an html5 video element. It is always defaulting back to 0 x 0 pixels . The reason I'm using this img is as a fallback for ancient browsers where the video tag just will not work. Here's my code NOTE I have deliberately removed "myVideo.mp4" to mimic the fallback : <video id="welcome" height="1080" width="1920" preload="auto" loop autoplay> <source type="video/mp4" src="@Url.Content("~/_video/myVideo.mp4")" /> <img src="@Url.Content("~/_video/posterframe.jpg")" height="1080" width="1920"/> </video> This produces the

HTML5 videos not working in Safari

五迷三道 提交于 2019-12-01 20:50:35
I just noticed that videos on my personal site aren't playing in safari. I've tried two computers and clicking play does nothing. They work fine in Chrome, Opera, and Firefox, but not in safari. Is it a codec/encoding issue? Link: http://imwillryan.com/uiuc-timelapse.html Code: <video controls preload="none" poster="assets/video/poster_uiuc-timelapse.jpg" data-setup="{}"> <source src="assets/video/uiuc-timelapse.mp4" type="video/mp4" /> <source src="assets/video/uiuc-timelapse.ogv" type='video/ogg; codecs="theora, vorbis"' /> <source src="assets/video/uiuc-timelapse.webm" type='video/webm;

Preloading Video Files - HTML5 playback

家住魔仙堡 提交于 2019-12-01 20:22:01
问题 Im looking to preload a number of small video files on my website when it first loads. This is so they can be auto-played and used when a user clicks to enter a section of the website. I need the transitions to be seamless so ideally the whole video file should be preloaded to avoid any delays. Ive tried a few different plugins like html5preloader, and also some other JS techniques to load the video files to the page but hide them to try and force the browser to load the videos before i use

Preloading Video Files - HTML5 playback

故事扮演 提交于 2019-12-01 19:06:14
Im looking to preload a number of small video files on my website when it first loads. This is so they can be auto-played and used when a user clicks to enter a section of the website. I need the transitions to be seamless so ideally the whole video file should be preloaded to avoid any delays. Ive tried a few different plugins like html5preloader, and also some other JS techniques to load the video files to the page but hide them to try and force the browser to load the videos before i use them. Neither have really made much difference to just swapping out the video src when i require to play