How to run a video on Android Chrome?

Asked

Viewed 465 times

2

How to run a video with the video tag in the google Chrome browser?

My code:

<video autobuffer id="bgVideo" loop="true" volume="0">
                    <source src="/video_bg_1.webm" type="video/webm">
                    <source src="/video_bg_1.ogg" type="video/ogg">
                    <source src="/video_bg_1.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
</video>

1 answer

0

Remove the attribute type tag source and implement play via Javascript.

var player = document.getElementById("bgVideo");

function playVideo() {
  player.play();
}

put this function in body onload = "playVideo()" and in the video tag put the attribute loop to keep replaying the video. maybe this will solve.

  • is that I’m using this video as background

Browser other questions tagged

You are not signed in. Login or sign up in order to post.