- 
                Notifications
    
You must be signed in to change notification settings  - Fork 145
 
messagechannel
        mayudong edited this page Jan 29, 2018 
        ·
        2 revisions
      
    播放SDK提供了如下的messageDataBlock属性,使用回调的方式将视频流中除了音视频之外的另一种可以称之为消息的数据交给外部处理
typedef void (^KSYPlyMessageDataBlock)(NSDictionary *message, int64_t pts, int64_t param);
@property (nonatomic, copy)KSYPlyMessageDataBlock messageDataBlock;
使用示例如下
    _player.messageDataBlock = ^(NSDictionary *message, int64_t pts, int64_t param){
    if(message)
    {
        NSMutableString *msgString = [[NSMutableString alloc] init];
        NSEnumerator * enumeratorKey = [message keyEnumerator];
        //快速枚举遍历所有KEY的值
        for (NSObject *object in enumeratorKey) {
            [msgString appendFormat:@"\"%@\":\"%@\"\n", object, [message objectForKey:object]];
        }
        
        if(weakSelf)
            [weakSelf updateMsg:msgString];
    }
- 推流SDK向流中写入的自定义消息,此消息数据在rtmp流中已符合标准的形式作为区别与音视频数据的另外一种数据格式存在
 - 3.0.1版本中新增了对H264视频数据中SEI信息的解析,将用户自定义的SEI数据通过消息通道的方式交给外部处理
 

