Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Look for YTPlayerView-iframe-player.html in main directory as well #241

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Classes/YTPlayerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,13 @@ - (BOOL)loadWithPlayerParams:(NSDictionary *)additionalPlayerParams {
ofType:@"html"
inDirectory:@"Assets"];
}

// React-Native's bundler can only put resources files in the main bundle directory
if (!path) {
path = [[NSBundle bundleForClass:[YTPlayerView class]] pathForResource:@"YTPlayerView-iframe-player"
ofType:@"html"
inDirectory:nil];
}

NSString *embedHTMLTemplate =
[NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error];
Expand Down