Skip to content

Commit

Permalink
Handle 'fullscreen-state=fullscreen' parameter
Browse files Browse the repository at this point in the history
 - DMPlayerViewController must default to YES when starting in
   fullscreen
 - Start player in fullscreen in PlaybackViewController
  • Loading branch information
dharFr committed Mar 30, 2016
1 parent 5e1e96d commit e60e7ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dailymotion-player-objc/DMPlayerViewController.m
Expand Up @@ -105,6 +105,10 @@ - (void)initPlayerWithVideo:(NSString *)video {
webview.allowsInlineMediaPlayback = YES;
}

if ([self.params[@"fullscreen-state"] isEqualToString:@"fullscreen"]) {
_fullscreen = YES;
}

// Autoresize by default
webview.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

Expand Down
4 changes: 4 additions & 0 deletions test-project/PlaybackViewController.m
Expand Up @@ -33,6 +33,10 @@ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
[playerViewController loadVideo:self.videoID withParams:self.additionalParameters];

self.initialPlayerSize = self.playerSize;
// Starting in fullscreen?
if ([self.additionalParameters[@"fullscreen-state"] isEqualToString:@"fullscreen"]) {
self.playerSize = self.view.frame.size;
}
self.playerWidthLayoutConstraint.constant = self.playerSize.width;
self.playerHeightLayoutConstraint.constant = self.playerSize.height;

Expand Down

0 comments on commit e60e7ca

Please sign in to comment.