소스 검색

UPNP File List: implement basic streaming via http, rtsp, rtp, mmsh, mms

next-up: http downloading
Felix Paul Kühne 12 년 전
부모
커밋
2e21be0198
1개의 변경된 파일17개의 추가작업 그리고 3개의 파일을 삭제
  1. 17 3
      AspenProject/VLCLocalServerFolderListViewController.m

+ 17 - 3
AspenProject/VLCLocalServerFolderListViewController.m

@@ -14,6 +14,9 @@
 #import "MediaServer1ContainerObject.h"
 #import "MediaServer1Device.h"
 #import "VLCLocalNetworkListCell.h"
+#import "VLCAppDelegate.h"
+#import "VLCPlaylistViewController.h"
+#import "UINavigationController+Theme.h"
 
 @interface VLCLocalServerFolderListViewController () <UITableViewDataSource, UITableViewDelegate>
 {
@@ -139,12 +142,23 @@
 
         MediaServer1ItemRes *resource = nil;
         NSEnumerator *e = [[item resources] objectEnumerator];
+        NSURL *itemURL;
         while((resource = (MediaServer1ItemRes*)[e nextObject])){
-            NSLog(@"%@ - %d, %@, %d, %d, %d, %@", [item title], [resource bitrate], [resource duration], [resource nrAudioChannels], [resource size],  [resource durationInSeconds],  [resource protocolInfo] );
-            NSLog(@"URI is %@", [item uri]);
+            APLog(@"%@ - %d, %@, %d, %d, %d, %@ (%@)", [item title], [resource bitrate], [resource duration], [resource nrAudioChannels], [resource size],  [resource durationInSeconds],  [resource protocolInfo], [item uri]);
+            itemURL = [NSURL URLWithString:[item uri]];
         }
 
-        //TODO DO SOMETHING USEFUL!
+        if (itemURL && ([itemURL.scheme isEqualToString:@"http"] || [itemURL.scheme isEqualToString:@"rtsp"] || [itemURL.scheme isEqualToString:@"rtp"] || [itemURL.scheme isEqualToString:@"mms"] || [itemURL.scheme isEqualToString:@"mmsh"])) {
+            VLCAppDelegate* appDelegate = [UIApplication sharedApplication].delegate;
+
+            UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:appDelegate.playlistViewController];
+            [navController loadTheme];
+
+            appDelegate.revealController.contentViewController = navController;
+            [appDelegate.revealController toggleSidebar:NO duration:kGHRevealSidebarDefaultAnimationDuration];
+
+            [appDelegate.playlistViewController performSelector:@selector(openMovieFromURL:) withObject:itemURL afterDelay:kGHRevealSidebarDefaultAnimationDuration];
+        }
     }
 }