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. Th开发者_如何学Pythone 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
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/
Edit: Looks like I spoke prematurely. The AppleTV update was released today. A revised answer is below:
If your AppleTV has been updated to the latest software, and you can stream videos from the iPod app on your iPad, then video streaming over AirPlay should work. However, from what I heard recently, video streaming will only work from the iPod and YouTube apps. I have not yet had a chance to test out the AppleTV update myself, so I cannot verify any of this, but if true it means that you are only allowed to stream audio from MPMoviePlayerController in your app. Hopefully this restriction will be relaxed in the future.
I've created an application here which will stream videos to an AppleTV that have been shot on your iPhone. http://tinyurl.com/2vewstr
You will need the SDK to compile and use it.
精彩评论