0

I have a UITableView which contains videos. I have 4 cells in UITableView. When I click on the video it should open in portrait mode. If rotate the mobile it moves to landscape.

What my requirement is, when I click on the cell, video should display in landscape mode without rotation. Is it possible or not?

Thanks in advance for your suggestions.

Boris Y.
  • 4,387
  • 2
  • 32
  • 50
Pavan Alapati
  • 317
  • 1
  • 5
  • 17
  • [Maybe this will help, similar problem](http://stackoverflow.com/questions/4740732/iphone-force-mpmovieplayercontroller-to-play-video-in-landscape-mode?rq=1) Personally, I don't think this is good idea. YouTube does it and I don't like it. Apps shouldn't force user to rotate device, except, they can work only in landscape whole time. – Boris Y. Jun 12 '14 at 12:00
  • @borisy thank for reply if you any idea about my requirement please post my Requirement is video should play landscape mode without rotation – Pavan Alapati Jun 12 '14 at 12:05

1 Answers1

0

Yes It is possible. I did same in my application.

  1. First up all create custom view and add player as sub view on that view.
  2. create custom Play and pause button for player.
  3. Add button on player for showing full screen mode.
  4. If user click on full screen button then rotate player using transform and adjust size of custom view as par landscape mode.

5.when user again click on that button then again rotate as original and set coordinate as previous.

You can also refer this link for more clarification iOS: Movie player view doesn't rotate

Hope this will help.

Community
  • 1
  • 1
Vibha Singh
  • 623
  • 4
  • 9