您可以在iOS中使用AVPlayer知道编码器的当前.ts文件或当前时间戳吗? [英] Using AVPlayer in iOS can you know the current .ts file or the current timestamp from the encoder?

查看:204
本文介绍了您可以在iOS中使用AVPlayer知道编码器的当前.ts文件或当前时间戳吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我们无法从AVPlayer中获取隐藏字幕数据或字幕数据,因此我们正在研究其他触发方法,例如时间码或至少了解当前处于活动状态的.ts文件.我在文档中找不到任何内容,并且播放器的CMTime并没有提供嵌入在m3u8文件中的时间代码.

Since we are unable to get Closed caption data or subtitle data out of the AVPlayer, we are looking at other trigger methods, such as timecode or at least the knowledge of the .ts file that is currently active. I couldn't find anything in the documentation and the CMTime from the player doesn't give me the timecode that is embedded in the m3u8 files.

NSLog(@"%f", CMTimeGetSeconds([mPlayer currentTime] ) );

不是我想要的.

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:562
#EXT-X-PROGRAM-DATE-TIME:2020-10-23T14:18:59+08:00
#EXTINF:10,
http://aedsgios1-i.akamaihd.net/hls/live/204775/test1-p/mobile600/Seg_102320_124459_1/mobile600_102320_124459_562.ts
#EXT-X-PROGRAM-DATE-TIME:2020-10-23T14:19:09+08:00
#EXTINF:10,

我想知道EXT-X-PROGRAM-DATE-TIME,或者至少是活动的.ts文件的名称.

The EXT-X-PROGRAM-DATE-TIME is what I'm looking to know, or at least the name of the .ts file that is active.

谢谢!

推荐答案

NSLog(@%@",[[mPlayer currentItem] currentDate]);

NSLog(@"%@", [[mPlayer currentItem] currentDate ]);

这篇关于您可以在iOS中使用AVPlayer知道编码器的当前.ts文件或当前时间戳吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