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
Provided only when creating a new frame source. It is only accessed during the Assemble() process.
All available center modes.
protected override IReadOnlyList<ARSession.ARCenterMode> AvailableCenterMode { get; }
Camera
Provided only when creating a new frame source. It is only accessed during the Assemble() process.
On desktop or mobile devices, this camera represents the Camera corresponding to the physical camera device in the virtual world. Its projection matrix and position will correspond to the real camera and are controlled by EasyAR. On an HMD, this camera is only used to display diagnostic text in front of the eyes, not for rendering. The camera is not controlled by EasyAR.
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
Provided only when creating a new frame source. It is accessed throughout the lifetime of the ARSession.
Whether camera frame input has started.
protected override bool CameraFrameStarted { get; }
DeviceCameras
Provided only when creating a new frame source. It is accessed only when CameraFrameStarted is true.
Provides the device camera(s) supplying the camera frame data. If frame data comes from multiple cameras, the list should include all of them.
Ensure the value is correct when CameraFrameStarted is true.
protected override List<FrameSourceCamera> DeviceCameras { get; }
Display
Provided only when creating a new frame source. It is only accessed during the Assemble() process.
Provides display system information. You can use DefaultSystemDisplay or DefaultHMDDisplay to get the default display information.
protected override IDisplay Display { get; }
IsAvailable
Provided only when creating a new frame source. It is only accessed during the Assemble() process.
Whether the current frame source is available.
If the value is null, CheckAvailability() will be called, and the value will be obtained after the Coroutine ends.
protected override Optional<bool> IsAvailable { get; }
IsCameraUnderControl
Provided only when creating a new frame source. It is only accessed during the Assemble() process.
When true, the session updates the camera's transform and renders the camera image.
When creating an HMD extension, 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; }
IsCompleted
Whether playback has completed.
public bool IsCompleted { get; }
IsHMD
Provided only when creating a new frame source. It is only accessed during the Assemble() process.
Whether the current frame source is an HMD. If it is an HMD, diagnostic information will be displayed on a 3D board in front of the camera.
Some frame filters behave differently when running on devices.
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)
Provided only when creating a new frame source. It is only accessed during the StartSession() process.
Handles session startup if this frame source is assembled into the Assembly. This method is designed for lazy initialization; you can perform AR-specific initialization work here.
protected override void OnSessionStart(ARSession session)
Parameters
session
OnSessionStop()
Provided only when creating a new frame source. It is accessed during StopSession(bool) or other session stopping/corruption processes.
Handles session stopping if this frame source is assembled into the Assembly. You can use this method to destroy resources created in StartSession() and during session runtime, and restore internal state. It is guaranteed to be called before the session is destroyed. If the frame source is destroyed before the session, this method will not be called, and the session will be corrupted.
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()