I am using youtube as a music player and every time someone accesses on iOS devices it opens the video in full screen. Follow my code with playsinline.
var buildPlayer = function(videoUrl)
{
playerLoading = true;
player = new YT.Player(attrs.container, {
height: '200',
width: '200',
videoId: getIdFromUrl(videoUrl),
playerVars: {
enablejsapi: 1,
playsinline: 1,
html5: 1,
},
events: {
'onReady': onPlayerReady,
'onStateChange': onStateChange
}
});
}