Commit 0c61ca34 authored by Felix Paul Kühne's avatar Felix Paul Kühne

websocket: implement openURL

parent 9566ea2d
......@@ -81,6 +81,8 @@
[self _respondToEnded];
} else if ([type isEqualToString:@"seekTo"]) {
[self _respondToSeek:receivedDict];
} else if ([type isEqualToString:@"openURL"]) {
[self _respondToOpenURL:receivedDict];
} else if ([type isEqualToString:@"volume"]) {
[self sendMessage:@"VOLUME CONTROL NOT SUPPORTED ON THIS DEVICE"];
} else
......@@ -313,4 +315,29 @@
}
}
#pragma mark - openURL
- (void)_respondToOpenURL:(NSDictionary *)dictionary
{
/*
 {
"type": "OpenURL",
"url": "https://vimeo.com/74370512"
}
*/
BOOL needsMediaList;
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCMediaList *mediaList = vpc.mediaList;
if (!mediaList) {
needsMediaList = YES;
mediaList = [[VLCMediaList alloc] init];
}
[mediaList addMedia:[VLCMedia mediaWithURL:[NSURL URLWithString:dictionary[@"url"]]]];
if (needsMediaList) {
[vpc playMediaList:mediaList firstIndex:0];
}
}
@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