sahin / mobileplayer-ios

:iphone: :movie_camera: A powerful and completely customizable media player for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Customize Fullscreen button

ducnv55 opened this issue · comments

I want to customize your library a little bit, and I have 2 issues here.
They are Fullscreen button and Video orientation when press fullscreen button

  1. I want to put a fullscreen button to my app (using your library), but I don't know how to append it to BottomBar.
    My code just put fullscreen button into player.view like below:

     let player = MobilePlayerViewController(contentURL: URL(string: "abc.mp4")!)
    
     player.title = "Video title"
     player.activityItems = [videoURL!]
    
     let fullScreenButton = UIButton(frame: CGRect(x: 100, y: 100, width: 30, height: 30))
     fullScreenButton.setBackgroundImage(#imageLiteral(resourceName: "fullscreen"), for: .normal)
     fullScreenButton.addTarget(self, action: #selector(fullscreenButtonTapped), for: UIControlEvents.touchUpInside)
     
     player.view.addSubview(fullScreenButton)
     presentMoviePlayerViewControllerAnimated(player)
    

Below is how my app looks like:
https://drive.google.com/open?id=0B_xqd7iS_Qn6dW5RS1lidGg4OHM

  1. When I click Fullscreen button I want to keep iPhone on vertical orientation, but video rotate horizontally (still fullscreen) like Youtube app. How can I do that?

Please help me, thank you!

I have same problem and waiting for the response

@ducnv55 @liuyongVAE 1. you can add a button in your config json with another identifier like advance in example and
2. you can do it by add a new player controller then transform 90 degree player view