Friday, October 19, 2012

[YouTube-API] Re: Youtube iframe embed set webkit-playsinline

My guess (and this is just a guess), is that the youtube iOS6 app video player is a full native implementation and not using a UIWebView.
The behavior of the player is very different than one which a UIWebView would bring up. On rotation to landscape it automatically goes full screen and the controls on the landscape player are very different from standard iOS controls from a UIWebView player.

On Thursday, October 18, 2012 8:10:27 PM UTC-7, alex wrote:
I am curious how the new Youtube app (for iOS6) does it? 
is it embedding webkit-playsinline into the video tag?



On Wednesday, March 7, 2012 9:30:51 PM UTC+8, Grimmrobe wrote:
HI All,

I'm trying with 0 success to set the webkit-playsinline attribute on the video element created with an iframe youtube embed.

The code I'm using is from a youtube api example I found a whlie ago:

// 2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "http://www.youtube.com/player_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

// 3. This function creates an (and YouTube player)
//    after the API code downloads.
var player;
function onYouTubePlayerAPIReady() {
  player = new YT.Player('player', {
    height: '538',
    width: '750',
    videoId: 'u1zgFlCw8Aw',
    events: {
      'onReady': onPlayerReady,
      'onStateChange': onPlayerStateChange
    }
  });
}

Anybody know of a solution?

--
Starting October 15, 2012, this group will stop accepting new posts. We recommend that developers start using Stack Overflow and the Issue Tracker for YouTube API support. More details about this change and relevant links can be found at http://apiblog.youtube.com/2012/09/the-youtube-api-on-stack-overflow.html
 
 

No comments:

Post a Comment