I want to play video and audio in autoplay mode, When both are ready to play. I'm using this code.
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?