html5-video

HTML5 Video - Percentage Loaded?

只愿长相守 提交于 2019-11-26 08:47:38
问题 Does anyone know what event or property I need to query in order to get a percentage figure of the amount an HTML5 video has loaded? I want to draw a CSS styled \"loaded\" bar that\'s width represents this figure. Just like You Tube or any other video player. So just like you tube a video will play even if the whole video hasn\'t loaded and give the user feedback on how much of the video has loaded and is left to load. Just like the Red Bar on YouTube: 回答1: The progress event is fired when

Programmatically play video with sound on Safari and Mobile Chrome

£可爱£侵袭症+ 提交于 2019-11-26 08:37:33
问题 With the release of OSX High-Sierra*, one of the new features in Safari is that videos on websites will not auto play anymore and scripts can\'t start it either, just like on iOS. As a user, I like the feature, but as a developer it puts a problem before me: I have an in-browser HTML5 game that contains video. The videos do not get automatically played anymore unless the user changes their settings. This messes up the game flow. My question is, can I somehow use the players\' interaction with

Wait until an HTML5 video loads

梦想的初衷 提交于 2019-11-26 08:20:27
问题 I have a video tag, that I dynamically change its source as I am letting the user to choose from a number of videos from the database. The problem is that when I change the src attribute the video doesn\'t load even if I tell it to. Here is my code: $(\"#video\").attr(\'src\', \'my_video_\'+value+\'.ogg\'); $(\"#video\").load(); while($(\"#video\").readyState !== 4) { console.log(\"Video is not ready\"); }; The code still stays in a infinite loop. Any help? EDIT : To Ian Devlin: //add an

How to autoplay HTML5 mp4 video on Android?

心已入冬 提交于 2019-11-26 06:38:17
问题 I had developed a mobile page by asp.net to play mp4 video. I know iOS had disabled the autoplay function to minimize user bandwidth, so how can i autoplay HTML5 mp4 video on Android ? I had already put autoplay in HTML5 code, but it doesn\'t work. The following is my code: <video autoplay controls id=\'video1\' width=\'100%\' poster=\'images/top_icon.png\' webkitEnterFullscreen poster preload=\'true\'> <source src=\'http://192.xxx.xxx.xx/XXXXVM01.mp4\' type=\'video/mp4; codecs=\'avc1.42E01E,

HTML5 Video Dimensions

流过昼夜 提交于 2019-11-26 05:23:25
问题 I\'m trying to get the dimensions of a video of which I\'m overlaying onto a page with JavaScript, however it is returning the dimensions of the poster image instead of the actual video as it seems it\'s being calculated before the video is loaded. 回答1: <video id="foo" src="foo.mp4"></video> var vid = document.getElementById("foo"); vid.videoHeight; // returns the intrinsic height of the video vid.videoWidth; // returns the intrinsic width of the video Spec: https://html.spec.whatwg.org

How to handle “Uncaught (in promise) DOMException: play() failed because the user didn&#39;t interact with the document first.” on Desktop with Chrome 66?

北战南征 提交于 2019-11-26 05:20:52
问题 I\'m getting the error message.. Uncaught (in promise) DOMException: play() failed because the user didn\'t interact with the document first. ..when trying to play video on desktop using Chrome version 66. I did find an ad that began playback automatically on a website however using the following HTML: <video title=\"Advertisement\" webkit-playsinline=\"true\" playsinline=\"true\" style=\"background-color: rgb(0, 0, 0); position: absolute; width: 640px; height: 360px;\" src=\"http://ds

HTML5 video will not loop

久未见 提交于 2019-11-26 04:38:04
问题 I have a video as a background to a web page, and I am trying to get it to loop. Here is the code: <video autoplay=\'true\' loop=\'true\' muted=\'true\'> <source src=\'/admin/wallpapers/linked/4ebc66e899727777b400003c\' type=\'video/mp4\'></source> </video> Even though I have told the video to loop, it does not. I also tried to get it to loop with the onended attribute (as per this Mozilla support thread, I also tried that bit of jQuery). Nothing has worked so far. Is it an issue with Chrome,

HTML5 Video tag not working in Safari , iPhone and iPad

北城以北 提交于 2019-11-26 04:21:53
I am trying to create an html5 web page in which there is a small video like 13s , I converted the flash version of this video into 3 format : .ogv using fireFogg , .webm using firefogg also and .mp4 using HandBrake application the html script I used in my page : <video width="800" height="640" loop preload="false" autoplay controls tabindex="0"> <source src="xmasvideo/video.mp4" type="video/mp4" /> <source src="xmasvideo/M&P-Xmas 2.ogv" type="video/ogv" /> <source type="video/webm" src="xmasvideo/M&P-Xmas.webm" /> </video> The video is working fine in Chrome and FireFox but not working at all

Play local (hard-drive) video file with HTML5 video tag?

邮差的信 提交于 2019-11-26 03:25:27
问题 I want to achieve the following. <video src=\"file:///Users/username/folder/video.webm\"> </video> The intent is that the user will be able to select a file from his/her hard drive. And the reason for not uploading is of course transmission costs and storage quota. There will be no reason to save the file. Is it possible? 回答1: It is possible to play a local video file. <input type="file" accept="video/*"/> <video controls autoplay></video> When a file is selected via the input element:

HTML5 Video tag not working in Safari , iPhone and iPad

孤街浪徒 提交于 2019-11-26 03:23:48
问题 I am trying to create an html5 web page in which there is a small video like 13s , I converted the flash version of this video into 3 format : .ogv using fireFogg , .webm using firefogg also and .mp4 using HandBrake application the html script I used in my page : <video width=\"800\" height=\"640\" loop preload=\"false\" autoplay controls tabindex=\"0\"> <source src=\"xmasvideo/video.mp4\" type=\"video/mp4\" /> <source src=\"xmasvideo/M&P-Xmas 2.ogv\" type=\"video/ogv\" /> <source type=\