Autoplay video in Mobile / Chrome

Question

I want to play video and audio in autoplay mode, When both are ready to play.
I’m using this code.


function onYouTubeIframeAPIReady() {
  var player;
  player = new YT.Player('YouTubeVideoPlayer', {
    videoId: 'ID', // YouTube Video ID
    width: 560,               // Player width (in px)
    height: 316, 
    start:0,             // Player height (in px)
    playerVars: {
      autoplay: 1,        // Auto-play the video on load
      controls: 0,        // Show pause/play buttons in player
      showinfo: 0,        // Show pause/play buttons in player
      rel: 0,        // Hide the video title
      modestbranding: 0,  // Hide the Youtube Logo
      loop: 0,            // Run the video in a loop
      fs: 1,              // Hide the full screen button
      cc_load_policy: 0, // Hide closed captions
      iv_load_policy: 3,  // Hide the Video Annotations
      autohide: 1         // Hide video controls when playing
    },
    events: {
      onReady: function(e) {
       e.target.setVolume(100);
      }
    }
  });
 }
  • This code is working fine in desktop browsers. But when I try it on mobile device it is not working.

I had already given up, until I found this page. It works on both Mobile and Chrome. The question is, how?

Page: https://neilpatel.com/br/master-class/?v=noredirect

0
user4817258 5 months 2020-12-17T13:10:48-05:00 0 Answers 7 views 0

Leave an answer

Browse
Browse