diff --git a/MobilePlayer/MobilePlayerViewController.swift b/MobilePlayer/MobilePlayerViewController.swift index 58612a3..d9c2bf7 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) } } @@ -284,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() } @@ -537,6 +544,7 @@ public class MobilePlayerViewController: MPMoviePlayerViewController { } prerollViewController?.dismiss() pauseOverlayViewController?.dismiss() + postrollViewController?.dismiss() } else { playButton?.toggled = false hideControlsTimer?.invalidate()