<video> autoplay not always working with Firefox - html

Im building a new webpage with video background. The problem is that Firefox is the only browser that have problem with html5 autoplaying. If page was loaded atleast one time the video is working correclty, starts right after the page load automatically but.. if page is loaded for the first time in most cases the video in background doesn't start and show something like TV's snow.
Facts:
- I don't think its 'video' tag (tried many configurations thinking it might help),
- I'm also sure its not problem with video file - tried few videos,
- tried all formats - it happens with all of them: mp4, wemb, ogg, All at the same time and individually,
- it's not problem with my PC - been trying on windows, mac and linux,
- Its not plugin - i don't use any with FF.
Check it out here: http://strona5.nanit.webd.pl Just do it in private session and close window after every load so you'll see that its lottery.
Regards.

Related

Internet Explorer 11 HTML5 audio duration = infinity issue

Today I've met an unpleasant issue. There is a website with a custom HTML5 audio player. After the page loads, I try to echo document.getElementById("myAudioId").duration, it is needed in order to make navigation possible. In every other browser it works just fine, the duration is showed, but IE11 works differently - it shows that duration equals Infinity. But as I noticed, when the song is buffered to the end, the duration magically appers and the navigation works. In other browsers everything works from the start. The content-length headers are set up. What could it be?
UPD: Other sites with HTML5 audio let me see the duration from the very start. The duration, I guess, is part of metadata and could be loaded even without preloading the audio file using preload="metadata", but it also doesn't work.
UPD2: I've also tried playing around with jsfiddle and created the same audio tag there with same MP3 audio - there was the same situation. But then I've inserted link to another MP3 there, from another site - and it worked!. More than that, I've uploaded this second song to the first problematic website and after that the song that worked perfectly couldn't also show me its duration and stuff. So now I think it's something on server side. But don't know what it is.
UPD3: Finally, I've been told that files are converted using FFMPEG to MP3 128bit, then they stop being OK. Now I need to find how should I convert MP3s so they are OK.
It works for me locally, but when uploaded to server, it does not.
It seems that player.duration do not work in IE 11:
https://msdn.microsoft.com/en-us/library/dn254962(v=vs.85).aspx

<video> tag HTML5 cache in Firefox and Opera

I´m having a problem with the cache in Firefox and Opera to use the HTML5 tag .
My page has a button that generates a new video in the server when it´s clicked (always the same name), and when the video is generated, is showed in the page with video.../video.
The problem is that Firefox and Opera always show the first version of the video in the page, and the last version (correctly) if I enter to the video URL directly.
I have tried deleting cache, using "meta http-equiv="Cache-control" content="no-cache" ", but it´s useless.
In Chrome and Safari it works perfectly.
Any idea?
Thanks
3 options:
send proper cache-control headers for the video-file. this would be done via htaccess file or web.config file (Apache / IIS). while essentially a good solution it might still fail in some browsers
attach a timecode to the path like this: http://mydomain.com/mypath/myvideo.mp4?t=13591239123
always use a new name for the video-file - e.g. by counting the generated videos and numbering them sequentially
option 3 together with a cronjob that deletes old videos is probably best - else two users looking at your page at the same time would overwrite each others video.
option 1 / 2 are fine for a single-user environment.
option 2 would reset the path of your <video id='myvideo'> element upon completion of generating the new video:
document.getElementById('myvideo').setAttribute("http://mydomain.com/mypath/myvideo.mp4?t="+(+new Date());
note that this solution only deals with one source file. for this to work in all browsers you need mp4 and webm (or ogv) files --> two video files
compare http://caniuse.com/webm and http://caniuse.com/mpeg4

Chrome HTML5 Videos stop working if too many tabs are open - Memory issue?

I'm using jQuery to dynamically write <video> objects, and running videojs to init them. After I play a video, SOMETIMES when I try to play it again, it just won't play, and from that point on, even after refreshing the page, no videos will play. Each time, the <video> object renders, but the video just doesn't play. Nothing is written to the console. There don't appear to be any errors. Restarting Chrome resolves the issue, but only momentarily. After playing a few videos, the issue comes back again.
I found that closing other tabs in Chrome does indeed fix the problem, so it appears to be some kind of memory issue.
I'm running Chrome 19.0.1084.46
Exactly how many video tags to you have? What do they look like? Do they include preload='none' attribute? Are the source videos all on the server?
I ask because if you have more than six video tags on a single page pointing to the same source server then you could be experiencing "connection starvation":
Chrome allows only six open connections to a single server (based on DNS name in the URL)
the html5 video tag's preload attribute default value is 'auto'
Chrome's auto behavior is to preload some data and leave the connection open ready to pull more data for the video
So, with more than six video tags on a single page pointing to a single server, the videos will not play. To resolve this particular problem, set the preload attribute to 'none'
Stu is correct. But sometimes, in my experience, Chrome ignores the preload="none" attribute and goes ahead and opens a connection anyway. I've had much problem with this when developing a site which had many smaller videos on it. The connections blocked the rest of the content (images, custom fonts (and when custom fonts are delayed, the text does not even render)) My solution was to build an own preloader which loads the images. This made sure I could control at least when the images (which was the most crucial aspect from a design point of view) was loaded.
That solved the problem with images not showing but the problem still remained. So the best solution is to set up subdomains pointing to the same server, like: v1.server.com, v2.server.com, and so on. This means you won't have to move your files and you get the benefit from enabling browsers to have more open connections. Watch out for increased dns lookup time though.
There is a known bug with Chrome. It will not play the same video in multiple tabs at the same time. This is probably what you are running into if you are a developer and happen to have your page open in two tabs at the same time.
The bug has been known for almost 5 years as of this writing. Feel free to visit the Chromium bug report and star the issue. Hopefully it will increase in priority for the Chrome devs.
In the meanwhile, a workaround is to use a random query parameter in your video src. For example, instead of <video src="vid.mp4">, use <video src="vid.mp4?_u=1253412">. This will break Chrome's caching mechanism and allow the same video to be streamed to two different tabs at the same time.
I had a similar but related issue which I can expand on slightly here.
I had 14 different small videos on a page but only 2 were available at a time. Setting preload = 'none' didn't fix the issue so I also used a data attribute to store the src, and remove the src for all videos that aren't currently being viewed.

html5 video sometimes loads and sometimes don't in chrome

I'm having a lot of problems with video html5 and google chrome.
I have this site on two different servers and chrome is showing the transition video aleatory.
http://mitoteweb.com/vivaldo/
I made some files to test the video the simplest way to check this problem and it isn't working.
I tried with mp4 h.264, ogv y webm video format and I'm having the same issues with all of them.
Here's the test files.
http://mitoteweb.com/vivaldo/chrome/prueba1.htm
When I load the page it shows the video but once I click on the second link it doesn't show any video unless I manually reload the page. And even with that, sometimes it doesn't happen.
Sorry, I couldn't include more links because this is my first post.
Thanks in advance.

flash is does not auto play on one server but auto plays on another server

I have the same flash file uploaded to two servers. It seems to work perfectly fine on one (IE, Firefox and Chrome) but on the other it works only on Firefox, not even chrome.
The thing is I guess the flash file does load, but until I right click and click play, the file does not start playing.
Could this have anything to do with the server (yahoo small business)
Whether or not a flash file autoplays depends on the HTML code used to embed it - specifically the play parameter (full info here). So the difference you're seeing is not the two servers, but two slightly different HTML pages.
With that said, however, the "play" parameter is only a default behavior - like a suggestion. If you put a play() command in the first frame of the Flash content, then whatever is in the HTML will be ignored, and your SWF will start out playing regardless of how it gets embedded.