youtube-ios-player-helper icon indicating copy to clipboard operation
youtube-ios-player-helper copied to clipboard

loadVideoByURL isn't working

Open kerbelda opened this issue 9 years ago • 8 comments

Following line does nothing:

playerView.loadVideoByURL("https://www.youtube.com/watch?v=rDWuqrJAyGw", startSeconds: 0.0, suggestedQuality: .Default)

kerbelda avatar Dec 20 '15 20:12 kerbelda

I cannot load video by URL, too.

huynguyencong avatar Dec 25 '15 11:12 huynguyencong

The URL has to be in the format http://www.youtube.com/v/VIDEO_ID?version=3

chenso avatar Jan 05 '16 18:01 chenso

I've tried but it's not working

quyendx avatar Feb 19 '16 08:02 quyendx

@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 avatar Apr 21 '16 02:04 JackWangz

@JackWangz still a issue. It must parse any link, because what the point to have this function :\

bossly avatar May 02 '16 19:05 bossly

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)

HaikuDennis avatar May 17 '16 20:05 HaikuDennis

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:

Screenshot 2020-04-03 at 15 12 15

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?

nordskill avatar Apr 03 '20 13:04 nordskill

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.

codewithdo avatar Jan 06 '23 13:01 codewithdo