Search code examples
iphonempmovieplayercontrollermpmovieplayer

MPMoviePlayerController streaming video to Apple TV


Since the new update came out for apple tv where you can stream video to it from any iOS device running 4.2, I was trying to stream a video from my phone which uses MPMoviePlayerController to play the video to Apple TV. The player shows the airplay option and I can find Apple TV but when I tap on that nothing happens. So, was just wondering if is it really possible to stream a video using MPMoviePlayerController to apple tv or not or is there any other player framework which I am missing do that. I would really appreciate if someone can provide me with some help on this.

Regards,

Ankur


Solution

  • self.movieController = [[[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:CINDY_PATH]] autorelease];
    [movieController setAllowsWirelessPlayback:YES];
    movieController.view.frame = self.view.bounds;
    [self.view addSubview:movieController.view];
    

    The line "[movieController setAllowsWirelessPlayback:YES];" will allow Airplay video, however, it is a private API which is not AppStore safe...

    Reference: http://www.tuaw.com/2010/11/24/apple-tv-hacking-spelunking-into-the-airplay-video-service/