我從Scott Hanselman的文章開始介紹如何使用IIS 7 Smooth Streaming和變換管理器將視頻流式傳輸到iPhone。神奇的文章和一切工作100%的廣告。從IIS7到iOS設備流媒體點播視頻
http://www.hanselman.com/blog/CommentView.aspx?guid=86968CD5-FEEB-47F2-B02E-1EB4FA556379
我能夠使用在iPad上的瀏覽器,進入我的公司的網站,看到在瀏覽器中播放視頻,嵌入到使用下面的HTML的HTML頁面。
<html>
<head>
<title>iPhone page</title>
</head>
<body>
<h1>Encoded stream</h1>
<video width="640"
height="480"
src="http://name-of-video-here.ism/manifest(format=m3u8-aapl).m3u8"
autoplay="true"
controls="true" >Live</video>
</body>
</html>
我遇到的問題是,當我嘗試採取完全相同的URL的 「http://name-of-video-here.ism/manifest(格式= M3U8-AAPL).m3u8」,並嘗試在同一臺iPad上運行的自定義應用程序中使用「CustomMPMovie」或「MPMoviePlayerController」進行播放時,它不起作用。
的Objective-C是播放視頻
NSURL *theURL = [NSURL URLWithString:[item url]];
if ([[[UIDevice currentDevice] systemVersion] doubleValue] >= 3.2)
{
NSLog(@"> 3.2");
CustomMPMovie *mp = [[CustomMPMovie alloc] initWithContentURL:theURL];
if (mp)
{
mp.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
[self.navigationController presentMoviePlayerViewControllerAnimated:mp];
[mp shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeRight];
[mp.moviePlayer play];
[mp release];
}
}
else if ([[[UIDevice currentDevice] systemVersion] doubleValue] < 3.2)
{
NSLog(@"< 3.2");
MPMoviePlayerController* theMovie = [[MPMoviePlayerController alloc] initWithContentURL: theURL];
theMovie.scalingMode = MPMovieScalingModeAspectFill;
// Register for the playback finished notification
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(myMovieFinishedCallback:)
name: MPMoviePlayerPlaybackDidFinishNotification
object: theMovie];
// Movie playback is asynchronous, so this method returns immediately.
[theMovie play];
}
任何人都可以提供一個解釋或可能的解決方案?
什麼是CustomMPMovie?你爲什麼需要它> 3.2? – 2010-11-12 14:57:18
CustomMPMovie似乎是電影播放器的自定義實現,因此它可以與4.0平臺一起使用。我可以說,這部電影無法在具有beta OS和具有生產操作系統的iPad的iPad上播放。 – 2010-11-12 20:00:34