Table of Contents

Class VideoRecorder

命名空间
easyar
程序集
EasyAR.Sense.dll

在场景中控制Recorder的MonoBehaviour,在Unity环境下提供功能扩展。

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

注意: 仅在非企业版Sense中,Android GLES2/3且关闭多线程渲染时可用。

public class VideoRecorder : MonoBehaviour
继承
VideoRecorder

字段

AudioProfile

public VideoRecorder.AudioProfiles AudioProfile

CustomVideoProfile

自定义录屏配置。VideoProfile == Custom时使用。在StartRecording(Action<bool, PermissionStatus, string>, Action<string>)前修改才有效。

public VideoRecorder.VideoProfiles CustomVideoProfile

FilePath

录屏文件输出路径。在StartRecording(Action<bool, PermissionStatus, string>, Action<string>)前修改才有效。

public string FilePath

FilePathType

录屏文件输出路径类型。在StartRecording(Action<bool, PermissionStatus, string>, Action<string>)前修改才有效。

public WritablePathType FilePathType

Orientation

public VideoRecorder.VideoOrientation Orientation

VideoProfile

public VideoRecorder.RecordProfile VideoProfile

ZoomMode

public VideoRecorder.RecordZoomMode ZoomMode

属性

IsAvailable

录屏功能是否可用( 仅在非企业版Sense中,Android GLES2/3且关闭多线程渲染时可用)。

public static bool IsAvailable { get; }

NotAvailableReason

不可用时的原因。

public static string NotAvailableReason { get; }

方法

RecordFrame(RenderTexture)

使用texture录制一帧数据。

public void RecordFrame(RenderTexture texture)

参数

texture

StartRecording(Action<bool, PermissionStatus, string>, Action<string>)

开始录屏。录制的视频数据需要通过RecordFrame(RenderTexture)不断传入。

public void StartRecording(Action<bool, PermissionStatus, string> onStart, Action<string> onRecordError)

参数

onStart
onRecordError

StopRecording()

停止录屏。

public bool StopRecording()