我只是嘗試播放蘋果的HLS樣本流。我的代碼是非常簡單的:在這段代碼中,什麼原因導致「CFStringRef無效」?
- (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];
}
調試表明網址不正確初始化由於<invalid CFStringRef>
什麼我錯過這裏?
@KurtRevis,我想你應該加上這個答案。這個問題的原因是因爲那些零寬度字符。 – iDev