Mục lục bài viết

Mẹo Hướng dẫn Video does not autoplay on mobile browser 2022

Cập Nhật: 2021-11-30 01:06:06,Quý quý khách Cần tương hỗ về Video does not autoplay on mobile browser. Quý quý khách trọn vẹn có thể lại Comment ở phía dưới để Tác giả đc tương hỗ.

700

I have this code to play a video in a html5 page:

The problem is that it does not work in mobile chrome (Android Phone) and either in mobile safari (iPhone). But it works in “every” browser (tested with Safari, Chrome, Firefox) in desktop and also on mobile firefox (Android Phone).

How can I overcame this problem?

Edit: Added this code:

var myVideo = document.getElementById(“bgvid”);
function playVid()
myVideo.play();

function pauseVid()
myVideo.pause();

If I add a button that trigger the function playVid() it works. So I think the problem is on the autoplay. I tried to trigger the function with the load sự kiện but it does not works.

I have read that autoplay was not possible, or not advised on both iOS and Android (more on that here: no autoplay in iframe HTML5 player on mobile (Android Chrome and Firefox)?). But I was wondering if there was a way that would allow to replicate the same behavior, that is the video playing soon as the page is loaded.

I have tried preloading the video, and playing it once the DOM is loaded, I tried forcing a play soon as the video can be played, none of that work, it always result in the user having to tap the video to play it.

Can anyone help?

NB: I’m working with plain old JavaScript, no jQuery.

Video full hướng dẫn Chia Sẻ Link Tải Video does not autoplay on mobile browser ?

– Một số Keyword tìm kiếm nhiều : ” Review Video does not autoplay on mobile browser tiên tiến và phát triển nhất , Chia Sẻ Link Download Video does not autoplay on mobile browser “.

Giải đáp vướng mắc về Video does not autoplay on mobile browser

Quý quý khách trọn vẹn có thể để lại Comments nếu gặp yếu tố chưa hiểu nhé.
#Video #autoplay #mobile #browser