html5-video

Capturing Video Frame and then Exporting as Bitmap in HTML5

ε祈祈猫儿з 提交于 2019-11-27 20:20:15
问题 I have a web application where I play back video. I am considering using the HTML5 <video> element and have determined it will allow me to meet all of my requirements except one: allowing the user to take a snapshot of the current video frame and save it as a raster image format (i.e. JPG). For this requirement I have not found a solution, and any guidance on this matter would be greatly appreciated. To help answer the question here are more details. I will download the video files from a

Javascript to stop HTML5 video playback on modal window close

限于喜欢 提交于 2019-11-27 19:36:24
I've got a html5 video element on a modal window. When I close the window the video continues to play. I'm a total newbie to JS. Is there an easy way to tie a video playback stop function to the window close button? Below is my html page: <!DOCTYPE html > <html lang="en"> <head> <meta charset="utf-8" /> <title>Modal Test</title> <script type="text/javascript" src="jquery.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $("#showSimpleModal").click(function() { $("div#simpleModal").addClass("show"); return false; }); $("#closeSimple").click(function() { $("div

How do I detect if the HTML5 autoplay attribute is supported?

喜你入骨 提交于 2019-11-27 19:21:20
How do I best detect whether a browser's HTML5 video element supports autoplay? On current iOS Safari, for example, autoplay is disabled . Update: I now designed the web page in such a way that it works irrespective of whether autoplay is supported. Now when the page is loaded an initialization video is shown. On an iPad, the user is presented with a big play button. Once playback has been triggered, the video is hidden. Afterwards, playback of the video player can be controlled from JavaScript, which is what I actually need. A little late to the party, but the accepted solution seems outdated

rounded corners on html5 video

ε祈祈猫儿з 提交于 2019-11-27 19:19:50
Is there a way I can cut off the corners of my html5 video element using the CSS3 border-radius attribute? Check out this example . it's not working. Wreeecks Create a div container with rounded corners and overflow:hidden. Then place the video in it. <style> .video-mask{ width: 350px; border-radius: 10px; overflow: hidden; } </style> <div class="video-mask"> <video></video> </div> It works in Firefox as long as you set the appropriate 180px height for the 320px width video (16:9 aspect ratio) - otherwise the curved borders aren't visible because they're outside the frame of the video. There

Safari: unable to dynamically load video from blob url

半腔热情 提交于 2019-11-27 18:59:13
问题 i'm trying to implement a dynamic loading for an html5 video tag. when a user picks a video file via the <input type="file"> element, i want to load it dynamically to a <video> element, and append it to body. the following code works on Chrome but not on Safari: function load_video(file) { // this came from <input type="file"> change event var reader = new FileReader(); reader.onload = function(event) { var blob = new Blob([event.target.result]); window.URL = window.URL || window.webkitURL;

Image placeholder fallback for HTML5 Video

▼魔方 西西 提交于 2019-11-27 18:46:16
I'm using the following code to implement an HTML5 video on a page <video autoplay> <source src="/resources/video/product-hero.mp4.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' /> <source src="/resources/video/product-hero.webmhd.webm" type='video/webm; codecs="vp8, vorbis"' /> </video> This works great, embedded on my page in FF, Safari, and Chrome. What I'd like, since this video has no controls, and is mean to be embedded in the page with no borders (white BG in the video) is to have an image appear in place of the video. I'd like to have an image as the fallback if the video can't

HTML5 video - show/hide controls programmatically

谁都会走 提交于 2019-11-27 18:42:26
I am looking for a way to show or hide HTML5 video controls at will via javascript. The controls are currently only visible when the video starts to play Is there a way to do this with the native video controls? I'm using google chrome browser. <video id="myvideo"> <source src="path/to/movie.mp4" /> </video> <p onclick="toggleControls();">Toggle</p> <script> var video = document.getElementById("myvideo"); function toggleControls() { if (video.hasAttribute("controls")) { video.removeAttribute("controls") } else { video.setAttribute("controls","controls") } } </script> See it working on jsFiddle

HTML5 and Javascript to play videos only when visible

℡╲_俬逩灬. 提交于 2019-11-27 18:37:26
I am interested in setting up an HTML page with multiple video clips such that each video clip plays only while visible and then pauses when out of view. I have found this great example of how this can be implemented with one clip, but I have been unable to modify the code to work with multiple clips. Perhaps I need to convert this code into a function for easy re-usability? Here is what I have so far (JS Bin linked above modified for 2 clips instead of one). This code seems to work for only one of the two clips. <!DOCTYPE html> <html> <!-- Created using jsbin.com Source can be edited via http

HTML5 VIDEO is not working in my rails 3 app

柔情痞子 提交于 2019-11-27 18:18:13
问题 I am trying to display HTML5 video in my Rails 3 app in development,i am using Sqlite3 and default webserver(Webrick).I put the video file (movie.ogg) under assets (assets/movie.ogg).The video window screen shows up but there is no video on there though.I have 3 questions...Since rails app assets doesn't have sub-folder for video(as the way it has images),where do you put video files? Does Webrick support Html5 video?Here is my code below ,what am i missing here,to make the video work? view

Overlaying a DIV On Top Of HTML 5 Video

你说的曾经没有我的故事 提交于 2019-11-27 18:09:12
I need to overlay a div ON TOP of a div containing an HTML 5 video. In the example below the overlaying div's id is "video_overlays". See example below: <div id="video_box"> <div id="video_overlays"></div> <div> <video id="player" src="http://video.webmfiles.org/big-buck-bunny_trailer.webm" type="video/webm" onclick="this.play();">Your browser does not support this streaming content.</video> </div> </div> There you go , i hope this helps http://jsfiddle.net/kNMnr/ here is the CSS also #video_box{ float:left; } #video_overlays { position:absolute; float:left; width:640px; min-height:370px;