html video tag not working on internet explorer - html5-video

I am using a video background for my website. Which runs fine on all browser on local host. But when I upload it to ipage server, it does not run on IE11. Here is my code.
<video autoplay loop muted class="visible-lg visible-md">
<source src="video/sh.mp4" type='video/mp4" codecs="avc1.4D401E, mp4a.40.2"'>
<source src="video/shanonaction.ogv" type="video/ogg">
</video>

First check your IE version. If it is lower than 9, you need to use the Flash player. You can also used embed in Internet Explorer 8 or lower.
Like this:
<pre>
<video id="Video1" controls width="100%" height="auto" poster="pic.png">
<source src="video.mp4" type='video/mp4;' />
<embed src="video.mp4" wmode="opaque">
<param name="wmode" value="opaque" />
</embed>
</video>
</pre>
It works for me.

This took me a really long time to figure out. No one seemed to know.
The issue is the pixel size of the video.
For some odd reason. Internet Explorer 11 will simply ignore any video whose height is more than around 1000 pixels. so a 1080p html 5 video will not load, but a 720p will.

Related

html 5 video will not autoplay

I have a video that should autoplay, but it will not.
I had it set up like this:
<video id="video" autoplay muted playsinline loop
poster="http://res.cloudinary.com/situ-live/video/upload/f_auto/Situ-Sizzler-Web-Clip-v05-01_auvu5o.jpg"
#video>
<source
src="http://res.cloudinary.com/situ-live/video/upload/f_auto/Situ-Sizzler-Web-Clip-v05-01_auvu5o.webm"
type="video/webm">
<source
src="http://res.cloudinary.com/situ-live/video/upload/f_auto/Situ-Sizzler-Web-Clip-v05-01_auvu5o.mp4"
type="video/mp4">
<source
src="http://res.cloudinary.com/situ-live/video/upload/f_auto/Situ-Sizzler-Web-Clip-v05-01_auvu5o.ogv"
type="video/ogg">
</video>
As you can see, it's muted so according to this document it should play, but it will not.
I tried to add a function to the canplay method, but when I do that I get this error:
DOMException: play() failed because the user didn't interact with the document first.
which is what lead me to the document above.
Does anyone know how I can solve this?
if you just use the HTML you have in question have in - the video plays just fine.
If you try to force it to play with JS - you'll get this error - as it is a way people try to get around blocking autoplay in the browser. for play() in JS to work, the user must first click somewhere on the page.
by default in newer versions of browsers, because of the user experience and prevention of sudden playing of the video, sometimes autoplay attribute won't work.
you can just fix it by a line of javascript in the page load function:
document.getElementById("video").play();
that's it!

Problems playing FullHD using HTML Video tag

I am using the Ajaxuploader for users to upload videos. Some of them are freezing on playback and I've just realised that it's the FullHD ones. HD plays fine. Is there a way I can force the user to upload in HD only or is there a way to resize on upload? I am using VB.Net for my backend. I'm even trialing a CDN at the moment but it's not making much difference. The video takes a while to start, buffer goes straight up but they still freeze when playing.
<video playsinline ID="videoToPlay" poster="https://www.myurl.co.uk/files/images/videoPoster.jpg" runat="server" object-fit:contain autoplay preload class="videosize" controls>
<source src="vid1.webm" type='video/webm;codecs="vp8, opus"'/>
<source src="vid2.mp4" type='video/mp4;codecs="avc1.4D401E, mp4a.40.2"'/>
<source src="video/video.mov" type="video/mov"></source>
</video>
videoToPlay.src="https://myurl.b-cdn.net/" & session("video")

VideoJS - embedded videos not working after number 7

