Table of Contents

Class FramePlayer

Namespace
easyar
Assembly
EasyAR.Sense.dll

Controls easyar.InputFramePlayer and easyar.VideoInputFramePlayer in the scene, providing functionality extensions in the Unity environment.

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

public class FramePlayer : FrameSource
Inheritance
FramePlayer
Inherited Members

Fields

FilePath

File path. Can be set before Play().

public string FilePath

FilePathType

Path type. Can be set before Play().

public WritablePathType FilePathType

Properties

AvailableCenterMode

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof.

Allcentermodesthatcanbeused.

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

Camera

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof.

Ondesktopdevicesorphones,thiscameracorrespondstotheinthevirtualworldthatrepresentsthecameradeviceintherealenvironment;itsprojectionmatrixandpositionwillcorrespondtotherealcamerasandbecontrolledbyEasyAR.Onheadsets,thiscameraisonlyusedtodisplaysomediagnostictextinfrontoftheeyesandisnotusedforrendering;thecameraisnotcontrolledbyEasyAR.

protected override Camera Camera { get; }

CameraCandidate

Alternative to Camera, only valid when Unity XR Origin is not used. If not set, Camera.main will be used.

public Camera CameraCandidate { get; set; }

CameraFrameStarted

Providedonlywhencreatinganewframesource.Itisaccessedthroughouttheentirelifecycleof.

Whetherthecameraframehasstartedinput.

protected override bool CameraFrameStarted { get; }

DeviceCameras

Providedonlywhencreatinganewframesource.Itisaccessedwhenistrue.

Thedevicecamerathatprovidesthecameraframedata.Ifthecameraframedataisprovidedbymultiplecameras,thelistshouldincludeallofthem.

Ensurethatthevalueiscorrectwhenistrue.

protected override List<FrameSourceCamera> DeviceCameras { get; }

Display

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof.

Providesdisplaysysteminformation.Youcanuseortoobtaindefaultdisplayinformation.

protected override IDisplay Display { get; }

IsAvailable

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof.

Whetherthecurrentframesourceisavailable.

Ifthevalueisnull,willbecalled,andthevaluewillbeobtainedaftertheends.

protected override Optional<bool> IsAvailable { get; }

IsCameraUnderControl

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof.

Whenthevalueistrue,thesessionwillupdatethecamera'stransformandrenderthecameraimage.

Whencreatingaheadsetextension,itshouldbefalse.Youshouldhavefullcontroloverthe3Dcamerainthescene.Youshouldhandlecamerarendering,especiallyinVSTmode.

protected override bool IsCameraUnderControl { get; }

IsCompleted

Whether playback has completed.

public bool IsCompleted { get; }

IsHMD

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof.

Whetherthecurrentframesourceisaheadset.Ifitisaheadset,diagnosticinformationwillbedisplayedona3Dboardinfrontofthecamera.

Someframefiltersmayoperatedifferentlyonthedevice.

protected override bool IsHMD { get; }

IsSeekable

Whether the current playback time is seekable. Abnormal interruption during recording may cause missing index data, making it impossible to set the current playback time.

public bool IsSeekable { get; }

IsSpeedChangeable

Whether the playback speed can be modified.

public bool IsSpeedChangeable { get; }

IsStarted

Whether playback has started.

public bool IsStarted { get; }

Length

Expected total playback time. Unit: seconds.

public Optional<double> Length { get; }

Speed

Current playback speed.

public double Speed { get; set; }

Time

Elapsed playback time.

public double Time { get; }

enabled

Plays/pauses the eif file while the ARSession is running. Playback will only start after the session starts and when MonoBehaviour.enabled is true.

public bool enabled { get; set; }

Methods

OnSessionStart(ARSession)

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheStartSessionprocessof.

Handlessessionstartupifthisframesourcehasbeenassembledinto.Thismethodisdesignedforlazyinitialization;youcanperformAR-specificinitializationworkinthismethod.

protected override void OnSessionStart(ARSession session)

Parameters

session

OnSessionStop()

Providedonlywhencreatinganewframesource.Itisaccessedduringorothersessionsessionstop/corruptionprocesses.

Handlessessionstopifthisframesourcehasbeenassembledinto.Youcanusethismethodtodestroyresourcescreatedduringandsessionoperationandrestoreinternalstate.Thismethodisguaranteedtobecalledbeforesessiondestruction.Iftheframesourceisdestroyedbeforethesession,itwillnotbecalled,andthesessionwillbecorrupted.

protected override void OnSessionStop()

Play()

Plays an eif file. If Play() and Stop() are not called manually, it will automatically Play() after the ARSession starts.

Can only be used after the session has started.

public bool Play()

Seek(double)

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

public bool Seek(double time)

Parameters

time

Stop()

Stops playing the eif file.

public void Stop()