youtube-ios-player-helper
youtube-ios-player-helper copied to clipboard
loadVideoByURL isn't working
Following line does nothing:
playerView.loadVideoByURL("https://www.youtube.com/watch?v=rDWuqrJAyGw", startSeconds: 0.0, suggestedQuality: .Default)
I cannot load video by URL, too.
The URL has to be in the format http://www.youtube.com/v/VIDEO_ID?version=3
I've tried but it's not working
@chenso Got it! So if the full url is https://www.youtube.com/watch?v=iEPTlhBmwRg, then the argument would be http://www.youtube.com/v/iEPTlhBmwRg?version=3.
@JackWangz still a issue. It must parse any link, because what the point to have this function :\
loadVideoByURL:
Doesn't setup the YTPlayerView's internal web view- it simply updates the source url in the player.
Try using one of the - (BOOL)loadWith...
variants first, then setting the URL. Example:
in viewWillAppear:
playerView.delegate = self
playerView.loadWithVideoId("")
in playerViewDidBecomeReady (YTPlayerViewDelegate):
playerView.loadVideoByURL("https://www.youtube.com/v/rDWuqrJAyGw?version=3", startSeconds:0, suggestedQuality: .Default)
(may not compile- translated from Obj-C)
The URL has to be in the format http://www.youtube.com/v/VIDEO_ID?version=3
Wow, that's a very strange approach to use a strictly written link. Can't Youtube just parse their own URLs?
And what about these?
- https://www.youtube.com/watch?v=XXXXXXXXXXX
- https://youtu.be/XXXXXXXXXXX
- https://www.youtube-nocookie.com/embed/XXXXXXXXXXX
- there might be other, I guess…
As long as URLs are often input by people (content creators), the URLs are usually taken from the most accessible places:
- from the browser address bar
- via sharing buttons.
And here is what's happening next:

I don't understand the scenario "B", why it is needed? It would be more useful for developers to have the scenario "C".
P.S. Is there a place where I can post the issue/request ticket for the IFrame Player API?
The required format doesn't work either. I tried this http://www.youtube.com/v/VIDEO_ID?version=3 as documented here but no luck.