开发者

MPMoviePlayerController visible while loading stream

开发者 https://www.devze.com 2023-02-05 23:02 出处:网络
Any one know how to keep the MPMoviePlayerController visible while the movie is loading. Or before the movie is ready to play?

Any one know how to keep the MPMoviePlayerController visible while the movie is loading. Or before the movie is ready to play? For some reason it only shows up when the Movie is ready to play.

Heres what I have.

mp = [[MPMoviePlayerController alloc] initWithContentURL:url];
[self.view addSubview:[mp view]];
mp.view.frame = mediaPlayerContainer.frame;
[mediaPlayerContainer removeFromSuperview];

mp.useApplicationAudioSession = YES;
mp.shouldAutoplay = YES;
mp.contr开发者_运维百科olStyle = MPMovieControlStyleFullscreen;

My mediaPlayerContainer is just a dummy container so I can visually build a frame for my mp view.

The only other thing I can think of doing is using a "screenshot" of a player as a place holder. And removing it if the player is in "play" mode. That seems janky though.

Thnks.


MPMoviePlayerController has a backgroundView property... You can add an UIImageView to it and it should be displayed while it is loading the video.

0

精彩评论

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