I am developing a Apple TV 4 app for streaming from Enigma 2 receivers. Life TV streaming to Apple TV works fine. But I run in problems with recorded movies on the receiver. Here my code:
Code: Select all
VLCMediaPlayer *mediaplayer;
mediaplayer = [[VLCMediaPlayer alloc] init];
mediaplayer.delegate = self;
mediaplayer.drawable = movieView;
NSString *path = @"http://bm750.local/hdd/movie/20151023 2030 - ZDF HD - Der Alte.ts";
NSString *encodedPath = [path stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet];
NSURL *url = [NSURL URLWithString:encodedPath];
mediaplayer.media = [VLCMedia mediaWithURL:url];
[mediaplayer play];
NSLog(@"URL: %@", url);
// Output: URL: http://bm750.local/hdd/movie/20151023%202030%20-%20ZDF%20HD%20-%20Der%20Alte.ts
It seems the encoding/encapsulation is the problem. If I try to access a movie w/o spaces in the path it works fine.
It works also fine when I open the encoded URL in VLC on OS X.
I tried different character sets w/o success:
- URLFragmentAllowedCharacterSet
- URLHostAllowedCharacterSet
- URLPasswordAllowedCharacterSet
- URLPathAllowedCharacterSet
- URLQueryAllowedCharacterSet
- URLUserAllowedCharacterSet
Thanks, Matthias