VideoRecorder Class

Description

在场景中控制 RecorderMonoBehaviour ,在Unity环境下提供功能扩展。不需要直接使用 Recorder

用户对视频录制的内容有完全控制,录屏功能不会默默地录制屏幕或是camera输出,录制的视频数据需要通过 VideoRecorder.RecordFrame 不断传入。

注意: 如果使用Unity 2020.2及更高版本,录屏功能无法使用。


Enums

public enum VideoRecorder.VideoOrientation

录屏视频朝向。


MonoBehaviour Messages

protected virtual void Start()

protected virtual void OnDestroy()


Fields

Profile

C#

public RecordProfile Profile

创建时使用的录屏配置,只在创建时使用。

Orientation

C#

public VideoRecorder.VideoOrientation Orientation

创建时使用的录屏视频朝向,只在创建时使用。

RecordZoomMode

C#

public RecordZoomMode RecordZoomMode

创建时使用的录屏缩放模式,只在创建时使用。

FilePathType

C#

public WritablePathType FilePathType

创建时使用的录屏文件输出路径类型,只在创建时使用。

FilePath

C#

public string FilePath

创建时使用的录屏文件输出路径,只在创建时使用。


Properties

IsReady

C#

public bool IsReady { get; }

录屏可以使用。如果权限未被允许录屏将无法使用。


Events

StatusUpdate

C#

public event Action< RecordStatus , string> StatusUpdate

录屏状态变化的事件。


Methods

StartRecording

C#

public bool StartRecording()

开始录屏,录屏中使用的配置使用组件内配置。录制的视频数据需要通过 VideoRecorder.RecordFrame 不断传入。

StartRecording

C#

public bool StartRecording( RecorderConfiguration configuration)

开始录屏,录屏中使用的配置使用 configuration 。组件内配置将被忽略。录制的视频数据需要通过 VideoRecorder.RecordFrame 不断传入。

StopRecording

C#

public bool StopRecording()

停止录屏。

RecordFrame

C#

public bool RecordFrame( RenderTexture texture)

使用 texture 录制一帧数据。