Video wont auto play in chrome - javascript

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.

Related

auto play video element in html reactJs

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/

Sound not coming from video in video tag in chrome

I am trying to use a video with sound in the video tag but the sound is not playing when I run it in browser ,if I remove the muted attribute video doesn't play .The video directly works in browser if you open the link.Please help
<div class="background-wrap">
<video preload="auto" autoplay="true" loop="loop" muted>
<source src=http://techslides.com/demos/sample-videos/small.mp4 type="video/mp4"> </video>
</div>

How to fix html5 video freeze?

I have an HTML5 video tag on a home page of a website. But when I check the website on browsers like chrome and firefox, the video is freezing even though it is set to autoplay.
Video tag code:
<div class="video-container fullscreen fixed video-container-overlay hide-on-mobile">
<video muted="muted" autoplay preload loop>
<source src="my_video.mp4" type="video/mp4" />
<source src="my_video.mp4" type="video/ogg" />
</video>
</div>
Any help is appreciated. Thanks.

video is not playing on chrome but playing in other browsers

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.

HTML5 player wont play video from subdomain on smartphone

What is the problem with video tag and HTML5, i can start videos but seek does not work from subdomain on smartphone, when i try in browser and PS all working fine
This is working fine, and seeking working here, but when i change src for video files to subdomain, video is start but seeking not working
<video id="videoPlayer"
src="1.mp4"
style="width:720px; height:440px;"
controls="controls"
type="video/mp4"
onClick="this.play();">
</video>
EDIT: Its not working from my storage server, where is installed lighttpd... from subdomain where is apache seek working fine
try the following code if it helps:
<video id="video player"
width="720"
height="440" controls>
<source src="1.mp4" type="video/mp4" onClick=this.play()>
</video>
Hope this helps out

Categories

Resources