[[+content_image]]
A
A
Anton Yeskin2013-10-21 20:01:37
Objective-C
Anton Yeskin, 2013-10-21 20:01:37

MPMoviePlayerController + multicast rtp stream?

This is the code that gives the error

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    NSURL *streamUrl = [NSURL URLWithString:@"rtp://@238.xx.xx.xx:1234"];
    playerController = [[MPMoviePlayerController alloc] initWithContentURL:streamUrl];
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(moviePlayBackDidFinish:)
                                                 name:MPMoviePlayerPlaybackDidFinishNotification
                                               object:nil];
    [playerController setControlStyle:MPMovieControlStyleFullscreen];
    [playerController setMovieSourceType:MPMovieSourceTypeStreaming];

    [playerController setFullscreen:YES];
    [self.view addSubview:playerController.view];
    [playerController.view setFrame: self.view.bounds];
    [playerController prepareToPlay];
    [playerController play];
    
}

- (void) moviePlayBackDidFinish:(NSNotification*)notification {
    NSError *error = [[notification userInfo] objectForKey:@"error"];
    if (error) {
        NSLog(@"Did finish with error: %@", error);
    }
}

2013-10-21 20:54:16.812 StreamPlayer[2201:60b] _itemFailedToPlayToEnd: {
kind = 1;
new=2;
old = 0;
}
2013-10-21 20:54:16.825 StreamPlayer[2201:60b] Did finish with error: Error Domain=MediaPlayerErrorDomain Code=-1 "unknown error" UserInfo=0x16d7a0e0 {NSLocalizedDescription=unknown error}
2013-10-21 20: 54:16.914 StreamPlayer[2201:60b] _itemFailedToPlayToEnd: {
kind = 1;
new=2;
old = 0;
}
Prompt or direct with the correct search query, how to play rtp multicast stream in ios?
Can it be a standard MPMoviePlayerController, or which third-party should I use?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question