sahin / mobileplayer-ios

:iphone: :movie_camera: A powerful and completely customizable media player for iOS
Other
3.07k stars 356 forks source link

Customize Fullscreen button #170

Open ducnv55 opened 7 years ago

ducnv55 commented 7 years ago

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

  2. 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!

liuyongVAE commented 7 years ago

I have same problem and waiting for the response

thanhBkap commented 6 years ago

@ducnv55 @liuyongVAE 1. you can add a button in your config json with another identifier like advance in example and

  1. you can do it by add a new player controller then transform 90 degree player view