0

我希望能做出流器具有置于与标签顶部上有一个按钮观看现场视频的应用程序。iPhone实时视频流媒体播放器

从我对http视频流功能的研究和测试(可用于iPhone 3.0 OS)之后,您似乎创建了一个指向包含转换视频流的索引html的webview,并将其显示为快速视频视频在应用程序中。这意味着我无法控制打开的媒体播放器。有谁知道你可以如何控制这个?

我知道,苹果的MoviePlayer示例代码显示了如何放置在MediaPlayer的视频的俯视图,但是这可怎么用HTTP实时流做了什么?

在此先感谢。

回答

0

林现在只需具有在movieplayer视频之上显示的图/​​标签/按钮的问题。在苹果公司的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文件电影URL它不例如显示叠加视图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的检查,但它仍然didnt显示覆盖图。

有没有人知道解决这个问题的方法?谢谢