Class MediaPlayer
This is the primary AVPro Video component and handles all media loading,
seeking, information retrieving etc. This component does not do any display
of the video. Instead this is handled by other components such as
ApplyToMesh, ApplyToMaterial, DisplayIMGUI, DisplayUGUI.
Inheritance
System.Object
MediaPlayer
Implements
MonoBehaviour
ISerializationCallbackReceiver
Assembly: cs.temp.dll.dll
public class MediaPlayer : MonoBehaviour
Properties
Declaration
public float AudioBalance { get; set; }
Property Value
Type |
Description |
System.Single |
|
Declaration
public bool AudioFocusEnabled { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Declaration
public float AudioFocusOffLevelDB { get; set; }
Property Value
Type |
Description |
System.Single |
|
Declaration
public Transform AudioFocusTransform { get; set; }
Property Value
Type |
Description |
Transform |
|
Declaration
public float AudioFocusWidthDegrees { get; set; }
Property Value
Type |
Description |
System.Single |
|
Declaration
public Transform AudioHeadTransform { get; set; }
Property Value
Type |
Description |
Transform |
|
Declaration
public virtual bool AudioMuted { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Declaration
public AudioSource AudioSource { get; }
Property Value
Type |
Description |
AudioSource |
|
Declaration
public virtual IAudioTracks AudioTracks { get; }
Property Value
Declaration
public virtual float AudioVolume { get; set; }
Property Value
Type |
Description |
System.Single |
|
Declaration
public bool AutoOpen { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Declaration
public bool AutoStart { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Declaration
public virtual IBufferedDisplay BufferedDisplay { get; }
Property Value
Declaration
public virtual IMediaCache Cache { get; }
Property Value
Declaration
public virtual IMediaControl Control { get; }
Property Value
Declaration
public int EventMask { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Declaration
public MediaPlayerEvent Events { get; }
Property Value
Declaration
public MediaHints FallbackMediaHints { get; set; }
Property Value
Declaration
public FileFormat ForceFileFormat { get; set; }
Property Value
Declaration
public Resampler FrameResampler { get; }
Property Value
Declaration
public HttpHeaderData HttpHeaders { get; set; }
Property Value
Declaration
public virtual IMediaInfo Info { get; }
Property Value
Declaration
public KeyAuthData KeyAuth { get; set; }
Property Value
Declaration
public bool Loop { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Declaration
public bool MediaOpened { get; }
Property Value
Type |
Description |
System.Boolean |
|
Declaration
public MediaPath MediaPath { get; }
Property Value
Declaration
public MediaReference MediaReference { get; }
Property Value
Declaration
public MediaSource MediaSource { get; }
Property Value
Declaration
public bool PauseMediaOnAppPause { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Declaration
public bool Persistent { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Declaration
public MediaPlayer.OptionsAndroid PlatformOptionsAndroid { get; }
Property Value
Declaration
public MediaPlayer.OptionsApple PlatformOptionsIOS { get; }
Property Value
Declaration
public MediaPlayer.OptionsApple PlatformOptionsMacOSX { get; }
Property Value
Declaration
public MediaPlayer.OptionsApple PlatformOptionsTVOS { get; }
Property Value
Declaration
public MediaPlayer.OptionsWebGL PlatformOptionsWebGL { get; }
Property Value
Declaration
public MediaPlayer.OptionsWindows PlatformOptionsWindows { get; }
Property Value
Declaration
public MediaPlayer.OptionsWindowsUWP PlatformOptionsWindowsUWP { get; }
Property Value
Declaration
public float PlaybackRate { get; set; }
Property Value
Type |
Description |
System.Single |
|
Declaration
public virtual IMediaPlayer Player { get; }
Property Value
Declaration
public bool PlayMediaOnAppUnpause { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Declaration
public int ResampleBufferSize { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Declaration
public Resampler.ResampleMode ResampleMode { get; set; }
Property Value
Declaration
public bool SideloadSubtitles { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Declaration
public MediaPath SubtitlePath { get; set; }
Property Value
Declaration
public virtual IMediaSubtitles Subtitles { get; }
Property Value
TextTracks
Declaration
public virtual ITextTracks TextTracks { get; }
Property Value
TextureAnisoLevel
Declaration
public int TextureAnisoLevel { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
TextureFilterMode
Declaration
public FilterMode TextureFilterMode { get; set; }
Property Value
Type |
Description |
FilterMode |
|
TextureProducer
Declaration
public virtual ITextureProducer TextureProducer { get; }
Property Value
TextureWrapMode
Declaration
public TextureWrapMode TextureWrapMode { get; set; }
Property Value
Type |
Description |
TextureWrapMode |
|
Declaration
public bool UseResampler { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Declaration
public VideoMapping VideoLayoutMapping { get; set; }
Property Value
Declaration
public virtual IVideoTracks VideoTracks { get; }
Property Value
Methods
Declaration
public bool AddChunkToVideoBuffer(byte[] chunk, ulong offset, ulong chunkSize)
Parameters
Type |
Name |
Description |
System.Byte[] |
chunk |
|
System.UInt64 |
offset |
|
System.UInt64 |
chunkSize |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
Declaration
public virtual BaseMediaPlayer CreateMediaPlayer()
Returns
Declaration
public void DisableSubtitles()
Declaration
public bool EnableSubtitles(MediaPath mediaPath)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Declaration
public bool EndOpenChunkedVideoFromBuffer()
Returns
Type |
Description |
System.Boolean |
|
Declaration
public Texture2D ExtractFrame(Texture2D target, double timeSeconds = -1, bool accurateSeek = true, int timeoutMs = 1000, int timeThresholdMs = 100)
Parameters
Type |
Name |
Description |
Texture2D |
target |
|
System.Double |
timeSeconds |
|
System.Boolean |
accurateSeek |
|
System.Int32 |
timeoutMs |
|
System.Int32 |
timeThresholdMs |
|
Returns
Type |
Description |
Texture2D |
|
Declaration
public void ExtractFrameAsync(Texture2D target, MediaPlayer.ProcessExtractedFrame callback, double timeSeconds = -1, bool accurateSeek = true, int timeoutMs = 1000, int timeThresholdMs = 100)
Parameters
Type |
Name |
Description |
Texture2D |
target |
|
MediaPlayer.ProcessExtractedFrame |
callback |
|
System.Double |
timeSeconds |
|
System.Boolean |
accurateSeek |
|
System.Int32 |
timeoutMs |
|
System.Int32 |
timeThresholdMs |
|
Declaration
public void ForceDispose()
Declaration
public MediaPlayer.PlatformOptions GetCurrentPlatformOptions()
Returns
Declaration
public static Platform GetPlatform()
Returns
Declaration
protected void Initialise()
Declaration
protected bool IsHandleEvent(MediaPlayerEvent.EventType eventType)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Declaration
public bool IsUsingAndroidOESPath()
Returns
Type |
Description |
System.Boolean |
|
Declaration
protected virtual void OnDestroy()
Declaration
public bool OpenMedia(MediaPath path, bool autoPlay = true)
Parameters
Type |
Name |
Description |
MediaPath |
path |
|
System.Boolean |
autoPlay |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public bool OpenMedia(MediaPathType pathType, string path, bool autoPlay = true)
Parameters
Type |
Name |
Description |
MediaPathType |
pathType |
|
System.String |
path |
|
System.Boolean |
autoPlay |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public bool OpenMedia(MediaReference mediaReference, bool autoPlay = true)
Parameters
Type |
Name |
Description |
MediaReference |
mediaReference |
|
System.Boolean |
autoPlay |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public bool OpenMedia(bool autoPlay = true)
Parameters
Type |
Name |
Description |
System.Boolean |
autoPlay |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public bool OpenMediaFromBuffer(byte[] buffer, bool autoPlay = true)
Parameters
Type |
Name |
Description |
System.Byte[] |
buffer |
|
System.Boolean |
autoPlay |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public virtual void Pause()
Declaration
public virtual void Play()
Declaration
public void Rewind(bool pause)
Parameters
Type |
Name |
Description |
System.Boolean |
pause |
|
Declaration
public void RewindPrerollPause()
Declaration
public void SeekToLiveTime(double offset = 0)
Parameters
Type |
Name |
Description |
System.Double |
offset |
|
Declaration
public bool StartOpenChunkedMediaFromBuffer(ulong length, bool autoPlay = true)
Parameters
Type |
Name |
Description |
System.UInt64 |
length |
|
System.Boolean |
autoPlay |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
Declaration
protected virtual void Update()
Implements
MonoBehaviour
ISerializationCallbackReceiver