1

私はURL(http://ms1.clickhere2.com:1935/live/power98/playlist.m3u8)を持っていて、iPhoneでm3u8形式で再生したいのですが、誰かがこれを手伝ってくれるでしょうか。MPMEDIAPLAYERフレームワークなどを使用しました。 。

4

1 に答える 1

4

このようにしてみてください:

NSString *path =[[NSString alloc] initWithString:@"http://stream.alayam.com/alayam/alayam/playlist.m3u8"];



NSURL *audioUrl=[NSURL URLWithString:path];

MPMoviePlayerController *player =  [[MPMoviePlayerController alloc] initWithContentURL:audioUrl];
[[NSNotificationCenter defaultCenter] addObserver:self 
                                         selector:@selector(loadStateDidChange:)                                                 name:MPMoviePlayerLoadStateDidChangeNotification 
                                           object:player];
if ([player respondsToSelector:@selector(loadState)]) 
{
    [player setControlStyle:MPMovieControlModeVolumeOnly];
    [player setFullscreen:YES];
    [player prepareToPlay];
}   
于 2012-03-29T10:08:31.697 に答える