Table of Contents

Class FramePlayer

Namespace
easyar
Assembly
EasyAR.Sense.dll

Control in the scene and easyar.InputFramePlayer and easyar.VideoInputFramePlayer's MonoBehaviour, providing function extensions in the Unity environment.

It will be used when FrameSource is FramePlayer or when 'Frame Player' is selected in the 'Session Validation Tool' in the inspector of DiagnosticsController on the editor.

public class FramePlayer : FrameSource
Inheritance
FramePlayer
Inherited Members

Fields

FilePath

File path. Can be set before Play().

public string FilePath

Field Value

FilePathType

Path type. Can be set before Play().

public WritablePathType FilePathType

Field Value

Properties

AvailableCenterMode

Provided only when creating a new frame source. It will only be accessed during the Assemble() process.

All available center modes.

protected override IReadOnlyList<ARSession.ARCenterMode> AvailableCenterMode { get; }

Property Value

Camera

Provided only when creating a new frame source. It will only be accessed during the Assemble() process.

On desktop devices or mobile phones, this camera represents the Camera in the virtual world corresponding to the camera device in the real environment, and its projection matrix and position will correspond to the real camera and be controlled by EasyAR. On the headset, this camera is only used to display some diagnostic text in front of the eyes, not for screen rendering, and the camera is not controlled by EasyAR.

protected override Camera Camera { get; }

Property Value

CameraCandidate

An alternative to Camera, only valid when Unity XR Origin is not used, and if not set, Camera.main will be used.

public Camera CameraCandidate { get; set; }

Property Value

CameraFrameStarted

Provided only when creating a new frame source. It will be accessed throughout the lifecycle of ARSession.

Whether camera frames have started to be input.

protected override bool CameraFrameStarted { get; }

Property Value

DeviceCameras

Provided only when creating a new frame source. It will be accessed when CameraFrameStarted is true.

The device camera that provides camera frame data. If camera frame data is provided by multiple cameras, all cameras need to be included in the list.

Ensure the value is correct when CameraFrameStarted is true.

protected override List<FrameSourceCamera> DeviceCameras { get; }

Property Value

Display

Provided only when creating a new frame source. It will only be accessed during the Assemble() process.

Provides display system information. You can use DefaultSystemDisplay or DefaultHMDDisplay to get default display information.

protected override IDisplay Display { get; }

Property Value

IsAvailable

Provided only when creating a new frame source. It will only be accessed during the Assemble() process.

Whether the current frame source is available.

If the value equals null, CheckAvailability() will be called, and the value will be obtained after the Coroutine ends.

protected override Optional<bool> IsAvailable { get; }

Property Value

IsCameraUnderControl

Provided only when creating a new frame source. It will only be accessed during the Assemble() process.

When the value is true, the session will update the transform of the camera and render the camera image.

When creating headset extensions, it should be false. You should have full control of the 3D camera in the scene. You should handle camera rendering, especially in VST mode.

protected override bool IsCameraUnderControl { get; }

Property Value

IsCompleted

Whether playback has been completed.

public bool IsCompleted { get; }

Property Value

IsHMD

Provided only when creating a new frame source. It will only be accessed during the Assemble() process.

Whether the current frame source is a headset. If it is a headset, diagnostic information will be displayed on the 3D board in front of the camera.

Some frame filters will behave differently on devices.

protected override bool IsHMD { get; }

Property Value

IsSeekable

Whether the current play time can be located. When the recording process is abnormally interrupted, indexing data may be missing, making it impossible to set the current play time.

public bool IsSeekable { get; }

Property Value

IsSpeedChangeable

Whether the playback speed can be modified.

public bool IsSpeedChangeable { get; }

Property Value

IsStarted

Whether playback has started.

public bool IsStarted { get; }

Property Value

Length

Expected total play time. The unit is seconds.

public Optional<double> Length { get; }

Property Value

Speed

Current playback speed.

public double Speed { get; set; }

Property Value

Time

Time already played.

public double Time { get; }

Property Value

Methods

OnSessionStart(ARSession)

Provided only when creating a new frame source. It will only be accessed during the StartSession() process.

Handle session startup if this frame source has been assembled into Assembly. This method is designed for delayed initialization, and you can do AR-specific initialization work in this method.

protected override void OnSessionStart(ARSession session)

Parameters

session

OnSessionStop()

Provided only when creating a new frame source. It will be accessed during StopSession(bool) or other session stopping/damaging processes.

Handle session stop if this frame source has been assembled into Assembly. You can use this method to destroy resources created during StartSession() and session operation and restore internal state. This method will be guaranteed to be called before the session is destroyed. If the frame source is destroyed before the session, it will not be called, and the session will be damaged.

protected override void OnSessionStop()

Play()

Play the eif file. If Play() and Stop() are not manually called, ARSession will automatically Play() after startup.

Can only be used after the session starts.

public bool Play()

Returns

Seek(double)

Set the current play time. The unit is seconds. If indexing data is missing, false will be returned.

public bool Seek(double time)

Parameters

time

Returns

Stop()

Stop playing the eif file.

public void Stop()