Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add YTPlayerView-iframe-player.html in the asset bundle #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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