首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >模拟器上的视频流

问模拟器上的视频流
EN

Stack Overflow用户
提问于 2011-08-20 15:34:17
回答 3查看 616关注 0票数 0

我在我的iphone应用程序中播放视频,我想知道视频可以在模拟器上播放,也可以显示为相册中的缩略图。播放视频最好的练习是什么?

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2011-08-20 15:44:21

你好,希万吉,

代码语言:javascript
复制
          You will try this its help you.

           http://developer.apple.com/library/ios/#documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/Reference/Reference.html
票数 0
EN

Stack Overflow用户

发布于 2011-08-20 15:47:04

这是youtube视频流的代码

代码语言:javascript
复制
- (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];  
}  
票数 1
EN

Stack Overflow用户

发布于 2011-08-20 15:48:12

是的,这是可能的。

为此,您必须使用mpmovieplayercontroller。

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

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7130464

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档