angular-youtube-embed icon indicating copy to clipboard operation
angular-youtube-embed copied to clipboard

Inline video and autoplay on iOS10

Open mrphilipandrews opened this issue 9 years ago • 1 comments

Is it possible to embed the videos as inline for phones with iOS10?

Also would be it possible to autoplay the video after the user clicked on somewhere on screen? I've used this technique with vanilla html5 video. When the user first loads the site there is BEGIN button which plays a blank video, after that point i change the video src attribute at anytime so the video autoplays e.g.

<script>
function begin(){
     var vid = document.querySelector('video');
     vid.play();
     //autoplay video 2 secs after begin click
     setTimeout(function(){
         vid.src = 'someothervid.mp4';
         vid.play();
     },2000);
}
</script>
<video src="blank.mp4" webkit-playsinline playsinline></video>
<button onclick="begin()">Begin</button>

mrphilipandrews avatar Jun 01 '17 23:06 mrphilipandrews

@fatlinesofcode Did you ever figure out if you could get yours to play inline with embed? I can't get mine to work and wonder if there is a work around.

mcarthurnick avatar Dec 22 '17 22:12 mcarthurnick