ksvc / KSYMediaPlayer_iOS

金山云iOS播放SDK(KSYUN Live Streaming player SDK),支持RTMP HTTP-FLV HLS 协议(supporting RTMP HTTP-FLV HLS protocol),直播延时2-3秒(Living delay 2 or 3 seconds)
http://v.ksyun.com/
Apache License 2.0
563 stars 144 forks source link

getMetadata获取不到信息 #51

Open fdddf opened 6 years ago

fdddf commented 6 years ago

用demo中的地址或者其它音频流试了获取不到meta信息

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    self.player = [[KSYMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:@"https://ks3-cn-beijing.ksyun.com/ksvsdemo/xulei_0815/Aerial%20China%201-copy.mp4"]];
    self.player.bufferTimeMax = 0;
    self.player.shouldHideVideo = true;
    self.player.shouldEnableKSYStatModule = false;
    self.player.shouldAutoplay = true;
    [self.player prepareToPlay];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)getMetadata:(id)sender {
    NSDictionary *meta = [self.player getMetadata:MPMovieMetaType_Audio];
    NSLog(@"getMetadata %@", meta);
}

排查了下是shouldEnableKSYStatModule参数设置false时不会读meta, 注释只写着数据统计,可否在wiki中对这个参数含义解释下。

shixuemei commented 6 years ago

谢谢您的建议,确实是我们忽略了这块,相关的wiki已经补齐: https://github.com/ksvc/KSYMediaPlayer_iOS/wiki/playerConfiguration https://github.com/ksvc/KSYMediaPlayer_iOS/wiki/getMetaInfo

fpzeng commented 6 years ago

不要设置

 self.player.shouldEnableKSYStatModule = false;

或者更改为true