IMSLinkVisualPlayerViewController Class Reference
| Inherits from | UIViewController | 
|---|---|
| Declared in | IMSLinkVisualPlayerViewController.h | 
Overview
LinkVisual RTMP播放器
支持的主要功能:
- 对传入的rtmp url进行播放
- 实时获取当前播放帧率、码率
LinkVisual RTMP播放器 工具分类
支持的主要功能:
- 视频截图
- 视频录像保存至本地
LinkVisual RTMP播放器 Seek分类 仅录播支持
支持的主要功能:
- 获取片源总时长和当前播放时间
- 暂停播放
- seek到对应时间
LinkVisual RTMP播放器 业务分类
支持的主要功能:
- 传入iotid及码流类型,自动请求直播地址进行播放
- 传入iotid及filename,自动请求录播地址进行播放
- 获取当前流连接类型
Other Methods
  contentMode
	播放器缩放模式
@property (assign, nonatomic) IMSLinkVisualPlayerContentMode contentModeDiscussion
播放器缩放模式
See Also
Declared In
IMSLinkVisualPlayerViewController.h
  frameRate
	帧率 支持kvo监听
@property (assign, readonly, nonatomic) NSInteger frameRateDiscussion
帧率 支持kvo监听
Declared In
IMSLinkVisualPlayerViewController.h
  bitRate
	码率 支持kvo监听
@property (assign, readonly, nonatomic) NSInteger bitRateDiscussion
码率 支持kvo监听
Declared In
IMSLinkVisualPlayerViewController.h
  playerState
	播放器当前状态
@property (assign, readonly, nonatomic) IMSLinkVisualPlayerState playerStateDiscussion
播放器当前状态
可以监听IMSLinkVisualPlayerStateChangeNotification通知获取播放器状态变化情况
See Also
Declared In
IMSLinkVisualPlayerViewController.h
– setDataSource:sourceType:
	设置RTMP数据源、默认不加密
- (BOOL)setDataSource:(NSString *)rtmpUrl sourceType:(IMSLinkVisualPlayerSourceType)sourceTypeParameters
| rtmpUrl | RTMP格式的url | 
|---|---|
| sourceType | 播放器类型 | 
Return Value
数据源是否设置成功
Discussion
设置RTMP数据源、默认不加密
See Also
Declared In
IMSLinkVisualPlayerViewController.h
– setDataSource:sourceType:encryptIv:encryptKey:
	设置RTMP数据源、默认加密
- (BOOL)setDataSource:(NSString *)rtmpUrl sourceType:(IMSLinkVisualPlayerSourceType)sourceType encryptIv:(NSString *)encryptIv encryptKey:(NSString *)encryptKeyParameters
| rtmpUrl | RTMP格式的url | 
|---|---|
| sourceType | 播放器类型 | 
| encryptIv | 用于加密的iv | 
| encryptKey | 用于加密的key | 
Return Value
数据源是否设置成功
Discussion
设置RTMP数据源、默认加密
See Also
Declared In
IMSLinkVisualPlayerViewController.h
– reset
	播放器将停止,并重置dataSource
- (void)resetDiscussion
播放器将停止,并重置dataSource
Declared In
IMSLinkVisualPlayerViewController.h
Util Methods
– videoSnapshot
	视频截图
- (UIImage *__nullable)videoSnapshotReturn Value
截图返回的UIImage对象
Discussion
视频截图
Declared In
IMSLinkVisualPlayerViewController+Util.h
– startRecordVideoWithfilePath:
	开始录像
- (BOOL)startRecordVideoWithfilePath:(NSString *)filePathParameters
| filePath | 文件存储路径(文件后缀名应为mp4) | 
|---|
Return Value
是否成功开始录像
Discussion
开始录像
Declared In
IMSLinkVisualPlayerViewController+Util.h
– stopRecordVideo
	结束录像(生成mp4格式的文件)
- (BOOL)stopRecordVideoReturn Value
是否成功存储文件
Discussion
结束录像(生成mp4格式的文件)
Declared In
IMSLinkVisualPlayerViewController+Util.h
Seekable Methods
  duration
	片源时长 单位为秒 支持kvo监听
@property (assign, readonly, nonatomic) NSInteger durationDiscussion
片源时长 单位为秒 支持kvo监听
Declared In
IMSLinkVisualPlayerViewController+Seekable.h
  currentDuration
	当前播放时间 单位为秒 支持kvo监听
