Class VideoPlayer_AVPro
Implements
Inherited Members
Namespace: RenderHeads.Media.AVProVideo
Assembly: cs.temp.dll.dll
Syntax
public class VideoPlayer_AVPro : MediaPlayer
Fields
_converted
Declaration
public bool _converted
Field Value
| Type | Description |
|---|---|
| System.Boolean |
_renderModeComponent
Declaration
public MonoBehaviour _renderModeComponent
Field Value
| Type | Description |
|---|---|
| MonoBehaviour |
applyToFarPlane
Declaration
public ApplyToFarPlane applyToFarPlane
Field Value
| Type | Description |
|---|---|
| ApplyToFarPlane |
applyToMaterial
Declaration
public ApplyToMaterial applyToMaterial
Field Value
| Type | Description |
|---|---|
| ApplyToMaterial |
applyToMesh
Declaration
public ApplyToMesh applyToMesh
Field Value
| Type | Description |
|---|---|
| ApplyToMesh |
applyToTexture
Declaration
public ResolveToRenderTexture applyToTexture
Field Value
| Type | Description |
|---|---|
| ResolveToRenderTexture |
AudioOutputMode
Declaration
public MediaPlayer.PlatformOptions.AudioMode AudioOutputMode
Field Value
| Type | Description |
|---|---|
| MediaPlayer.PlatformOptions.AudioMode |
canvasObj
Declaration
public GameObject canvasObj
Field Value
| Type | Description |
|---|---|
| GameObject |
controlledAudioTrackMaxCount
Maximum number of audio tracks that can be controlled. (Read Only)
Declaration
public static readonly ushort controlledAudioTrackMaxCount
Field Value
| Type | Description |
|---|---|
| System.UInt16 |
currentRenderMode
Declaration
public DisplayType currentRenderMode
Field Value
| Type | Description |
|---|---|
| DisplayType |
displayIMGUI
Declaration
public DisplayIMGUI displayIMGUI
Field Value
| Type | Description |
|---|---|
| DisplayIMGUI |
displayUGUI
Declaration
public DisplayUGUI displayUGUI
Field Value
| Type | Description |
|---|---|
| DisplayUGUI |
sendFrameReadyEvents
Warning AVPro does not currently support this
Declaration
public bool sendFrameReadyEvents
Field Value
| Type | Description |
|---|---|
| System.Boolean |
Properties
aspectRatio
Defines how the video content will be stretched to fill the target area.
Declaration
public ScaleMode aspectRatio { get; set; }
Property Value
| Type | Description |
|---|---|
| ScaleMode |
aspectRatioRenderTexture
Declaration
public VideoResolveOptions.AspectRatio aspectRatioRenderTexture { get; set; }
Property Value
| Type | Description |
|---|---|
| VideoResolveOptions.AspectRatio |
audioOutputModeAVPro
Destination for the audio embedded in the video.
Declaration
public MediaPlayer.PlatformOptions.AudioMode audioOutputModeAVPro { get; }
Property Value
| Type | Description |
|---|---|
| MediaPlayer.PlatformOptions.AudioMode |
audioSource
The
Declaration
public AudioSource audioSource { get; set; }
Property Value
| Type | Description |
|---|---|
| AudioSource |
audioTrackCount
Number of audio tracks found in the data source currently configured. (Read Only)
Declaration
public ushort audioTrackCount { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt16 | 0 if not prepared; otherwise the number of audio tracks on the current media |
canSetDirectAudioVolume
Whether direct-output volume controls are supported for the current platform and video format. (Read Only) only possible when the video has been prepared
Declaration
public bool canSetDirectAudioVolume { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
canSetPlaybackSpeed
Whether you can change the playback speed. (Read Only) only possible when the video has been prepared
Declaration
public bool canSetPlaybackSpeed { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
canSetSkipOnDrop
Whether frame-skipping to maintain synchronization can be controlled. (Read Only) only possible when the video has been prepared.
Warning Although This functions, skipOnDrop has no functionality within AVPro
Declaration
public bool canSetSkipOnDrop { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
canSetTime
Whether you can change the current time using the time or frames property. (Read Only) Only Possible when the video has been prepared.
Declaration
public bool canSetTime { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
canSetTimeUpdateMode
Whether you can change the time source followed by the VideoPlayer. (Read Only)
Warning Although This functions,
Declaration
public bool canSetTimeUpdateMode { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
canStep
Returns true if the VideoPlayer can step forward through the video content. (Read Only)
Declaration
public bool canStep { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
clip
The clip being played by the VideoPlayer_AVPro.
Declaration
public MediaReference clip { get; set; }
Property Value
| Type | Description |
|---|---|
| MediaReference |
clockTime
The clock time that the VideoPlayer follows to schedule its samples. The clock time is expressed in seconds. (Read Only)
Declaration
public double clockTime { get; }
Property Value
| Type | Description |
|---|---|
| System.Double | -1 if not initilised; otherwise the current clock time |
color
Declaration
public Color color { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
controlledAudioTrackCount
Number of audio tracks that this VideoPlayer will take control of.
Warning AVPro currently only supports 1 active audio track
Declaration
public int controlledAudioTrackCount { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
externalReferenceTime
Reference time of the external clock the VideoPlayer uses to correct its drift.
AVPro - this returns GetCurrentTime() which is not the same functionality as VideoPlayer
Declaration
public double externalReferenceTime { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
frame
Returns the current video time in frames
Declaration
public long frame { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int64 |
frameCount
Number of frames in the current video content. (Read Only)
Declaration
public ulong frameCount { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt64 |
frameRate
he frame rate of the clip or URL in frames/second. (Read Only)
Declaration
public float frameRate { get; }
Property Value
| Type | Description |
|---|---|
| System.Single |
fullScreen
used to toggle fullscreen when rendererMode is set to: IMGUI
Declaration
public bool fullScreen { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
height
The height of the images in the VideoClip, or URL, in pixels. (Read Only)
Declaration
public uint height { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt32 |
isLooping
Determines whether the VideoPlayer_AVPro restarts from the beginning when it reaches the end of the clip.
Declaration
public bool isLooping { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
isPaused
Whether playback is paused. (Read Only)
Declaration
public bool isPaused { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
isPlaying
Whether content is being played. (Read Only)
Declaration
public bool isPlaying { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
isPrepared
Whether the VideoPlayer has successfully prepared the content to be played. (Read Only)
Declaration
public bool isPrepared { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
length
The length of the VideoClip, or the URL, in seconds. (Read Only)
Declaration
public double length { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
muted
used to toggle weather or not the audio is muted
Declaration
public bool muted { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
pixelAspectRationDenominator
Denominator of the pixel aspect ratio (num:den) for the VideoClip or the URL. (Read Only)
Warning AVPro Does not currently support this
Declaration
public uint pixelAspectRationDenominator { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt32 |
pixelAspectRationNumerator
Numerator of the pixel aspect ratio (num:den) for the VideoClip or the URL. (Read Only)
Warning AVPro Does not currently support this
Declaration
public uint pixelAspectRationNumerator { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt32 |
playbackSpeed
Factor by which the basic playback rate will be multiplied.
Declaration
public float playbackSpeed { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
playOnAwake
Whether the content will start playing back as soon as the component awakes.
Declaration
public bool playOnAwake { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
rendererMode
Where/how the video content will be drawn.
will create the desired components when renderer mode is changed
Declaration
public DisplayType rendererMode { get; set; }
Property Value
| Type | Description |
|---|---|
| DisplayType |
renderMode
Where/how the video content will be drawn.
Recomended to convert to using DisplayType with rendererMode otherwise unexpected behaviour may occur
AVPro:
Declaration
public VideoRenderMode renderMode { get; set; }
Property Value
| Type | Description |
|---|---|
| VideoRenderMode |
skipOnDrop
Whether the VideoPlayer is allowed to skip frames to catch up with current time.
Warning AVPro does not currently support this
Declaration
public bool skipOnDrop { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
source
Declaration
public VideoSource source { get; set; }
Property Value
| Type | Description |
|---|---|
| VideoSource |
sourceAVPro
The source that the VideoPlayer_AVPro will use for playback
Declaration
public MediaSource sourceAVPro { get; set; }
Property Value
| Type | Description |
|---|---|
| MediaSource |
targetCamera
Camera component to draw to when VideoPlayer.renderMode is set to either VideoRenderMode.CameraFarPlane or VideoRenderMode.CameraNearPlane.
Declaration
public Camera targetCamera { get; set; }
Property Value
| Type | Description |
|---|---|
| Camera |
targetCamera3DLayout
Type of 3D content contained in the source video media.
Warning AVPro does not currently support this
Declaration
public int targetCamera3DLayout { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
targetCameraAlpha
overall alpha being applied to the color on the respective rendererMode component
Declaration
public float targetCameraAlpha { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
targetMateralProperty
Declaration
public string targetMateralProperty { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
targetMaterial
Declaration
public Material targetMaterial { get; set; }
Property Value
| Type | Description |
|---|---|
| Material |
targetMaterialRenderer
Declaration
public Renderer targetMaterialRenderer { get; set; }
Property Value
| Type | Description |
|---|---|
| Renderer |
targetTexture
Declaration
public RenderTexture targetTexture { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderTexture |
texture
Internal texture in which video content is placed. (Read Only)
Declaration
public Texture texture { get; }
Property Value
| Type | Description |
|---|---|
| Texture |
time
The presentation time of the currently available frame in VideoPlayer.texture.
Declaration
public double time { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
timeReference
The clock that the VideoPlayer observes to detect and correct drift.
Warning AVPro does not currently support this
Declaration
public int timeReference { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
url
The file or HTTP URL that the VideoPlayer_AVPro reads content from.
AVPro - utilizes MediaPath to store
Will automatically set the path type of the sourceAVPro
Declaration
public MediaPath url { get; set; }
Property Value
| Type | Description |
|---|---|
| MediaPath |
uvRect
The
Declaration
public Rect uvRect { get; set; }
Property Value
| Type | Description |
|---|---|
| Rect |
volume
Used to change the volume of the audio
Declaration
public float volume { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
WaitForFirstFrame
The clock source used by the VideoPlayer to derive its current time.
Warning AVPro does not currently support this
Declaration
public bool WaitForFirstFrame { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
width
The width of the images in the VideoClip, or URL, in pixels. (Read Only)
Declaration
public uint width { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt32 |
Methods
Awake()
this will ensure that the media player is properly initilized when turning on
Declaration
protected override void Awake()
Overrides
CreateAudioComponents()
Creates a AudioOutput compoenent that will be used to play audio when selecting the Unity option from Windows.AudioOutput
Declaration
public void CreateAudioComponents()
CreateRendererComponents()
Creates the components for the differernt rendering modes, this method also handles the destruction of the previous rendering mode components.
Declaration
public void CreateRendererComponents()
DestroyAudioOutputBehaviour()
Destroys the AudioOutput compoenent attached to this object
This componenet is used to take the audio from the video codec and play it through a unity AudioSource compoenent
Declaration
public void DestroyAudioOutputBehaviour()
DestroyRendererBehaviours()
Destroys the rendering mode compoennts attatched to the current object, can handle more than 1 type but not multiple of the same type
Declaration
public void DestroyRendererBehaviours()
EnableAudioTrack(UInt16, Boolean)
VideoRecord:
- Enable/disable audio track decoding. Only effective when the VideoPlayer_AVPro is not currently playing AVPro:
- Changes current active audio track. Only effective when not currently playing.
- Will Mute the track if enabled is set to false
Declaration
public void EnableAudioTrack(ushort trackIndex, bool enabled)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | trackIndex | Index of the audio track to change to. |
| System.Boolean | enabled | True for enabling the track. False for disabling the track. |
EventCallbacks(MediaPlayer, MediaPlayerEvent.EventType, ErrorCode)
Used to simulate and invoke the
Declaration
public void EventCallbacks(MediaPlayer mediaPlayer, MediaPlayerEvent.EventType eventType, ErrorCode errorCode)
Parameters
| Type | Name | Description |
|---|---|---|
| MediaPlayer | mediaPlayer | The MediaPlayer this event came from |
| MediaPlayerEvent.EventType | eventType | The type of event to invoke |
| ErrorCode | errorCode | The error code to show |
GetAudioChannelCount(UInt16)
The number of audio channels in the specified audio track.
Declaration
public ushort GetAudioChannelCount(ushort trackIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | trackIndex | Index for the audio track being queried. |
Returns
| Type | Description |
|---|---|
| System.UInt16 | ushort Number of audio channels. |
GetAudioLanguageCode(UInt16)
Returns the language code, if any, for the specified track.
Declaration
public string GetAudioLanguageCode(ushort trackIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | trackIndex | index of the audio track to query |
Returns
| Type | Description |
|---|---|
| System.String | string> Language Code |
GetAudioSampleRate(UInt16)
VideoPlayer:
- Returns the audio track sampling rate in Hertz. AVPro:
- Returns the unity AudioSettings global sampleRate
Declaration
public uint GetAudioSampleRate(ushort trackIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | trackIndex | index of the audio track to query |
Returns
| Type | Description |
|---|---|
| System.UInt32 | uint> The sampling rate in Hertz. |
GetDirectAudioMute(UInt16)
VideoRecord:
- Gets the direct-output audio mute status for the specified track. AVPro:
- retruns the global mute state, as currently, tracks have no recognition of volume and muted, these are handled globally.
Declaration
public bool GetDirectAudioMute(ushort trackIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | trackIndex | index of the audio track to query |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the selected track is muted; otherwise false |
GetDirectAudioVolume(UInt16)
AVPro:
- retruns the global volume, as currently, tracks have no recognition of volume and muted, these are handled globally.
Declaration
public float GetDirectAudioVolume(ushort trackIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | trackIndex | index of the audio track to query |
Returns
| Type | Description |
|---|---|
| System.Single | float Volume, between 0 and 1. |
GetTargetSource(UInt16)
Declaration
public AudioSource GetTargetSource(ushort trackIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | trackIndex |
Returns
| Type | Description |
|---|---|
| AudioSource |
IsAudioTrackEnabled(UInt16)
Wherther the current track is the active audio track
Declaration
public bool IsAudioTrackEnabled(ushort trackIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | trackIndex | Index of the audio track being queried |
Returns
| Type | Description |
|---|---|
| System.Boolean | bool Returns |
OnDisable()
Declaration
protected override void OnDisable()
Overrides
OnEnable()
Declaration
protected override void OnEnable()
Overrides
OutputModeSet()
Used to check if any of the output modes have been set
Declaration
public bool OutputModeSet()
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Pause()
Pauses Playback
Declaration
public void Pause()
Play()
Plays the media, ensuring the appropriate display components are enabled based on the current renderer mode.
Declaration
public void Play()
Prepare()
Initilises the Media Player, to start beign able to play Will Create the base media player and initilize it
Declaration
public void Prepare()
SetDirectAudioMute(UInt16, Boolean)
- Sets the global direct-output audio mute status
Declaration
public void SetDirectAudioMute(ushort trackIndex, bool mute)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | trackIndex | index of the audio track to query |
| System.Boolean | mute | Mute on/off |
SetDirectAudioVolume(UInt16, Single)
- Set the global direct-output volume
Declaration
public void SetDirectAudioVolume(ushort trackIndex, float volume)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | trackIndex | index of the audio track to query |
| System.Single | volume |
SetOutputModeContextual()
This will set the output mode based on the context.
Declaration
public void SetOutputModeContextual()
SetTargetAudioSource(UInt16, AudioSource)
Sets the AudioSource that will receive audio samples for the specified track if using AudioSource
Declaration
public void SetTargetAudioSource(ushort trackIndex, AudioSource source)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | trackIndex | Index of the audio track to associate with the specified AudioSource. |
| AudioSource | source | AudioSource to associate with the audio track. |
Start()
this will handle setting up the rendering component, based on the object that it is placed on (if it was not generated by a conversion (i which case it will use the same output mode as the one used on the orignal video player))
Declaration
protected override void Start()
Overrides
StepForward()
Advances the current time by one frame immediately
Declaration
public void StepForward()
Stop()
Stops playback and set current playback time to 0
Declaration
public void Stop()
Events
clockResyncOccurred
Declaration
public event VideoPlayer_AVPro.TimeEventHandler clockResyncOccurred
Event Type
| Type | Description |
|---|---|
| VideoPlayer_AVPro.TimeEventHandler |
errorReceived
Declaration
public event VideoPlayer_AVPro.ErrorEventHandler errorReceived
Event Type
| Type | Description |
|---|---|
| VideoPlayer_AVPro.ErrorEventHandler |
frameDropped
Declaration
public event VideoPlayer_AVPro.EventHandler frameDropped
Event Type
| Type | Description |
|---|---|
| VideoPlayer_AVPro.EventHandler |
frameReady
Declaration
public event VideoPlayer_AVPro.FrameReadyEventHandler frameReady
Event Type
| Type | Description |
|---|---|
| VideoPlayer_AVPro.FrameReadyEventHandler |
loopPointReached
Declaration
public event VideoPlayer_AVPro.EventHandler loopPointReached
Event Type
| Type | Description |
|---|---|
| VideoPlayer_AVPro.EventHandler |
prepareCompleted
Declaration
public event VideoPlayer_AVPro.EventHandler prepareCompleted
Event Type
| Type | Description |
|---|---|
| VideoPlayer_AVPro.EventHandler |
seekCompleted
Declaration
public event VideoPlayer_AVPro.EventHandler seekCompleted
Event Type
| Type | Description |
|---|---|
| VideoPlayer_AVPro.EventHandler |
started
Declaration
public event VideoPlayer_AVPro.EventHandler started
Event Type
| Type | Description |
|---|---|
| VideoPlayer_AVPro.EventHandler |