در این مطلب از سایت میرممد یک تکه کد جاوا اسکریپت آماده براتون میذارم که پخش اتوماتیک ویدئو در مرورگر های فایرفاکس،کروم و اپرا و. رو انجام میده.
<script>
var video = document.querySelector('video');
var promise = video.play();
if (promise !== undefined) {
promise.then(_ => {
// Autoplay started!
}).catch(error => {
// Show something in the UI that the video is muted
video.play();
});
}
</script>
امیدوارم مفید بوده باشه.
درباره این سایت