1

I have made a windows store app using the Youtube Iframe API. I can handle events and play video fine but there is a major problem as it doesnt support full screen mode (amongst some other minor niggles).

I have been looking in the app store and I see that the majority of youtube player apps do not use the iframe API, they grab the video direct and put it into the standard HTML5 video player.

I have done a lot of searching and the only way I can see people are doing this is by parsing the youtube page to find the video file the Youtube player is going to play and loading this directly into the media player.

I have a few problems with this method.

  1. I am not sure if this is legal as it may break youtubes terms and conditions
  2. If page at youtube changes it can break app.

Neither of these situations are acceptable.

Is there any way to get full screen to work inside app or get a direct video stream legitimately?

Guerrilla
  • 13,375
  • 31
  • 109
  • 210
  • Also I just noticed when I simulate tablet being rotated in the simulator it breaks playback and I get "video unavailable". It seems the only viable way to play youtube videos in a windows 8 app is to scrape the mp4 file from the youtube page. Am I wrong? – Guerrilla Feb 05 '13 at 16:15
  • The youtube iframe API does support fullscreen. Using `fs=1` parameter in the embed URL. Which is actually enabled by default. https://productforums.google.com/forum/#!topic/youtube/q7cAnPlN_-Y has a similar issue on FireFox, where it was due to permission issues. Perhaps you need to request a fullscreen permission for windows store apps as well? – Norman Breau Apr 05 '18 at 13:56

1 Answers1

1

Not sure about the copyright and youtube terms stuff but here is how you do it apparently:

Show Youtube video source into HTML5 video tag?

Looks like it's browser specific and youtube generates different html for different browsers.

I would make an ajax request to the youtube url appending html5-true then use jQuery to scrape the source for the video tag, add your attributes and then append to your page.

Now you have the tag that youtube uses so I'm assuming what works on their webpage will work o yours.

Probably violates all terms and conditions...

Community
  • 1
  • 1
mattdlockyer
  • 6,984
  • 4
  • 40
  • 44
  • 1
    Thanks for link. I have seen this method discussed. I saw one app that said it impersonated user agent to do something similar and get around various issues with it not working. It all just seems so fragile though. Youtube change what they do and it all goes to hell. I think I am going to drop the idea of a store app and just move it to a web mvc4 app as then fullscreen mode will be supported. – Guerrilla Feb 06 '13 at 11:58