[英]iPhone Live Video Stream Media Player
我希望制作一個流媒體直播視頻的應用,該視頻的視圖放在頂部,上面帶有標簽和一個按鈕。
從我對http視頻流功能(自iPhone 3.0 OS開始可用)的研究和測試來看,您似乎創建了一個Web視圖,該Web視圖指向包含轉換后的視頻流的索引html,並在應用程序中顯示為QuickTime視頻。 這意味着我無法控制打開的媒體播放器。 有誰知道你怎么能控制這個?
我知道Apple的MoviePlayer示例代碼向您展示了如何在MediaPlayer視頻的頂部放置視圖,但是如何使用http實時流來完成此操作?
提前致謝。
我現在在電影播放器視頻頂部顯示視圖/標簽/按鈕時遇到了問題。 在Apple的MoviePlayer示例項目中,您可以使用以下代碼在視頻上方添加視圖:
MoviePlayerAppDelegate *appDelegate = (MoviePlayerAppDelegate *)[[UIApplication sharedApplication] delegate];
// initialize a new MPMoviePlayerController object with the specified URL, and play the movie
[appDelegate initAndPlayMovie:[self localMovieURL]];
NSArray *windows = [[UIApplication sharedApplication] windows];
if ([windows count] > 1) {
// Locate the movie player window
UIWindow *moviePlayerWindow = [[UIApplication sharedApplication] keyWindow];
// Add our overlay view to the movie player's subviews so it is displayed above it.
[moviePlayerWindow addSubview:self.overlayView];
}
overlayview是一個包含請求的標簽和按鈕的視圖。 但是,當我對包含.m3u8文件的電影網址應用相同的代碼時,它不會顯示疊加視圖,例如http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8
NSURL *newMovieURL = [NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8">];
if (movieURL) {
NSLog(@"movieURL");
if ([movieURL scheme]) // sanity check on the URL
{ NSLog(@"[movieURL scheme]");
[appDelegate initAndPlayMovie:newMovieURL];
NSArray *windows = [[UIApplication sharedApplication] windows];
NSLog(@"windows count:%d", [windows count]);
if ([windows count] > 1) {
UIWindow *moviePlayerWindow = [[UIApplication sharedApplication] keyWindow];
[moviePlayerWindow addSubview:self.overlayView];
}
}
else NSLog(@"![movieURL scheme]"); } else
NSLog(@"!movieURL");
即使播放電影,返回的窗口數也僅為1,而上一個示例為2。 當我檢查網址以查看是否正常時,movieURL返回null,但仍播放流式內容。 我嘗試刪除大於1的窗口計數檢查,但仍未顯示覆蓋視圖。
有人知道解決這個問題的方法嗎? 謝謝
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.