Streaming video from VLC to Iphone

Discussion in 'iOS Programming' started by man2manno, Feb 14, 2011.

  1. man2manno macrumors member

    Joined:
    Mar 21, 2009
    #1
    Hey guys, so I have been reading around and I believe I have found that it is possible to stream live video from VLC on a computer to your iphone app. My question is how to do that? Is it more complicated than I think? Right now I have the following code:

    Code:
    	NSURL *url = [NSURL URLWithString:@"<ip address of computer>"];
    	
    	MPMoviePlayerViewController *playerController = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
    	[self presentMoviePlayerViewControllerAnimated:playerController];
    	
    	playerController.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
    	
    	[playerController.moviePlayer play];
    	
    	[playerController release];playerController = nil;
    
    Is there more to it or is it that simple? Also does the stream have to be HTTP or can it be like UDP or something else? Any good tutorials or anything?

    Thanks a lot.
     
  2. Bathplug macrumors 6502a

    Joined:
    Jul 12, 2010
    #2
    Theres an app called VLC Streamer. There is a free version to try.
     
  3. man2manno thread starter macrumors member

    Joined:
    Mar 21, 2009
    #3
    Thanks, that is what I am looking to do, but I want to code that for part of my app. Any ideas?

    So I have the following code:

    Code:
    	NSURL *url = [NSURL URLWithString:@"http://xxx.xxx.xx.xx:8080"];
    	[url scheme];
    
    	MPMoviePlayerViewController *playerController = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
    
    	[self presentMoviePlayerViewControllerAnimated:playerController];
    	playerController.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
    
    	[playerController.moviePlayer play];
    	[playerController release];playerController = nil;
    
    And I am trying to load a live video stream (from VLC) and the movieplayer opens but only for a quick second the dismisses. Any Idea why? Any thoughts would be much appericated.
     

Share This Page