开发者

Using multiple MPMoviePlayerController instances in a UITabBarController based iOS app

开发者 https://www.devze.com 2023-03-30 03:07 出处:网络
In my iPad app, the user can open one MPMoviePlayerController 开发者_如何学Cin each tab (total of 5).

In my iPad app, the user can open one MPMoviePlayerController 开发者_如何学Cin each tab (total of 5).

In each viewcontroller containing a movieplayer instance, I play the movie in viewDidAppear: method, and I pause it in viewWillDisappear: method. I also add/remove the viewcontroller as an observer for notifications so that only the viewcontroller currently visible is receiving the notifications. The movieplayer is setup in the init method, and there is nothing really special about it.

Note: Although you can create multiple MPMoviePlayerController objects and present their views in your interface, only one movie player at a time can play its movie.

Besides the note above, I cannot find anything about this in the docs, but I´m guessing that the movieplayer is shared between viewcontrollers somehow, becasuse when I force one movieplayer in each tab it works sometimes, and sometimes the movieplayer is finished when I return to the previous tab.

Is it a fact that MPMoviePlayerController are meant only handle one video at a time, no matter if the instances are in different classes/tabs?

0

精彩评论

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

关注公众号