Commit 45557f60 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

atv/open network stream: implement playback

parent 8cc7ea0d
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
*****************************************************************************/ *****************************************************************************/
#import "VLCOpenNetworkStreamTVViewController.h" #import "VLCOpenNetworkStreamTVViewController.h"
#import "VLCPlaybackController.h"
@interface VLCOpenNetworkStreamTVViewController () @interface VLCOpenNetworkStreamTVViewController ()
{ {
...@@ -39,6 +40,9 @@ ...@@ -39,6 +40,9 @@
/* fetch data from cloud */ /* fetch data from cloud */
_recentURLs = [NSMutableArray arrayWithArray:[[NSUbiquitousKeyValueStore defaultStore] arrayForKey:kVLCRecentURLs]]; _recentURLs = [NSMutableArray arrayWithArray:[[NSUbiquitousKeyValueStore defaultStore] arrayForKey:kVLCRecentURLs]];
if (_recentURLs.count == 0) {
[_recentURLs addObject:@"http://streams.videolan.org/streams/mp4/Mr_MrsSmith-h264_aac.mp4"];
}
[self.previouslyPlayedStreamsTableView reloadData]; [self.previouslyPlayedStreamsTableView reloadData];
self.noURLsToShowLabel.hidden = _recentURLs.count != 0; self.noURLsToShowLabel.hidden = _recentURLs.count != 0;
} }
...@@ -75,7 +79,8 @@ ...@@ -75,7 +79,8 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
NSLog(@"user tried to play something"); [self.previouslyPlayedStreamsTableView deselectRowAtIndexPath:indexPath animated:NO];
[self _openURLStringAndDismiss:_recentURLs[indexPath.row]];
} }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
...@@ -90,7 +95,13 @@ ...@@ -90,7 +95,13 @@
- (void)URLEnteredInField:(id)sender - (void)URLEnteredInField:(id)sender
{ {
NSLog(@"user entered URL '%@'", self.playURLField.text); [self _openURLStringAndDismiss:self.playURLField.text];
}
- (void)_openURLStringAndDismiss:(NSString *)url
{
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
[vpc playURL:[NSURL URLWithString:url] subtitlesFilePath:nil];
} }
@end @end
Supports Markdown
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