From 1961cd430d97df1ee8b5d5f0973b59ec70d7a190 Mon Sep 17 00:00:00 2001 From: Baris Sencan Date: Wed, 9 Dec 2015 18:05:10 -0800 Subject: [PATCH 1/2] [MobilePlayerViewController] Dismiss postroll when playback starts Fixes #97 --- MobilePlayer/MobilePlayerViewController.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MobilePlayer/MobilePlayerViewController.swift b/MobilePlayer/MobilePlayerViewController.swift index 58612a3..9121c6c 100644 --- a/MobilePlayer/MobilePlayerViewController.swift +++ b/MobilePlayer/MobilePlayerViewController.swift @@ -155,6 +155,8 @@ public class MobilePlayerViewController: MPMoviePlayerViewController { userInfo: [MobilePlayerErrorUserInfoKey: error]) } if let postrollVC = self.postrollViewController { + self.prerollViewController?.dismiss() + self.pauseOverlayViewController?.dismiss() self.showOverlayViewController(postrollVC) } } @@ -537,6 +539,7 @@ public class MobilePlayerViewController: MPMoviePlayerViewController { } prerollViewController?.dismiss() pauseOverlayViewController?.dismiss() + postrollViewController?.dismiss() } else { playButton?.toggled = false hideControlsTimer?.invalidate() From ae3429cf525a0241d84ea9aaab98e81a3fe8505f Mon Sep 17 00:00:00 2001 From: Baris Sencan Date: Wed, 9 Dec 2015 18:13:10 -0800 Subject: [PATCH 2/2] [MobilePlayerViewController] Improve play and pause documentation --- MobilePlayer/MobilePlayerViewController.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MobilePlayer/MobilePlayerViewController.swift b/MobilePlayer/MobilePlayerViewController.swift index 9121c6c..d9c2bf7 100644 --- a/MobilePlayer/MobilePlayerViewController.swift +++ b/MobilePlayer/MobilePlayerViewController.swift @@ -286,11 +286,16 @@ public class MobilePlayerViewController: MPMoviePlayerViewController { } /// Initiates playback of current content. + /// + /// Starting playback causes dismiss to be called on prerollViewController, pauseOverlayViewController + /// and postrollViewController. public func play() { moviePlayer.play() } /// Pauses playback of current content. + /// + /// Pausing playback causes pauseOverlayViewController to be shown. public func pause() { moviePlayer.pause() }