// %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% namespace UnityEngine.XR.MagicLeap { /// /// MLMedia APIs. /// public partial class MLMedia { /// /// Media player script that allows playback of a streaming video (either from file or web URL) /// This script will update the main texture parameter of the Renderer attached as a sibling /// with the video frame from playback. Audio is also handled through this class and will /// playback audio from the file. /// public partial class Player { /// /// Delegate for the any OnMediaPlayerGeneral events (events that only return the mediaPlayer reference) /// public delegate void OnMediaPlayerGeneralDelegate(MLMedia.Player mediaPlayer); /// /// Delegate for the any OnDRMTrackInfo event. /// public delegate void OnDRMTrackInfoDelegate(MLMedia.Player mediaPlayer, MLMedia.Player.Track.DRM.Info trackDRMInfo); /// /// Delegate for the any OnTrackSelected event. /// public delegate void OnTrackSelectedDelegate(MLMedia.Player mediaPlayer, Track selectedTrack); /// /// Delegate for the any OnTrackFound event. /// public delegate void OnTrackFoundDelegate(MLMedia.Player mediaPlayer, Track track); /// /// Delegate for the any OnCaptionsText event. /// public delegate void OnCaptionsTextDelegate(MLMedia.Player mediaPlayer, string text); /// /// Delegate for the any OnVideoSizeChanged event. /// public delegate void OnVideoSizeChangedDelegate(MLMedia.Player mediaPlayer, int width, int height); /// /// Delegate for the any OnError event. /// public delegate void OnErrorDelegate(MLMedia.Player mediaPlayer, MLResult.Code errorCode); /// /// Delegate for the the OnTimedTextUpdate event. /// public delegate void OnTimedTextUpdateDelegate(MLMedia.Player mediaPlayer, ulong timedText); /// /// Delegate for the the OnInfo event. /// /// The info event that has occured. public delegate void OnInfoDelegate(MLMedia.Player mediaPlayer, MLMedia.Player.Info info); /// /// Delegate for the the OnBufferingUpdate event. /// /// The percent of buffering completed for the set source. public delegate void OnBufferingUpdateDelegate(MLMedia.Player mediaPlayer, float percent); /// /// Event used to listen for when Play() has been called. /// public event OnMediaPlayerGeneralDelegate OnPlay = delegate { }; /// /// Event used to listen for when Pause() has been called. /// public event OnMediaPlayerGeneralDelegate OnPause = delegate { }; /// /// Event used to listen for when Stop() has been called. /// public event OnMediaPlayerGeneralDelegate OnStop = delegate { }; public event OnTrackFoundDelegate OnTrackFound = delegate { }; public event OnTrackSelectedDelegate OnTrackSelected = delegate { }; public event OnDRMTrackInfoDelegate OnDRMTrackInfo = delegate { }; public event OnCaptionsTextDelegate OnCEA608 = delegate { }; public event OnCaptionsTextDelegate OnCEA708 = delegate { }; /// /// Event used to listen for when timed text apppears. /// public event OnCaptionsTextDelegate OnTimedText = delegate { }; /// /// Event used to listen for when subtitles are updated. /// public event OnMediaPlayerGeneralDelegate OnMediaSubtitleUpdate = delegate { }; /// /// Event used to listen for when the media player frame is available (used for rendering purposes). /// public event OnMediaPlayerGeneralDelegate OnFrameAvailable = delegate { }; /// /// Event used to listen for when the video size changes. /// public event OnVideoSizeChangedDelegate OnVideoSizeChanged = delegate { }; /// /// Event used to listen for when the frames are packed. /// public event OnMediaPlayerGeneralDelegate OnFramePacking = delegate { }; /// /// Event used to listen for when information about the media player, see the MLMedia.Player.Info enum for the types of information given. /// public event OnInfoDelegate OnInfo = delegate { }; /// /// Event used to listen for when the media player has finished preparing. /// public event OnMediaPlayerGeneralDelegate OnPrepared = delegate { }; /// /// Event used to listen for when the media player is buffering. /// public event OnBufferingUpdateDelegate OnBufferingUpdate = delegate { }; /// /// Event used to listen for the media player has completed playing it's source. /// public event OnMediaPlayerGeneralDelegate OnCompletion = delegate { }; /// /// Event used to listen for when the media player has an error. /// public event OnErrorDelegate OnError = delegate { }; /// /// Event used to listen for when the media player has finished seeking. /// public event OnMediaPlayerGeneralDelegate OnSeekComplete = delegate { }; /// /// Event used to listen for when the media player resets. /// public event OnMediaPlayerGeneralDelegate OnResetComplete = delegate { }; } } }