【问题标题】:stream video on simulator在模拟器上流式传输视频
【发布时间】:2011-11-08 18:36:30
【问题描述】:

我正在我的 iphone 应用程序中流式传输视频,我想知道视频可以在模拟器上播放,也可以显示为照片库中的缩略图。 还有什么是播放视频的好习惯..

【问题讨论】:

    标签: iphone objective-c ios video


    【解决方案1】:

    是的,这是可能的。

    为此,您必须使用 mpmovieplayercontroller。

    此链接应该对您有所帮助。

    http://iphoneincubator.com/blog/audio-video/play-video-with-mpmovieplayercontroller-in-ios-3-0-and-3-24-0

    【讨论】:

      【解决方案2】:

      这是 youtube 视频流的代码

      - (void)embedYouTube:(NSString*)url frame:(CGRect)frame {  
       NSString* embedHTML = @"\ 
          <html><head>\ 
       <style type=\"text/css\">\ 
       body {\ 
       background-color: transparent;\ 
       color: white;\ 
       }\ 
       </style>\ 
       </head><body style=\"margin:0\">\ 
          <embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \ 
       width=\"%0.0f\" height=\"%0.0f\"></embed>\ 
          </body></html>";  
       NSString* html = [NSString stringWithFormat:embedHTML, url, frame.size.width, frame.size.height];  
       if(videoView == nil) {  
         videoView = [[UIWebView alloc] initWithFrame:frame];  
         [self.view addSubview:videoView];  
       }  
       [videoView loadHTMLString:html baseURL:nil];  
      }  
      

      【讨论】:

        【解决方案3】:

        你好 shivangi,

                  You will try this its help you.
        
                   http://developer.apple.com/library/ios/#documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/Reference/Reference.html
        

        【讨论】:

          猜你喜欢
          • 2012-06-20
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2012-06-23
          • 2014-04-12
          • 2018-03-13
          相关资源
          最近更新 更多