I have a page with 10 videos. They are loaded in colorbox lightboxes.
I am using the standard videoJS markup.
Loading videos via:
View</li>
and:
<div id="5ways" style="height: 348px">
<video id="5ways" class="video-js vjs-default-skin" controls
preload="auto" width="618" height="348"
data-setup="{}">
<source src="//contiki-downloads.s3.amazonaws.com/agent/training-tools/video/5ways_converted.mp4" type="video/mp4">
<source src="//contiki-downloads.s3.amazonaws.com/agent/training-tools/video/5ways_converted.WebM" type="video/webm">
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video</p>
</video>
</div>
The bottom-most 3 videos (where they are positioned in the HTML) won't load. Videos 8, 9, 10 just get the loading spinner.
There's nothing wrong with the markup/paths to the videos. I have tested the URLs and they work fine. I have also tested commenting out some of the other video tags, which causes the broken videos to start working.
EG. If I comment out video 1, video 8 starts working.
Comment out video 2, video 9 starts working.
Comment out video 3, video 10 starts working.
The same is true for whatever order I do this in.
VideoJS will only allow 7 videos max to be embedded.
Anyone got any ideas? Or links to pages where more than 7 videos have successfully been embedded?
As I said over in the video.js issue tracker, it looks like you're hitting Chrome's max connections per domain. As well as not using preload="auto" you might try suggestions in this question, such as spreading the videos over different domains. You may be able to set up multiple cnames for your s3 bucket.
Increasing Google Chrome's max-connections-per-server limit to more than 6

What is the best container for html5-videos?

I have some videos I try to convert with Blender into a format which could be rendered by the most modern Browsers. I tried many different Settings and neither IE nor Firefox was able to decode the files. (Windows Media Player always did.)
I use the following html code:
<video width="320" height="240" controls>
<source src="data/test.avi">
Your browser does not support the video tag.
</video>
Is this correct?
I tried different formats, codecs and reslolutions. (mpeg-4, h.264, ogg, theora).
Do you have any suggestions?
Edit:
Ogg-Theora does run in Firefox and Chrome, but not in IE.
This is and has always been an issue, that is, format "wars" - which format to use, both for audio and video.
Unfortunately (depending on what angle you look at it) there is not one single format to rule them all, so you actually have to provide as many as "possible". By possible at least the three main formats:
MP4
Ogg Video
WebM
You can choose priority by defining the source tag in the order you prefer them to be used:
<video width="320" height="240" controls>
<source src="data/test.mp4" type="video/mpeg" />
<source src="data/test.ogv" type="video/ogg" />
<source src="data/test.webm" type="video/webm" />
Your browser does not support the video tag.
</video>
Hope this gives some input.

How do I tell video.js which mp4 source to use for mobile?

I have two mp4 source files, one encoded for desktop and one for mobile. Video.js is serving the wrong one to iPhone and iPad and they cannot be played. How can I tell Video.js which one to serve to these devices?
--Edit to add more info and clarify:--
I am using Video.js version 3.2.0, but the same problem occurs in 4.0.
The reproducible problem I am having is that some videos are not playing on older iOS devices - 1st gen iPad and iPhone 3GS. I believe it is because Video.js is playing the first mp4 in the source list instead of the one encoded for mobile.
My Video.js player code looks like this:
<video id="video_1" class="video-js vjs-default-skin"
controls preload="auto" width="640" height="390"
poster="https://s3.amazonaws.com/sightingsreport/videos/1748/dthumbnail_0000.png"
data-setup="{}">
<source src="https://s3.amazonaws.com/sightingsreport/videos/1748/default.mp4"
type='video/mp4' />
<source src="https://s3.amazonaws.com/sightingsreport/videos/1748/movie.webm"
type='video/webm' />
<source src="https://s3.amazonaws.com/sightingsreport/videos/1748/mobile.mp4"
type='video/mp4' />
</video>
If I move the mobile.mp4 source to be first in the list, it plays on the old iOS devices, but it also appears to use that one on non-mobile devices.
I thought Video.js was supposed to automatically serve the best source file for the device. Is that not correct?
What is the best way to handle this?
i would do it with php like ..
<?PHP
$isiPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$isiPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$isiPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
$isiDevice = $isiPod || $isiPhone || $isiPad ;
?>
..and..
<video id="video_player" class="video-js vjs-default-skin">
<?PHP if($isiDevice ) { ?>
<source src="mobile.mp4" type='video/mp4' />
<?PHP } else { ?>
<source src="desktop.mp4" type='video/mp4' />
<?PHP } ?>
</video>
This is a major bug in video.js. It checks for canPlayType() on each of the sources and select only the first one to use instead of keeping the multiple sources that the browser can select from.
Basically, it's impossible right now to have a fallback video of the same type.
I've submitted an issue on Github related to this:
https://github.com/videojs/video.js/issues/662