Html 5 video does not auto play - html

The video does not autoplay, tried it in Chrome 28 and Firefox 23. Also tried just plain autoplay and autoplay="true"
<video id="video_background" autoplay="autoplay" loop="loop" muted="muted"
volume="0"><source src="video/background/MH.webm" type="video/webm"> <source
src="video/background/MHB.mp4" type="video/mp4"><source src="video/background/MH.ogv"
type="video/ogg">Video not supported </video>
Update: Thanks for your help. When I take jquery out the video starts to autoplay. Any ideas?
Update: Looks like it was a issue with jquery mobile which was on the page for some reason. When I take out jquery mobile and add back in regularly jquery it works fine Thanks for the ideas.

Are you using jquery-mobile from Google's hosted libraries?
I had the same issue and autoplay worked when I replaced the jquery-mobile link for an actual file.
Hope that helps!

Related

Impossible to play my video on Safari browser

I looking for a way to play my video on Safari but I don't understand my video doesn't start ?
However, my video works on google chrome or edge.
Here is an idea of my code HTML
<video width="640" height="360" controls="true" autoplay loop muted playsinline>
<source src="/Perso/WebSite.nsf/vLUpage/VIDEOS/$File/movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
Perhaps that, I have to use of the CSS ?
Thank you for your help.
Try disabling cross-site tracking prevention on you IOS device under Safari > Preferences > Privacy.
read this https://support.apple.com/en-gb/guide/safari/sfri40732/mac
You can't play automatically a video on safari. The user has to engage an event and in this event you can play your video.

HTML Video Not Playing Audio

I am trying to play an mp4 file I have stored locally on my computer (when I play it with quicktime it works perfectly). For some reason however I can't get it to work with sound. If I include the 'muted' keyword, the mp4 plays, however with no sound (makes sense). However if I remove the 'muted' keyword, it doesn't play at all.
Any ideas what I am doing wrong?
Here is my code:
<video id="introVideo" width="50%" height="100%" autoplay loop muted>
<source src="../static/myvideo.mp4" type="video/mp4">
</video>
Did you tried with another web browser? Because autoplay is not allowed and even more on sounds with Chrome
This may be a little late, but starting in Chrome 66 autoplay doesn't work unless the muted attribute is included.
So in Chrome you can autoplay a muted video or autoplay won't work.
Source:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#attr-autoplay
Edit:
https://blog.chromium.org/2018/03/chrome-66-beta-css-typed-object-model.html
Search for 'autoplay' in the chromium blog link.

chrome html5 video stops autoplay after a second or two

I've got an autoplaying video which works well on all browsers, except Chrome - which has apparently disabled autoplay video. I've tried some work arounds, but now it just plays for 1-2 seconds and stops entirely.
Here's my code:
<video id="introduction-video" preload="auto" playsinline autoplay muted loop volume="0" poster="/images/videos/video-background.png" width="100%" height="100%">
<source src="/images/videos/Tasman10seconds.mp4" type="video/mp4">
<source src="/images/videos/Tasman10seconds.webm" type="video/webm">
Sorry, your browser does not support HTML5 video.
</video>
<script>$(window).on('load',function(){$('#introduction-video').get(0).play();});</script>
Any help would be greatly appreciated!
For anyone else having this issue, this worked for me..
$(window).bind('load',function(){
'use strict';
$('#introduction-video').trigger('play');
});
This is an old post, but as a quick followup for anyone who ends up here on a search: make sure to check your browser extensions. I was banging my head against this issue in Chrome as well. Then I tried it in incognito mode (where extensions were disabled) and the video played just fine.
I'm not sure which extension was causing the issue. But, that seemed to be the culprit.

HTML5 video tag on IOS 11

I have working code for a video element within my site thats fully functioning on ios 9/10 and all the normal browsers (chrome/ff/ie) etc.
I've noticed that since the ios 11 update the videos no longer play or even work at all. They appear as a blank box with the controls but pressing play does nothing and opening the video full screen does nothing.
Here is my relatively simple code
<video playsinline onclick="play()" controls autoplay
controlsList="nodownload">
<source src="assets/images/video_im.mp4" type="video/mp4">
</video>
I've tried different variations of using playsinline="true" and controls="true". They have no effect.
I've tried to google the issue but there seems to be nothing except a podcast taking about ios 11 removing html5 video support, surely there is a fix?
Any insight/help would be much appreciated.
Cheers
It looks like the following code:
<video>
<source src="path/to/video.mp4">
</video>
stopped working on ios11 (with many other features too...). I confirm that source tag did work on ios9 here). Try placing the src="path/to/video.mp4" into the video tag directly, it should work on ios11.
A working example taken from webkit.org post on New video Policies for iOS:
<div id="either-gif-or-video">
<video src="image.mp4" autoplay loop muted playsinline></video>
<img src="image.gif">
</div>
Safari on MacOS seems to have a similar problem, maybe it's easier to test there. Looks like we lost the multiple source feature tho :(
I had a similar problem with videos not playing on Safari. The problem was my web server. I moved the video to another hosting server, loaded it from there and it worked.
e.g.
instead of:
<video src='/myVideo.mp4' controls> </video>
do something like this:
<video src='https://anotherServer.com/myVideo.mp4' controls> </video>

Video not playing in html (webhost000 or byethost5)

I'm writing because I made a background video for my site, of course its looks like this:
<video autoplay="" loop="" class="fillWidth fadeIn wow collapse in" data-wow-delay="0.5s" poster="images/poster.jpg" id="video-background">
<source src="video/wd0280.webm" type="video/webm">Your browser does not support the video tag. I suggest you upgrade your browser.
</video>
And my problem is that it normally plays in localhost, but when I go to a hosting site, for example webhost000 or byethost then its stop playing, even if I try with different video format
Why is this happening? Is it in connection with the free webhosting servers? Can someone tell me then which to choose to work perfectly?
Thank you for helping me out.
you can use iframe to play any media file at webpage
<iframe width="440" height="350"
src="http://www.cricingif.com/Ball/201004">
</iframe>
Your browser does not support the video tag. I suggest you upgrade your browser.
The problem was, that I misstyped my video file name, so it was a typo, but now its working fine. Thanks.
You have to ensure that the video is muted for it to play in a modern browser. Try:
<video autoplay muted loop= class="fillWidth fadeIn wow collapse in"
data-wow-delay="0.5s" poster="images/poster.jpg" id="video-background">
<source src="video/wd0280.webm" type="video/webm">
Your browser does not support the video tag. I suggest you upgrade your browser.
</video>