// %BANNER_BEGIN%
// ---------------------------------------------------------------------
// %COPYRIGHT_BEGIN%
// Copyright (c) (2018-2022) Magic Leap, Inc. All Rights Reserved.
// Use of this file is governed by the Software License Agreement, located here: https://www.magicleap.com/software-license-agreement-ml2
// Terms and conditions applicable to third-party materials accompanying this distribution may also be found in the top-level NOTICE file appearing herein.
// %COPYRIGHT_END%
// ---------------------------------------------------------------------
// %BANNER_END%
using System;
namespace UnityEngine.XR.MagicLeap
{
///
/// Interface for target classes used by MLMediaPlayer
/// Each function must be implemented by the child player type
///
[Obsolete("MLMedia API is being deprecated and will be removed from the MagicLeap SDK. Use Unity's VideoPlayer component (requires Unity 2022.3.10) instead.")]
public interface IMLMediaPlayer
{
///
/// Gets a bool indicating if the media player is currently playing or not.
///
public bool IsPlaying { get; }
///
/// Sets the source path that the media player will play content from.
///
/// URI of the media.
///
/// 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
///
MLResult SetSourceURI(string source);
///
/// Sets the source path that the media player will play content from.
///
/// Path of the media that's on the device.
///
/// 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
///
MLResult SetSourcePath(string source);
///
/// Plays the video.
///
///
/// MLResult.Result will be MLResult.Code.Ok if operation succeeded.
///
MLResult Play();
///
/// Pauses the video.
///
///
/// MLResult.Result will be MLResult.Code.Ok if operation succeeded.
///
MLResult Pause();
///
/// Stops the video in the editor.
///
///
/// MLResult.Result will be MLResult.Code.Ok if operation succeeded.
///
MLResult Stop();
///
/// Resume the video.
///
///
/// MLResult.Result will be MLResult.Code.Ok if operation succeeded.
///
MLResult Resume();
///
/// Seeks the specified time in the video.
///
/// Absolute time to seek to.
///
/// MLResult.Result will be MLResult.Code.Ok if operation succeeded.
///
MLResult Seek(int positionSeconds, MLMedia.Player.SeekMode seekMode);
///
/// Sets the volume of the video.
///
/// Volume between 0 and 1.
///
/// MLResult.Result will be MLResult.Code.Ok if operation succeeded.
///
MLResult SetVolume(float vol);
///
/// Sets the loop flag for the video.
///
/// Flag to loop
///
/// MLResult.Result will be MLResult.Code.Ok if operation succeeded.
///
MLResult SetLooping(bool loop);
///
/// Gets the duration of the video in milliseconds
///
///
/// Duration of the video, -1 on failure.
///
int GetDurationMilliseconds();
///
/// Gets the current position of the video in milliseconds
///
///
/// Position of the playback of the video, -1 on failure.
///
int GetPositionMilliseconds();
///
/// Get the width of the video in pixels
///
///
/// The width of the video, -1 on failure.
///
int GetWidth();
///
/// Get the height of the video in pixels
///
///
/// The height of the video, -1 on failure.
///
int GetHeight();
}
}