ITVlab/YouTube-Tv-Player

Video unavailable

walkerreynolds16 opened this issue · 7 comments

I have gotten my app working pretty well, but whenever I try to play a music video or a video for a song, It only shows "Video Unavailable". I know YouTube is picky about playing certain videos, mainly music videos, in an embedded form, but I was able to play most of these videos on a simple site with a YouTube Iframe in it. I'm not sure if you have any input on this, but any feedback would be great since this problem pretty much breaks how I want to use my app.

Thanks

Music videos in particular end up getting limited a lot when being embedded. As this project uses the same principles as the iframe, I'm unsure why it would be different on a website compared to this.

I'm not sure why it's different than a website either. I'm still doing some research on what could fix it. I'll try to give an update when I find something.

OK I have a theory for why it might not be working. When you setup the YouTube URL in loadVideo() of YouTubePlayerView, an origin is not being set in the URL. I'm guessing if no origin is stated, YouTube gets really picky with what videos it shows, mainly videos that are owned by music groups.

This is just a thought, but it could be changed to allow specifying an origin, that may help.
https://developers.google.com/youtube/player_parameters#origin

Is there a domain this works with directly, or should it be a parameter that one can set?

I saw somewhere online where they just put www.youtube.com and they said that worked, but I feel like this is somehow against one of their policies. I would make it a parameter that can set which defaults to no origin or youtube.com.

So after more testing and changing around the library code, it seems that setting the origin in the URL does not help my issue. While I think this is still a good thing to have in the project, It will not help me.

Right now, I think the issue is something else in the chain of showing the video. I was able to make a static website hosted here that, I'm guessing approximates how the webview is showing the YouTube player. On the webpage, the video plays without any errors, but when played on my app, it does not.

Does this player use an Iframe for the webview? If it doesn't, it could be the reason why some of the videos aren't loading. If you go the direct link of the embed player, the video will not play.

Yes, this project used the /embed/ version of the YouTube link directly