Play a movie in another app then return to my app
I wanted to be able to play a divx or mkv file from my app. So I'm using url schema method, calling a player like Buzz Player via
UIApplication *ourApplication = [UIApplication sharedApplication];
NSString ourPath = @"http://buzzplayer:http://www.mylocalserver.com/file.avi";
NSURL *ourURL = [NSURL URLWithString:ourPath];
[ourApplication openURL:ourURL];
And that works great, it opens the file in the video player fine. But when I press Done in that player, it goes to the Buzz Player menu not back to my app.
It makes sense I guess as I did send the URL request to the player and I'm assuming thi开发者_如何转开发s isn't Buzz Player specific but something any app would do.
Is there any way I can get an external player to work as the Apple built in video player works; when I press done it jumps back to my app? Or maybe a better solution to this?
I didn't want to reinvent the wheel and build a video player into my app when there are so many great apps that do this out there.
There is no way to get iOS to bring your app back to the front after the other app is done. In your case it seems you'll need to build a movie player into your app. Which isn't that hard to do. Have a look at the MediaPlayer class in the Foundation framework.
精彩评论