html5-video

add or remove controls attribute from html5 <video> tag

你离开我真会死。 提交于 2019-12-22 08:23:40
问题 I am looking for a method to add the controls attribute to a video tag based upon the user agent string. I do not wish to have the controls attribute present on any browser or device other than Ipad and Android. So i thought that user agent was the best way to identify because the words ipad and android are present in their respective UA header. What is the best way to accomplish my goal? I've tried this with no luck: <script type="text/javascript"> var myVideo = document.getElementById(

Playing a video file from a sql server blob via ashx handler using HTML5 Video Tag

不想你离开。 提交于 2019-12-22 07:02:23
问题 I am using code from this codeproject article to upload a MP4 video file to SQL server(varbinary(MAX)) and play it back from there. My requirement is to use SQL server specifically instead of storing and fetching videos from the file system. This is the code I am using to play the video: <video id='my_video_1' controls width="640" height="264" data-setup="{"controls":true, "preload":none}" > <source src='<%# "VideoHandler.ashx?id=" + Eval("ID") %>' type='video/mp4'> </video> If I use a

HTML5 video timeupdate event not firing

对着背影说爱祢 提交于 2019-12-22 05:24:16
问题 I do have a <video> element on my page: <video id="myVideo"> <source src="vid.mp4" type="video/mp4" /> <source src="vid.ogg" type="video/ogg" /> </video> In my JS it reads: var v = $('#myVideo')[0]; v.addEventListener('timeupdate',function(){ alert('I changed'); },false); Now I will fire up my console and type: $('#myVideo')[0].currentTime = 2; The displayed frame will change, yet the event will not fire. According to the specs timeupdate should fire when currentTime was changed , so I do not

Play a local video from iPad in an HTML 5 webpage

为君一笑 提交于 2019-12-22 04:47:25
问题 Does anyone know if you can use the HTML5 video tag to play a video from the iPad library? Something like: <source src="/local/path/video.mp4" type="video/mp4" /> Thanks for your time 回答1: As far as I know, web pages don’t have access the iOS devices’ filesystems (hence the lack of support for <input type="file"> on iOS). The user doesn’t have direct access to the filesystem, so it would be odd if web pages did. 回答2: There is a solution even though it is not the most convenient. You can

Change background-color of html5 video element

大兔子大兔子 提交于 2019-12-22 03:51:11
问题 I've got the following website: beta.leifsigersen.com There's a movie on the front page which sometimes takes a little while to load (sometimes less than a second, sometimes a few seconds). Before the movie is loaded there's black background/borders. How can I change the color of this? I've tried to use CSS of the video-element, but without any luck. 回答1: Try this CSS: .pk_video { background-color: red !important; /* or whatever you want */ } 回答2: So i had this annoying white bar, I got rid

Get current frame of video in javascript / jquery

假如想象 提交于 2019-12-22 01:50:34
问题 I am playing video using the html video tag. While playing video I want the current frame of the video not "currentTime" using jquery or javascript. I am able to get the current frame by doing the calculation of the fps of video and currentTime, but it is not giving the exact frame number. Any ideas how I can fix this? 回答1: Please check out below demo. Only one thing is you have to assign a frameRate of video. External Js will manage all thing and you can get Frame number easily. var

Hide Native Android HTML5 Video Play Button in CSS

丶灬走出姿态 提交于 2019-12-22 00:22:18
问题 On iOS I can simply remove the play button by doing video::-webkit-media-controls-start-playback-button { display: none !important; } However, on Android (using version 7.0) I can't remove the play button when trying the following. video::-webkit-media-controls-overlay-play-button video::-webkit-media-controls video::--webkit-media-controls-play-button Here's my video element: <video autoplay muted></video> I could solve this natively, as shown here HTML5 video remove overlay play icon, but I

How see on display minute and second CurrentTime <video> in html5 if use jquery?

拥有回忆 提交于 2019-12-21 22:22:11
问题 I want see on display CurrentTime minute and second video. var id = $('#main_video_player'); alert(id.get(0).currentTime); //worked i see '12.324543356' var minnow=id.get(0).currentTime.split('.')[0]; alert(minnow); //not worked var secnow=id.get(0).currentTime.split('.')[1].substr('0','1'); alert(secnow); //not worked Thanks all for help=) Right code for show seconds: alert(time.toString().split('.')[0]); Code down for show correct time in hours, minute an second: var id = $('#video');

Can CSS be applied to <track> element

Deadly 提交于 2019-12-21 21:21:53
问题 So I ran into problem while writing my own customized HTML5 video player. Can any CSS rules be applied to <track> element? Any nasty hacks? I want to control position of <track> and font-size . <div id="movie-01"> <video id="video" controls preload="metadata"> <source src="files/movie-01/movie.mp4" type="video/mp4"> <track label="Chinese Traditional" kind="subtitles" srclang="cht" src="files/movie-01/cht.vtt" default> </video> </div> <style> track{ color: #FAFAFA; font-size: 1em; } </style>

How to encrypt WebM or MP4 file using ClearKey and then play it

好久不见. 提交于 2019-12-21 20:39:51
问题 I'm currently researching the subject of encrypting and playing encrypted videos in browser. I already have some successes with castlabs' DRMToday and Shaka Player while using Widevine. Now I'm trying to encrypt video without external services using ClearKey and play it in Chrome (using whatever js player which can handle). I did manage to encrypt single mp4 file using MP4Box (and mse-eme for creating crypt configuration) but I have no idea how to play it in browser. HTML5's Video didn't even