I'm developing a site in which I want to play video in background. Following is my code, video is playing in Internet explorer but not in Chrome. I'm using 2.2.4 version of jquery and I cannot change it because my all site is developed and If I change jquery than my whole site stops working.
<video id="vid" width="110%" height="100%" autoplay controls loop muted="muted">
<source src="../img/led.mp4" type="video/mp4" />
</video>
Thanx in advance.
Related
I tried this code to implement the autoplay video feature without the control bars but the issue that I faced was, the video was not autoplaying after refreshing the page. this project is in react. even after adding an autoplay attribute, the video is not autoplaying. what's the mistake am I doing?
I expect it to be autoplaying even after refreshing the page
I tried this code to implement the autoplay video feature without the control bars but the issue that I faced was, the video was not autoplaying after refreshing the page. this project is in react. even after adding an autoplay attribute, the video is not autoplaying. whats the mistake am I doing?
<video id="coinSaverIcon" autoPlay playsInline>
<source src={coinsaverIcon} type="video/webm" />
</video>
You can add muted property
<video id="coinSaverIcon" autoPlay playsInline muted>
<source src={coinsaverIcon} type="video/webm" />
</video>
In some browsers autoplay (Chromium for example) is not allowed anymore.
Furthermore you shouldn't implement this kind of features for accessiblity issues.
https://www.w3schools.com/tags/att_video_autoplay.asp
https://www.a11yproject.com/posts/never-use-auto-play/
I have added a video to my site. Added code for autoplay in the video. It works fine on Firefox, but not auto playing in Chrome.
Here is the code I have added to show the video:
<video id="vid" autoplay="autoplay" loop="loop" width="100%" height="100%">
<source src="https://example.com/video.mp4" type="video/mp4" />
</video>
Also, when I face the issue, I searched for this and found a script. Here is what I have tried:
<script>
document.getElementById('vid').play();
</script>
But still, the video just below menu is not auto-playing on Chrome.
I have checked the Chrome autoplay guidelines and my video is not violating that. I have a muted video but still not auto playing.
Any workaround for that?
Thank you in advance.
If think you need to add playsinline autoplay muted loop into you'r video tag.
autostart="false"
<video id="vid" autoplay="false" loop="loop" width="100%" height="100%">
<source src="https://example.com/video.mp4" type="video/mp4" />
</video>
or
https://www.groovypost.com/howto/disable-autoplay-videos-on-sites-in-google-chrome/
try this
If you want auto play option on then make this and your chrome browser should be upper than 4.0 then this code will work.
I would like to autoplay a small video on chrome with data saver enabled. When the data saver is enabled chrome is blocking all html5 autoplay and play initiation via. script.
<video autoplay muted controls>
<source src="file.mp4">
</video>
Nevertheless there are some html5 players which still work. So it is possible and the question is how.
For example https://www.cb-1100.de/forum/viewtopic.php?f=27&t=1144 (below the first post)
I don't understand, I have a project with Angular2 and in my home component, I try to display a video with html5. The problem is that sometimes, on some videos, the tag doesn't play sound:
<div class="video-gallery">
<video id="video" controls preload="auto" width="640" height="420" poster="assets/imgs/video_logo.png" >
<source src="assets/videos/{{videos[0].name + videos[0].extension}}" type="video/mp4" />
</video>
</div>
When I say 'on some videos' I mean it's not up to the extension, some videos are mp4 and play sound and others (mp4) don't. Same thing for mkv for example. I only get the video but no sound. What could be the problem ? I work with Chrome's last version so I don't think it's from chrome because it is supposed to support video and sound of html5 . Can it be from the video tag ?
Thanks
<video autobuffer controls autoplay>
<source id="mp4" src="../vid/coolvideo.mp4" type="video/mp4">
</video>
Is there anyway to autoplay a .mp4 video file on page load for iPhone and Android Smart Mobile Devices. The above works great in the browser, but struggles hard on smart mobile. Is there any other HTML5 or even If I must JS solutions for iPhone (without loading a bloated third-party resource, ideally). Plain javaScript or plain jQuery, HTML5 solutions ideal.
It works only if you add muted and playsinline attributes
<video autoplay playsinline muted loop>
<source src="cover.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
Check this link
which says:"autoplay is disabled to prevent unsolicited cellular download"