html5-video

Dynamically create a HTML5 video element without it being shown in the page

守給你的承諾、 提交于 2019-12-04 17:11:24
问题 Is it possible to dynamically create a HTML5 video element so that I can access the element by API's like document.getElementById or Name but it may not show up in the webpage. Something like div.hide() or something in that direction ? 回答1: You can try var video = document.createElement('video'); video.src = 'urlToVideo.ogg'; video.autoplay = true; you can also use the canPlayType method to check if the browser supports the video format you want to use before setting source if (video

html5-video by button $(…).play is not a function

给你一囗甜甜゛ 提交于 2019-12-04 17:07:22
问题 I try to play videos one after the other via button or automatically at the end of the video. by this code: //automatically play $("#videoPlayer").bind('ended', function() { if(cnt <= 10 && bNum == 0) cnt++; $('#videoPlayer').attr('poster','./media/spot'+cnt+'.jpg').html('<source src="./media/spot'+cnt+'.mp4" type="video/mp4"><source src="./media/spot'+cnt+'.ogg" type="video/ogg"><source src="./media/spot'+cnt+'.webm" type="video/webm">'); $('#video-title').html('Spot '+cnt); if(cnt < 10) {

Chrome hangs on loading page with many <video> tags

我是研究僧i 提交于 2019-12-04 16:55:01
问题 I have a page with many <video> elements in it arranged one after the other. Lets says 100 for now. When I click on the web page, Chrome loads the first 25 and I can see the video images displayed Ok, but then it stops and the rest remain black. I also see the page is still loading, and I see chrome saying "In progress..." on the lower left side of the page. Using firefox, I can load the same page with no problem. Also using IE 11, I can load the same page with no problem and all videos show

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

微笑、不失礼 提交于 2019-12-04 16:52:27
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'); timenow=id.get(0).currentTime; if (parseInt(timenow)/60>=1) { var h = Math.floor(timenow / 3600); timenow =

HTML5 video (video.js) not loading in Chrome

匆匆过客 提交于 2019-12-04 16:26:59
I have a html5 video video that is not loading in chrome, it just shows the loading spinner from video.js. I get the following error in chrome console too: Uncaught TypeError: Cannot call method 'init' of undefined machinas.com/:830 ["Video Error", Object] 0: "Video Error" 1: Object length: 2 __proto__: Array[0] .htaccess AddType video/mp4 .mp4 .m4v AddType video/webm .webm AddType video/ogg .ogv .ogg html <video id="video-1" class="video-js vjs-default-skin" width="100%" height="100%" poster="videos/timelapse.jpg" data-setup='{ "controls": true, "autoplay": false, "preload": "auto" }'>

HTML5 video won't maximize beyond container dimensions in native full screen mode

空扰寡人 提交于 2019-12-04 16:05:31
I encountered a very interesting cross-browser HTML5/CSS issue: whenever there is an animation WITH -webkit-animation-fill-mode: both; attached to a DIV containing HTML5 video element, this video won't fill whole window in native HTML5 full-screen mode, i.e. the video size in full-screen will be limited to parent element dimensions. Description may be confusing, so I have created a simplified example: http://jsfiddle.net/7SsPa/3/embedded/result/ (note: jsFiddle does not allow full screen mode at all, but it gives understanding of what happens. To see same code with full-screen enabled, you can

Video.js - How to reference multiple videos in one page?

耗尽温柔 提交于 2019-12-04 15:38:17
My goodness, I cannot find an answer for this and I spent several hours already. How can you reference multiple videos at the same time in video.js? The API documentation says: Referencing the Player: You just need to make sure your video tag has an ID. The example embed code has an ID of "example_video_1". If you have multiple videos on one page, make sure every video tag has a unique ID. var myPlayer = V ("example_video_1"); This example shows a single ID, but it doesnt show how I can reference multiple IDs at the same time. If I have 3 different tags: "video_1", "video_2", "video_3", how do

autoplay muted video iOS 11.2

╄→гoц情女王★ 提交于 2019-12-04 15:36:45
I am currently working on a page with videos on it. Since iOS 11.2, it seems they disabled autoplay muted inlineplaying completely without a user gesture. Has anyone experienced this issue too? This all wouldn't be such a mess if there would be a possibilty to check whether it is possible to playinline or not. But like this it results in a new hack by UA sniffing. Edit: I have seen that i am have missed something. Autoplay is working, but trying to video.play() a muted inline video is not working anymore. Just turn off the "Low Power Mode" ;) Found a working solution thanks to the WebRTC repo

Getting “Not allowed to load local resource” error while trying to attach a MediaSource object as the source of a HTML5 video tag

冷暖自知 提交于 2019-12-04 15:16:09
问题 I am trying to get this example to work. It works fine when I click the link. But when I try to download the HTML file on my local machine and try the same, it is throwing this error. Not allowed to load local resource: blob:null/6771f68d-c4b8-49a1-8352-f2c277ddfbd4 The line of code that seems to be causing the issue is this, video.src = window.URL.createObjectURL(mediaSource); What this line of code is doing is basically trying to set the source of the video tag media element to the

Save HTML5 video currentTime before user leaves or closes page

流过昼夜 提交于 2019-12-04 14:56:07
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 achieve that reliably? Low-level server-side C/C++ code maybe? There are various ways to save such