@property (assign, readonly, nonatomic) NSInteger currentDurationDiscussion
当前播放时间 单位为秒 支持kvo监听
Declared In
IMSLinkVisualPlayerViewController+Seekable.h
– restore
	恢复播放
- (void)restoreDiscussion
恢复播放
Declared In
IMSLinkVisualPlayerViewController+Seekable.h
– seekToDuration:
	seek到对应时间 单位为秒
- (BOOL)seekToDuration:(NSInteger)durationParameters
| duration | 需要seek到的时间 | 
|---|
Return Value
是否进入seeking状态 如果返回值为YES、可以通过通知IMSLinkVisualPlayerSeekCompleteNotification来监听seek完成的回调 (在某些情况下,例如网络连接中断,有可能出现返回值为NO的情况)
Discussion
seek到对应时间 单位为秒
Declared In
IMSLinkVisualPlayerViewController+Seekable.h
Business Methods
– setDataSource:streamType:
	设置直播业务数据源、默认不加密
- (BOOL)setDataSource:(NSString *)iotId streamType:(IMSLinkVisualPlayerLiveStreamType)streamTypeParameters
| iotId | 设备iotId | 
|---|---|
| streamType | 直播码流 | 
Return Value
是否成功设置数据源
Discussion
设置直播业务数据源、默认不加密
See Also
Declared In
IMSLinkVisualPlayerViewController+Business.h
– setDataSource:streamType:encryptType:
	设置直播业务数据源、默认加密
- (BOOL)setDataSource:(NSString *)iotId streamType:(IMSLinkVisualPlayerLiveStreamType)streamType encryptType:(NSInteger)encryptTypeParameters
| iotId | 设备iotId | 
|---|---|
| streamType | 直播码流 | 
| encryptType | 加密类型(预留接口,目前默认填0,为AES-128加密方式) | 
Return Value
是否成功设置数据源
Discussion
设置直播业务数据源、默认加密
See Also
Declared In
IMSLinkVisualPlayerViewController+Business.h
– setDataSource:vodFileName:
	设置录播业务数据源、默认不加密
- (BOOL)setDataSource:(NSString *)iotId vodFileName:(NSString *)vodFileNameParameters
| iotId | 设备iotId | 
|---|---|
| vodFileName | 录播文件名 | 
Return Value
是否成功设置数据源
Discussion
设置录播业务数据源、默认不加密
Declared In
IMSLinkVisualPlayerViewController+Business.h
– setDataSource:vodFileName:encryptType:
	设置录播业务数据源、默认加密
- (BOOL)setDataSource:(NSString *)iotId vodFileName:(NSString *)vodFileName encryptType:(NSInteger)encryptTypeParameters
| iotId | 设备iotId | 
|---|---|
| vodFileName | 录播文件名 | 
| encryptType | 加密类型(预留接口,目前默认填0,为AES-128加密方式) | 
Return Value
是否成功设置数据源
Discussion
设置录播业务数据源、默认加密
Declared In
IMSLinkVisualPlayerViewController+Business.h
– setDataSource:vodStartTime:vodEndTime:
	设置录播业务数据源、默认不加密
- (BOOL)setDataSource:(NSString *)iotId vodStartTime:(NSInteger)vodStartTime vodEndTime:(NSInteger)vodEndTimeParameters
| iotId | 设备iotId | 
|---|---|
| vodStartTime | 录播开始时间、单位为1970年1月1日开始的秒数 | 
| vodEndTime | 录播结束时间、单位为1970年1月1日开始的秒数 | 
Return Value
是否成功设置数据源
Discussion
设置录播业务数据源、默认不加密
Declared In
IMSLinkVisualPlayerViewController+Business.h
– setDataSource:vodStartTime:vodEndTime:encryptType:
	设置录播业务数据源、默认加密
- (BOOL)setDataSource:(NSString *)iotId vodStartTime:(NSInteger)vodStartTime vodEndTime:(NSInteger)vodEndTime encryptType:(NSInteger)encryptTypeParameters
| iotId | 设备iotId | 
|---|---|
| vodStartTime | 录播开始时间、单位为1970年1月1日开始的秒数 | 
| vodEndTime | 录播结束时间、单位为1970年1月1日开始的秒数 | 
| encryptType | 加密类型(预留接口,目前默认填0,为AES-128加密方式) | 
Return Value
是否成功设置数据源
Discussion
设置录播业务数据源、默认加密
Declared In
IMSLinkVisualPlayerViewController+Business.h