简体   繁体   中英

Video only play sound when I moved from OS 3.x to 4

Well.. basically that's what happens, when I play a movie from a game I have, only the sound plays, the video doesn't, showing a black screen, even the touch is disabled.

This is the relevant part of the code:

myMovie = [[MPMoviePlayerViewController alloc] initWithContentURL:[self movieURL]];

myMovie.moviePlayer.scalingMode = MPMovieScalingModeFill; myMovie.moviePlayer.controlStyle = MPMovieControlModeHidden;

[myMovie.moviePlayer play];

Thx.

Edit.: Ok, I got it working now, I needed to add this line of code:

[self presentMoviePlayerViewControllerAnimated:myMovie];

The problem now is, that I dont want to see the mediaplayer controls (pause, stop, etc), I just want to watch the video fullscreen, that's all, any ideas?

For me, it was adding these two lines from the MPMoviePlayerController documentation that are not in the MoviePlayer sample code app. So I was getting just audio when playing a stream in the sample app in both 4.1 and 4.2.

[[theMovie view] setFrame: [self.view bounds]];  // frame must match parent view
[self.view addSubview: [theMovie view]];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM