Skip to content

Commit

Permalink
Merge branch 'develop' into release/2.4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Eliza Sapir committed Sep 5, 2016
2 parents 226ed8c + 130a584 commit 24295dc
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions KALTURAPlayerSDK/KPPlayerConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#define EMBEDFRAME_PAGE @"mwEmbedFrame.php"
#define EMBEDFRAME_PAGE_WITH_SLASH @"/mwEmbedFrame.php"
#define EMBEDLOADER_PAGE_WITH_SLASH @"/mwEmbedLoader.php"

@interface KPPlayerConfig() {
NSMutableDictionary *_extraConfig;
Expand Down Expand Up @@ -303,13 +304,15 @@ - (void)resolveEmbedFrameUrlWithCompletionHandler:(void (^)(BOOL success))handle
// embedLoaderUrl is something like "/html5/html5lib/v2.38.3/mwEmbedLoader.php".
// We need "/html5/html5lib/v2.38.3/mwEmbedFrame.php"

NSString* embedFrameUrl = [[embedLoaderUrl stringByDeletingLastPathComponent] stringByAppendingPathComponent:EMBEDFRAME_PAGE];
NSString* embedFrameUrl = [embedLoaderUrl stringByReplacingOccurrencesOfString:EMBEDLOADER_PAGE_WITH_SLASH withString:EMBEDFRAME_PAGE_WITH_SLASH options:NSBackwardsSearch range:NSMakeRange(0, embedLoaderUrl.length)];

// Usually it's relative to original server URL
if ([embedFrameUrl hasPrefix:@"/"]) {
// Relative to original server URL
// Trim slash.
NSString* url = [_server stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]];
embedFrameUrl = [url stringByAppendingString:embedFrameUrl];
}
}

// Cache for later
NSDictionary* newServerConf = @{
EMBEDFRAME_PAGE: embedFrameUrl,
Expand Down

0 comments on commit 24295dc

Please sign in to comment.