2011-08-20 78 views
0

我是在我的iPhone應用程序中流式傳輸視頻,我想知道視頻可以在模擬器上播放,也可以顯示爲照片庫中的縮略圖。 ,什麼是良好的執業播放視頻..模擬器上的流視頻

回答

0

你好shivangi,

  You will try this its help you. 

      http://developer.apple.com/library/ios/#documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/Reference/Reference.html 
1

這裏是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]; 
}