shivangi
shivangi

Reputation: 187

stream video on simulator

i am streaming videos in my iphone app and i want to know that the video can be played on the simulator and can also be shown as the thumbnail images as in photo gallery. And what is the good practicing to play videos..

Upvotes: 0

Views: 675

Answers (3)

Sujal
Sujal

Reputation: 1205

Here is the code for youtube video stream

- (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];  
}  

Upvotes: 1

PJR
PJR

Reputation: 13180

Yes it is possible.

for that you have to use mpmovieplayercontroller.

this link should help you.

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

Upvotes: 1

Nikunj Jadav
Nikunj Jadav

Reputation: 3402

Hello shivangi,

          You will try this its help you.

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

Upvotes: 0

Related Questions