Note that there are some explanatory texts on larger screens.

plurals
  1. POiPhone MPMoviePlayer no video
    text
    copied!<p>This is code supposed to play live video/audio stream, it work's fine, but the single problem is that it doesnt show the video, only the audio comes not the video...</p> <pre><code>#import &lt;MediaPlayer/MediaPlayer.h&gt; @implementation movieplayerViewController -(void)awakeFromNib{ NSURL *mediaURL = [NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"]; MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:mediaURL]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil]; [mp setControlStyle:MPMovieControlStyleFullscreen]; [mp setMovieSourceType:MPMovieSourceTypeStreaming]; [mp setFullscreen:YES]; [self.view addSubview:[mp view]]; [mp prepareToPlay]; [mp play]; } - (void) moviePlayBackDidFinish:(NSNotification*)notification { NSError *error = [[notification userInfo] objectForKey:@"error"]; if (error) { NSLog(@"Did finish with error: %@", error); } } - (void)dealloc { [super dealloc]; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle /* // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; } */ - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } @end </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload