Autoplaying in safari

<video src="myMovie.mov" autoplay></video>

As soon as the page is loading, the movie is playing automatically in chrome.
But the movie is not playing in Safari of my mobile phone although the page is loaded.

Can I make it to play automatically in safai with your help?

Maybe you have the opposite problem to that described here.

TLDR: You’ll have to add muted to your video tag to get it past the default chrome and safari settings level.

3 Likes

As I test more, I found the movie which has the code above is not playing with all chromes.
It is playing with chrome in desktop only, not in handphone.

I like to make it autoplay with chrome in handphone.
I gave it up with safari

<!DOCTYPE HTML> 
<html lang="ko">
<head>
<meta charset="utf-8"> 
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1"> 
<title>autoPlay</title>  

<style media="screen"></style> 
</head>  
<body>
<video src="test.mov" autoplay controls width="500"></video>
<script>
document.getElementById('vid').play();
</script> 
</body>  
</html>

The code above is at http://form.kr/test/autoPlay.php

I found that autoplaying does work when it comes through the link in a page of same domain only,
If the domain is different, the autoplaying doesn’t work.

if you click the link above, a movie comes but not autoplaying because sitepoint.com is different domain from form.kr

It is interesting and very complex.

(1) http://form.kr/test/autoPlay.php

Autoplaying doesn’t work with the above direct link to autoplay page.

Autoplaying does work with the below indirect link to auoplay page.

(2) http://form.kr/test/linkToautoPlay.php

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.