私のMacにダーウィンストリーミングサーバーを設定しました。 が、今私は私のiphoneをリアルタイムにダーリンストリーミングサーバーを使用したライブストリーミング
をこれらのビデオをストリーミングする必要がありますが、問題MPMoviePlayerPlaybackDidFinishNotificationは動画が
を果たしていても前に呼び出されている私は、サーバーのセットアップをチェックしていると私は正常に開かれているにも を実行していますurlはsafariとquicktimeにあります。 ちょうど文句を言わない、シミュレータ 私が書いたコードで再生する動画は、私がこれをバックアップするために、任意のドキュメントを見つけることができません
NSURL *movieURL=[NSURL fileURLWithPath:@"rtsp://10.41.37.160/sample_300kbit.mov"];
// NSURL *movieURL = [NSURL URLWithString:@"rtsp://10.41.37.160/sample_300kbit.mp4"];
if (movieURL != nil)
{
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
[moviePlayer.view setFrame: CGRectMake(0, 0, 320, 400)];
[moviePlayer setControlStyle:MPMovieControlStyleFullscreen];
[moviePlayer setMovieSourceType:MPMovieSourceTypeStreaming];
[self.view addSubview:moviePlayer.view];
moviePlayer.fullscreen=YES;
// moviePlayer.initialPlaybackTime = -1.0;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerScalingModeDidChangeNotification object:moviePlayer];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(endPlay:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer];
moviePlayer.scalingMode = MPMovieScalingModeAspectFit;
moviePlayer.shouldAutoplay=YES;
[moviePlayer play];
//[self reloadInputViews];
}
-(void)moviePlayBackDidFinish: (NSNotification*)notification
{
self.navigationItem.hidesBackButton = FALSE;
moviePlayer = [notification object];
[moviePlayer play];
}
-(void)endPlay: (NSNotification*)notification
{
NSLog(@"end Playing");
[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerScalingModeDidChangeNotification object:moviePlayer];
[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer];
[moviePlayer stop];
[moviePlayer release];
}
です。それはアンドロイド でサポートされているので、iOSでサポートされるかもしれないと推測していた – Nitesh