开发者

Movieplayer doenst rotate anymore when I used setControlStyleNone

开发者 https://www.devze.com 2023-01-02 12:31 出处:网络
I added this to my code when im initializing the movie [m_pMPmpc.moviePlayer setControlStyle:MPMovieControlStyleNone];

I added this to my code when im initializing the movie

[m_pMPmpc.moviePlayer setControlStyle:MPMovieControlStyleNone];

where m_pMPmp开发者_Go百科c is an MPMoviePlayerViewController

It worked fine but then I noticed that the movie doesnt rotate anymore while playing(but the app after the movie still rotates) but it detects the orientation at the start and follows that.

I need to set it to follow the landscape orientations while playing. Any idea on what code to add?


Try creating a class child of MPMoviePlayerViewController and overriding the shouldAutorotateToInterfaceOrientation to return yes when orientation is landscape. Instance your class instead the default MPMoviePlayerViewController.

It works for me.

0

精彩评论

暂无评论...
验证码 换一张
取 消