human: 如何处理七牛云的实时音视频QNScreenVideoTrack

gpt: [实时音视频](https://developer.qiniu.com/rtc) > API 文档 > iOS >QNScreenVideoTrack

#  QNScreenVideoTrack

最近更新时间: 2023-07-07 21:17:43

本地视频录屏 Track 类

> 屏幕录制 Track 的创建需要发起系统屏幕录制的申请，具体使用姿势请参考[屏幕录制 Track
> 使用](https://developer.qiniu.com/rtc/development_guidelines/9258/audio-and-
> video-collection-iOS#2)。

Hierarchy

  * [QNTrack](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-iOS/8851/QNTrack-iOS)
    * [QNLocalTrack](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-iOS/8847/QNLocalTrack-iOS)
      * [QNLocalVideoTrack](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-iOS/8849/QNLocalVideoTrack-iOS)
        * [QNCameraVideoTrack](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-iOS/8852/QNCameraVideoTrack-iOS)
        * QNScreenVideoTrack 
        * [QNCustomVideoTrack](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-iOS/8853/QNCustomVideoTrack-iOS)
      * [QNLocalAudioTrack](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-iOS/8854/QNLocalAudioTrack-iOS)
        * [QNMicrophoneAudioTrack](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-iOS/8855/QNMicrophoneAudioTrack-iOS)
        * [QNCustomAudioTrack](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-iOS/8856/QNCustomAudioTrack-iOS)
    * [QNRemoteTrack](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-iOS/8857/QNRemoteTrack-iOS)
      * [QNRemoteVideoTrack](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-iOS/8858/QNRemoteVideoTrack-iOS)
      * [QNRemoteAudioTrack](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-iOS/8859/QNRemoteAudioTrack-iOS)

Index

Core Properties

  * userID
  * trackID
  * kind
  * tag
  * muted
  * delegate
  * screenDelegate

Core Methods

  * updateMute
  * destroy
  * sendSEI
  * sendSEIWithData
  * play
  * isScreenRecorderAvailable
  * setVideoEncoderConfig

Core Properties

userID

  * @property (nonatomic, readonly) NSString *userID;
  * 一路 Track 所属用户的唯一标识

trackID

  * @property (nonatomic, strong) NSString *trackID;
  * 一路 Track 在 Server 端的唯一标识

> 发布成功时由 SDK 自动生成，订阅/Mute 等操作依据此 trackID 来确定相应的 Track

kind

  * @property (nonatomic, readonly) [QNTrackKind](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-iOS/9254) kind;
  * 标识该路 Track 是音频还是视频

tag

  * @property (nonatomic, strong) NSString *tag;
  * Track 的 tag

> 当发布多路视频 Track 时，可用 tag 来作区分

muted

  * @property (nonatomic, assign, readonly) BOOL muted;
  * 标识 Track 是否为 mute 状态

delegate

  * @property (nonatomic, weak) id<[QNLocalVideoTrackDelegate](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-iOS/11970/QNLocalVideoTrackDelegate)> delegate;
  * 本地视频 Track 回调代理。

screenDelegate

  * @property (nonatomic, weak) id<[QNScreenVideoTrackDelegate](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-iOS/9582/QNScreenVideoTrackDelegate)> screenDelegate;
  * 录屏 Track 回调代理

Core Methods

updateMute

  * \- (void)updateMute:(BOOL)mute;
  * 更新当前 Track 的 mute 值，静默后，SDK 将会发送静默帧数据

> 当静默状态改变后，远端用户将会收到
> [QNRemoteVideoTrackDelegate.didMuteStateChanged](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-
> iOS/11947) 的回调

Parameters

    * mute: BOOL 

是否静默 Track

destroy

  * \- (void)destroy;
  * 销毁本地音/视频 Track

> 在不使用该 Track 之后，请务必调用此接口

sendSEI

  * \- (void)sendSEI:(NSString *)videoSEI uuid:(NSString *)uuid repeatNmuber:(NSNumber *)repeatNumber;
  * 发送 SEI

> 该接口已废弃，请使用
> [QNLocalVideoTrack.sendSEIWithData](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-
> iOS/8849)

> 需要停止发送 SEI，可以设置 videoSEI 为 nil，repeatNumber 为 0 即可

Parameters

    * videoSEI: NSString 

SEI 的消息内容

    * uuid: NSString 

设备 UUID

    * repeatNumber: NSNumber 

重复次数

sendSEIWithData

  * \- (void)sendSEIWithData:(NSData *)SEIData uuid:(NSData *)uuid repeatCount:(NSNumber *)repeatCount;
  * 发送 SEI

> SEIData SEI 内容，不超过 4096 个字节
>
> 需要停止发送 SEI，可以设置 SEIData 为 nil，repeatCount 为 0 即可

Parameters

    * SEIData: NSString 

SEI 的消息内容

    * uuid: NSString 

设备 UUID

    * repeatCount: NSNumber 

重复次数

play

  * \- (void)play:([QNVideoGLView](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-iOS/11950/QNVideoGLView-iOS) *)videoView;
  * 视频 Track 渲染

Parameters

    * videoView: [QNVideoGLView](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-iOS/11950/QNVideoGLView-iOS)

渲染的 view

isScreenRecorderAvailable

  * \+ (BOOL)isScreenRecorderAvailable;
  * 判断屏幕录制功能是否可用

> 屏幕录制功能仅在 iOS 11 及以上版本可用

Returns BOOL

setVideoEncoderConfig

  * \- (void)setVideoEncoderConfig:(QNVideoEncoderConfig *)config;
  * 动态修改编码配置

Parameters

    * config: [QNVideoEncoderConfig](https://developer.qiniu.com/rtc/8850/QNScreenVideoTrack-iOS/11944/QNVideoEncoderConfig-iOS)

编码参数配置

以上内容是否对您有帮助？