I just try to play an apple's HLS sample stream. My code is very simple:
- (IBAction)playHLS:(id)sender {
NSString* str = @"https://devimages.apple.com.edgekey.net/resources/http-streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8";
NSURL *url = [[NSURL alloc] initWithString:str];
MPMoviePlayerViewController *theMovie = [[MPMoviePlayerViewController alloc]
initWithContentURL: url];
[self presentMoviePlayerViewControllerAnimated:theMovie];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieFinishedCallback:)
name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie];
}
The debug reveals that url is not initialized properly due to <invalid CFStringRef>
What did i miss here?
The string has several Unicode zero-width-space characters in it, after each the :
and /
characters.
You can see them if you paste it into this online UTF-8 decoder, for instance. They're Unicode character 0x200B.