IMLMediaPlayer
NameSpace: MagicLeap
Interface for target classes used by MLMediaPlayer Each function must be implemented by the child player type
Inherited by:
UnityEngine.XR.MagicLeap.MLMedia.Player
Public Fields
IsPlaying
Gets a bool indicating if the media player is currently playing or not.
public bool IsPlaying { get; set; }
Public Methods
int GetDurationMilliseconds
Gets the duration of the video in milliseconds
public int GetDurationMilliseconds()
Returns: Duration of the video, -1 on failure.
Reimplemented by: GetDurationMilliseconds
int GetHeight
Get the height of the video in pixels
public int GetHeight()
Returns: The height of the video, -1 on failure.
Reimplemented by: GetHeight
int GetPositionMilliseconds
Gets the current position of the video in milliseconds
public int GetPositionMilliseconds()
Returns: Position of the playback of the video, -1 on failure.
Reimplemented by: GetPositionMilliseconds
int GetWidth
Get the width of the video in pixels
public int GetWidth()
Returns: The width of the video, -1 on failure.
Reimplemented by: GetWidth
MLResult Pause
Pauses the video.
public MLResult Pause()
Returns: MLResult.Result will be MLResult.Code.Ok if operation succeeded.
Reimplemented by: Pause
MLResult Play
Plays the video.
public MLResult Play()
Returns: MLResult.Result will be MLResult.Code.Ok if operation succeeded.
Reimplemented by: Play
MLResult Resume
Resume the video.
public MLResult Resume()
Returns: MLResult.Result will be MLResult.Code.Ok if operation succeeded.
Reimplemented by: Resume
MLResult Seek
Seeks the specified time in the video.
public MLResult Seek(
int positionSeconds,
MLMedia.Player.SeekMode seekMode
)
Parameters
Type | Name | Description |
---|---|---|
int | positionSeconds | Absolute time to seek to. |
MLMedia.Player.SeekMode | seekMode | Mode indicating where exactly to seek to. |
Returns: MLResult.Result will be MLResult.Code.Ok if operation succeeded.
Reimplemented by: Seek
MLResult SetLooping
Sets the loop flag for the video.
public MLResult SetLooping(
bool loop
)
Parameters
Type | Name | Description |
---|---|---|
bool | loop | Flag to loop |
Returns: MLResult.Result will be MLResult.Code.Ok if operation succeeded.
Reimplemented by: SetLooping
MLResult SetSourcePath
Sets the source path that the media player will play content from.
public MLResult SetSourcePath(
string source
)
Parameters
Type | Name | Description |
---|---|---|
string | source | Path of the media that's on the device. |
Returns: MLResult.Result will be MLResult.Code.Ok if operation succeeded. MLResult.Result will be MLResult.Code.InvalidParam if failed due to an invalid input parameter. MLResult.Result will be MLResult.Code.UnspecifiedFailure if failed due to internal error. MLResult.Result will be MLResult.Code.MediaGenericNoInit if media player was not properly built or initialized. MLResult.Result will be MLResult.Code.PermissionDenied if attempting to access web content without appropriate network permissions
Reimplemented by: SetSourcePath
MLResult SetSourceURI
Sets the source path that the media player will play content from.
public MLResult SetSourceURI(
string source
)
Parameters
Type | Name | Description |
---|---|---|
string | source | URI of the media. |
Returns: MLResult.Result will be MLResult.Code.Ok if operation succeeded. MLResult.Result will be MLResult.Code.InvalidParam if failed due to an invalid input parameter. MLResult.Result will be MLResult.Code.UnspecifiedFailure if failed due to internal error. MLResult.Result will be MLResult.Code.MediaGenericNoInit if media player was not properly built or initialized. MLResult.Result will be MLResult.Code.PermissionDenied if attempting to access web content without appropriate network permissions
Reimplemented by: SetSourceURI
MLResult SetVolume
Sets the volume of the video.
public MLResult SetVolume(
float vol
)
Parameters
Type | Name | Description |
---|---|---|
float | vol | Volume between 0 and 1. |
Returns: MLResult.Result will be MLResult.Code.Ok if operation succeeded.
Reimplemented by: SetVolume
MLResult Stop
Stops the video in the editor.
public MLResult Stop()
Returns: MLResult.Result will be MLResult.Code.Ok if operation succeeded.
Reimplemented by: Stop