Skip to content

Conversation

@didia
Copy link

@didia didia commented Feb 3, 2020

In our project, we replaced the official pod (not maintained anymore) by this pod to use youtube on iOS. But we could not make it work. After investigating, we found out that there are still code path in the library that requires having the file YTPlayerView-iframe-player.html in the Assets.bundle.

In our usage, we needed to pass custom params when loading the Youtube video. Our code was like this:

let player = InlineYoutubeView(htmlUrl: "", andVideoPlayerMode: .fullScreen)
player.load(withVideoId: videoComponent.getVideoId(), playerVars: ["disablekb": 1, "rel": 0, "playsinline": 0, "showinfo": 0, "controls": 0, "modestbranding": 1])

This did not work even when we tried to set the htmlUrl param to the one in the Readme.
After investigating, we found that we needed the YTPlayerView-iframe-player.html for loading video that way to work.

The code path involved is precisely at line

NSString *path = [[NSBundle bundleForClass:[InlineYoutubeView class]] pathForResource:@"YTPlayerView-iframe-player"

@didia didia changed the title Add youtube iframe player file in the asset folder Add YTPlayerView-iframe-player.html in the asset bundle Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant