Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS Play video black screen?
    primarykey
    data
    text
    <p>I have been browsing through Google for various explanations but I STILL couldn't figure out when this code fires the screen is pitch black. Anyone able to spot a mistake?</p> <p><strong>UPDATE</strong> </p> <pre><code>- (IBAction)playVideo:(id)sender { NSURL *videoUrl = [[DataStore singletonInstance] getVideoUrl:self withUuid:self.eventDetailVC.event.uuid]; if ([videoUrl checkResourceIsReachableAndReturnError:nil] == NO) { NSLog(@"Video doesn't not exist."); return; } MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:videoUrl]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:player]; [previewView addSubview:player.view]; player.view.frame = previewView.bounds; player.controlStyle = MPMovieControlStyleDefault; [player play]; } - (void)moviePlayBackDidFinish:(NSNotification*)notification { NSLog(@"moviePlayBackDidFinish: called"); MPMoviePlayerController *player = [notification object]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:player]; // Checking for errors NSDictionary *notiUserInfo = [notification userInfo]; if (notiUserInfo != nil) { NSError *errorInfo = [notiUserInfo objectForKey:@"error"]; if ([[errorInfo domain] isEqualToString:@"MediaPlayerErrorDomain"]) { UIAlertView *notice = [[UIAlertView alloc] initWithTitle:@"Error" message:[errorInfo localizedDescription] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [notice show]; return; } } // Remove from view [player.view removeFromSuperview]; [player stop]; } </code></pre> <p>FYI moviePlayBackDidFinish is NOT called at all. I don't know why. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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