Table of Contents

Class FramePlayer

Namespace
easyar
Assembly
EasyAR.Sense.dll

Controlseasyar.InputFramePlayerandeasyar.VideoInputFramePlayerin the scene, providing functional extensions in the Unity environment.

It will be used whenFrameSourceisFramePlayeror when 'Frame Player' is selected in the 'Session Validation Tool' of theDiagnosticsControllerinspector in the editor.

public class FramePlayer : FrameSource
Inheritance
FramePlayer
Inherited Members

Fields

FilePath

File path. Can be set beforePlay().

public string FilePath

Field Value

FilePathType

Path type. Can be set beforePlay().

public WritablePathType FilePathType

Field Value

Properties

AvailableCenterMode

Provided only when creating a new frame source. It is only accessed during theAssemble()process.

All available center modes.

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

Property Value

Camera

Provided only when creating a new frame source. It is only accessed during theAssemble()process.

On desktop devices or mobile phones, this camera represents theCameracorresponding to the real-world camera device in the virtual world, with its projection matrix and position corresponding to the real camera, controlled by EasyAR. On head-mounted displays, this camera is only used to display some diagnostic text in front of the eyes, not for rendering images, and the camera is not controlled by EasyAR.

protected override Camera Camera { get; }

Property Value

CameraCandidate

An alternative toCamera, valid only when Unity XR Origin is not used. 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 is accessed throughout the lifetime of theARSession.

Whether the camera frame input has started.

protected override bool CameraFrameStarted { get; }

Property Value

DeviceCameras

Provided only when creating a new frame source. It is accessed whenCameraFrameStartedis true.

The device camera that provides the camera frame data. If camera frame data is provided by multiple cameras, the list should include all of them.

Ensure that the value is correct whenCameraFrameStartedis true.

protected override List<FrameSourceCamera> DeviceCameras { get; }

Property Value

Display

Provided only when creating a new frame source. It is only accessed during theAssemble()process.

Provides display system information. You can useDefaultSystemDisplayorDefaultHMDDisplayto obtain default display information.

protected override IDisplay Display { get; }

Property Value

IsAvailable

Provided only when creating a new frame source. It is only accessed during theAssemble()process.

Whether the current frame source is available.

If the value is null,CheckAvailability()will be called, and the value will be obtained after theCoroutineends.

protected override Optional<bool> IsAvailable { get; }

Property Value

IsCameraUnderControl

Provided only when creating a new frame source. It is only accessed during theAssemble()process.

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

When creating head-mounted display extensions, it should be false. You should have full control over 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 completed.

public bool IsCompleted { get; }

Property Value

IsHMD

Provided only when creating a new frame source. It is only accessed during theAssemble()process.

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

Some frame filters may behave differently on devices.

protected override bool IsHMD { get; }

Property Value

IsSeekable

Whether the current playback time can be located. If the recording process is abnormally interrupted, it may lead to missing index data, making it impossible to set the current playback 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 playback time. Unit is seconds.

public Optional<double> Length { get; }

Property Value

Speed

Current playback speed.

public double Speed { get; set; }

Property Value

Time

Time that has been played.

public double Time { get; }

Property Value

Methods

OnSessionStart(ARSession)

Provided only when creating a new frame source. It is only accessed during theStartSession()process.

Handles session startup, if this frame source is assembled intoAssembly. This method is designed for deferred initialization, allowing you to perform AR-specific initialization tasks.

protected override void OnSessionStart(ARSession session)

Parameters

session

OnSessionStop()

Provided only when creating a new frame source. It is accessed duringStopSession(bool)or other session stop/corruption processes.

Handles session stopping, if this frame source is assembled intoAssembly. You can use this method to destroy resources created during session startup and runtime and restore internal state. This method is 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 corrupted.

protected override void OnSessionStop()

Play()

Plays an eif file. IfPlay()andStop()are not manually called, it will automaticallyPlay()after theARSessionstarts.

Can only be used after the session starts.

public bool Play()

Returns

Seek(double)

Sets the current playback time. Unit is seconds. Returns false if index data is missing.

public bool Seek(double time)

Parameters

time

Returns

Stop()

Stops playing the eif file.

public void Stop()