Live Video Stream iphone

I am new to iphone and Objective-c. I want to show a match live, let's say a soccer match, with users who are using my application. What do I need to stream video on the iphone app?

any information about it is appreciated!

thank

Guys please help, anyone should have done this before?

+2


source to share


3 answers


You need to provide the URL of the movie file and the streams will be automatically configured according to your connection speed.

Keep in mind that only videos with a resolution within the iPhone's range will play. Higher resolution movies will play on the simulator, but will not work on the iPhone.



You should have an object MPMoviePlayerController

and the rest of the code looks like this:

-(void) play {

NSURL *movieURL = [NSURL URLWithString:@"http://movies.apple.com/media/us/mac/getamac/2009/apple-mvp-biohazard_suit-us-20090419_480x272.mov"];


if (movieURL != nil) {
    moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];

    moviePlayer.initialPlaybackTime = -1.0;

    // Register to receive a notification when the movie has finished playing. 
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(moviePlayBackDidFinish:) 
                                                 name:MPMoviePlayerScalingModeDidChangeNotification 
                                               object:moviePlayer];

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(endPlay:) 
                                                 name:MPMoviePlayerPlaybackDidFinishNotification 
                                               object:moviePlayer];

    moviePlayer.scalingMode = MPMovieScalingModeAspectFit; 
    moviePlayer.movieControlMode = MPMovieControlModeDefault;
    moviePlayer.backgroundColor = [UIColor blackColor];

    [moviePlayer play];
 }
}

-(void)moviePlayBackDidFinish: (NSNotification*)notification
{
self.navigationItem.hidesBackButton = FALSE;
moviePlayer = [notification object];
[moviePlayer play];
}

-(void)endPlay: (NSNotification*)notification
{
NSLog(@"end Playing");

self.navigationItem.hidesBackButton = FALSE;
//[[UIApplication sharedApplication] endIgnoringInteractionEvents];
[actview stopAnimating];

[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerScalingModeDidChangeNotification object:moviePlayer];
[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer];

[moviePlayer stop];
[moviePlayer release];
}

      

+3


source


Assuming you have the video rights for the corresponding football match, you need an encoder that will encode the live video on the go in the correct format (mp4, h263, etc.). The way to play iPhone is to have a dynamic playlist that will preview snippets of live video to play it.



+1


source


+1


source







All Articles