Commit d828f3c7 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Add support to let 3rd parties open network streams in our app (refs #8575)

This includes protocol support for ftp, sftp, rtp, udp, rtmp, mms / mmsh and smb
parent 52a63f74
......@@ -35,6 +35,90 @@
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleURLName</key>
<string>RTSP</string>
<key>CFBundleURLSchemes</key>
<array>
<string>rtsp</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleURLName</key>
<string>Multimedia Stream URL</string>
<key>CFBundleURLSchemes</key>
<array>
<string>mms</string>
<string>mmsh</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleURLName</key>
<string>UDP URL</string>
<key>CFBundleURLSchemes</key>
<array>
<string>udp</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleURLName</key>
<string>RTP URL</string>
<key>CFBundleURLSchemes</key>
<array>
<string>rtp</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleURLName</key>
<string>RTMP</string>
<key>CFBundleURLSchemes</key>
<array>
<string>rtmp</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleURLName</key>
<string>SFTP</string>
<key>CFBundleURLSchemes</key>
<array>
<string>sftp</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleURLName</key>
<string>FTP</string>
<key>CFBundleURLSchemes</key>
<array>
<string>ftp</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleURLName</key>
<string>SMB</string>
<key>CFBundleURLSchemes</key>
<array>
<string>smb</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
......
......@@ -14,7 +14,6 @@
@implementation VLCAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
......@@ -26,9 +25,20 @@
self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
[self.window makeKeyAndVisible];
return YES;
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
if (_playlistViewController && url != nil) {
APLog(@"%@ requested %@ to be opened", sourceApplication, url);
[_playlistViewController openMovieFromURL:url];
return YES;
}
return NO;
}
- (void)applicationWillResignActive:(UIApplication *)application
{
[[MLMediaLibrary sharedMediaLibrary] applicationWillExit];
......
......@@ -28,5 +28,6 @@
@property (nonatomic, strong) IBOutlet UITabBarItem *networkStreamsBarItem;
- (void)updateViewContents;
- (void)openMovieFromURL:(NSURL *)url;
@end
......@@ -200,13 +200,17 @@
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 1) {
if (!self.movieViewController)
self.movieViewController = [[VLCMovieViewController alloc] initWithNibName:@"VLCMovieViewController" bundle:nil];
if (buttonIndex == 1)
[self openMovieFromURL:_pasteURL];
}
self.movieViewController.url = _pasteURL;
[self.navigationController pushViewController:self.movieViewController animated:YES];
}
- (void)openMovieFromURL:(NSURL *)url
{
if (!self.movieViewController)
self.movieViewController = [[VLCMovieViewController alloc] initWithNibName:@"VLCMovieViewController" bundle:nil];
self.movieViewController.url = url;
[self.navigationController pushViewController:self.movieViewController animated:YES];
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment