I am trying to integrate the Youtube iframe API on Xbox One to be able to play Youtube videos from an application, but so far did not manage to make it work. Is it even possible ?
It seems that windows store apps imposes a lot of restrictions compared to a web app (for very understandable security reasons).
The first problem when porting the web app is the local context / web context. There seems to be two options there:
- grab a version of Youtube's code (at least the part that loads the library) and integrate it into the app (this way, we control more of the code at certification time, but it could eventually not be in sync anymore with the rest of the web code)
- load all Youtube's code from the web in a web context (by putting the YT.player inside another iframe) and then do a proxy in the local context to post messages to the equivalent web context.
What method is the recommended one ?
The second problem is that IE in the application seems to load YouTube's videos in Flash, because it complains about ActiveX not being there. I get the following error:
Exception was thrown at line 328, column 376 in
https://s.ytimg.com/yts/jsbin/www-embed-player-new-vflRnMsMv/www-embed-player-new.js
0x800a1391 - JavaScript runtime error: 'ActiveXObject' is undefined
Is there a way to force the app to load videos in HTML5 instead of flash ? I tried setting html5=1 in the playerVars, like in the following code (as suggested in http://jsfiddle.net/rocha/eMAU5/), but it didn't help:
player = new YT.Player('player', {
height: '390',
width: '640',
videoId: 'OEoXaMPEzfM',
playerVars: {
html5: 1,
}
Or maybe I am not interpreting correctly the reason for the loading of this ActiveX ? I know that ActiveX are deactivated in windows store applications (and X1 apps). Anyway, how can I make this work (if at all possible) ?
Thank you