Skip to content

Commit

Permalink
Merge pull request #11 from krickp/master
Browse files Browse the repository at this point in the history
fix issue : Video status frame didn't appear when tapping on video in…
  • Loading branch information
JanGorman committed Jul 26, 2017
2 parents 4e71239 + 0c140e5 commit 461ab57
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Example/Player Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class ViewController: UIViewController {

isPlayerFullscreen = size.width > size.height
playerViewController.toggleFullscreen()
updatePlayerSize()
updatePlayer(height: size.height)
}

@IBAction private func play(_ sender: Any) {
Expand All @@ -78,17 +78,17 @@ extension ViewController: DMPlayerViewControllerDelegate {
fileprivate func toggleFullScreen() {
isPlayerFullscreen = !isPlayerFullscreen
updateDeviceOrientation()
updatePlayerSize()
updatePlayer(height: view.frame.size.height)
}

private func updateDeviceOrientation() {
let orientation: UIDeviceOrientation = isPlayerFullscreen ? .landscapeLeft : .portrait
UIDevice.current.setValue(orientation.rawValue, forKey: #keyPath(UIDevice.orientation))
}

fileprivate func updatePlayerSize() {
fileprivate func updatePlayer(height: CGFloat) {
if isPlayerFullscreen {
playerHeightConstraint.constant = view.frame.size.height
playerHeightConstraint.constant = height
} else {
playerHeightConstraint.constant = initialPlayerHeight
}
Expand Down

0 comments on commit 461ab57

Please sign in to comment.