VideoPlayer
info
VideoPlayer inherits from Behaviour
Plays video content onto a target.
Members
Properties
Name | Description |
---|---|
VideoPlayer .aspectRatio | Defines how the video content will be stretched to fill the target area. |
VideoPlayer .audioOutputMode | Destination for the audio embedded in the video. |
VideoPlayer .audioTrackCount | Number of audio tracks found in the data source currently configured. (Read Only) |
VideoPlayer .canSetDirectAudioVolume | Whether direct-output volume controls are supported for the current platform and video format. (Read Only) |
VideoPlayer .canSetPlaybackSpeed | Whether the playback speed can be changed. (Read Only) |
VideoPlayer .canSetSkipOnDrop | Whether frame-skipping to maintain synchronization can be controlled. (Read Only) |
VideoPlayer .canSetTime | Whether current time can be changed using the time or timeFrames property. (Read Only) |
VideoPlayer .canSetTimeSource | Whether the time source followed by the VideoPlayer can be changed. (Read Only) |
VideoPlayer .canStep | Returns true if the VideoPlayer can step forward through the video content. (Read Only) |
VideoPlayer .clip | The clip being played by the VideoPlayer. |
VideoPlayer .clockResyncOccurred | Invoked when the VideoPlayer clock is synced back to its VideoTimeReference. |
VideoPlayer .clockTime | The clock time that the VideoPlayer follows to schedule its samples. The clock time is expressed in seconds. (Read Only) |
VideoPlayer .controlledAudioTrackCount | Number of audio tracks that this VideoPlayer will take control of. |
VideoPlayer .errorReceived | Errors such as HTTP connection problems are reported through this callback. |
VideoPlayer .externalReferenceTime | Reference time of the external clock the VideoPlayer uses to correct its drift. |
VideoPlayer .frameCount | Number of frames in the current video content. (Read Only) |
VideoPlayer .frameRate | The frame rate of the clip or URL in frames/second. (Read Only) |
VideoPlayer .frameReady | Invoked when a new frame is ready. |
VideoPlayer .height | The height of the images in the VideoClip, or URL, in pixels. (Read Only) |
VideoPlayer .isLooping | Determines whether the VideoPlayer restarts from the beginning when it reaches the end of the clip. |
VideoPlayer .isPaused | Whether playback is paused. (Read Only) |
VideoPlayer .isPlaying | Whether content is being played. (Read Only) |
VideoPlayer .isPrepared | Whether the VideoPlayer has successfully prepared the content to be played. (Read Only) |
VideoPlayer .length | The length of the VideoClip, or the URL, in seconds. (Read Only) |
VideoPlayer .loopPointReached | Invoked when the VideoPlayer reaches the end of the content to play. |
VideoPlayer .pixelAspectRatioDenominator | Denominator of the pixel aspect ratio (num:den) for the VideoClip or the URL. (Read Only) |
VideoPlayer .pixelAspectRatioNumerator | Numerator of the pixel aspect ratio (num:den) for the VideoClip or the URL. (Read Only) |
VideoPlayer .playbackSpeed | Factor by which the basic playback rate will be multiplied. |
VideoPlayer .playOnAwake | Whether the content will start playing back as soon as the component awakes. |
VideoPlayer .prepareCompleted | Invoked when the VideoPlayer preparation is complete. |
VideoPlayer .renderMode | Where the video content will be drawn. |
VideoPlayer .seekCompleted | Invoke after a seek operation completes. |
VideoPlayer .sendFrameReadyEvents | Enables the frameReady events. |
VideoPlayer .skipOnDrop | Whether the VideoPlayer is allowed to skip frames to catch up with current time. |
VideoPlayer .source | The source that the VideoPlayer uses for playback. |
VideoPlayer .started | Invoked immediately after Play is called. |
VideoPlayer .targetMaterialProperty | Material texture property which is targeted when VideoPlayer.renderMode is set to Video.VideoTarget.MaterialOverride. |
VideoPlayer .targetMaterialRenderer | Renderer which is targeted when VideoPlayer.renderMode is set to Video.VideoTarget.MaterialOverride |
VideoPlayer .texture | Internal texture in which video content is placed. (Read Only) |
VideoPlayer .time | The presentation time of the currently available frame in VideoPlayer.texture. |
VideoPlayer .timeReference | The clock that the VideoPlayer observes to detect and correct drift. |
VideoPlayer .timeSource | The source used used by the VideoPlayer to derive its current time. |
VideoPlayer .url | The file or HTTP URL that the VideoPlayer reads content from. |
VideoPlayer .waitForFirstFrame | Determines whether the VideoPlayer will wait for the first frame to be loaded into the texture before starting playback when VideoPlayer.playOnAwake is on. |
VideoPlayer .width | The width of the images in the VideoClip, or URL, in pixels. (Read Only) |
Static Properties
Name | Description |
---|---|
VideoPlayer .controlledAudioTrackMaxCount | Maximum number of audio tracks that can be controlled. (Read Only) |
Methods
Name | Description |
---|---|
VideoPlayer .EnableAudioTrack(trackIndex, enabled) | Enable/disable audio track decoding. Only effective when the VideoPlayer is not currently playing. |
VideoPlayer .GetAudioChannelCount(trackIndex) | The number of audio channels in the specified audio track. |
VideoPlayer .GetAudioLanguageCode(trackIndex) | Returns the language code, if any, for the specified track. |
VideoPlayer .GetAudioSampleRate(trackIndex) | Gets the audio track sampling rate in Hertz. |
VideoPlayer .GetDirectAudioMute(trackIndex) | Gets the direct-output audio mute status for the specified track. |
VideoPlayer .GetDirectAudioVolume(trackIndex) | Return the direct-output volume for specified track. |
VideoPlayer .GetTargetAudioSource(trackIndex) | Gets the AudioSource that will receive audio samples for the specified track if VideoPlayer.audioOutputMode is set to VideoAudioOutputMode.AudioSource. |
VideoPlayer .IsAudioTrackEnabled(trackIndex) | Whether decoding for the specified audio track is enabled. See VideoPlayer.EnableAudioTrack for distinction with mute. |
VideoPlayer .Pause() | Pauses the playback and leaves the current time intact. |
VideoPlayer .Play() | Starts playback. |
VideoPlayer .Prepare() | Initiates playback engine preparation. |
VideoPlayer .SetDirectAudioMute(trackIndex, mute) | Set the direct-output audio mute status for the specified track. |
VideoPlayer .SetDirectAudioVolume(trackIndex, volume) | Set the direct-output audio volume for the specified track. |
VideoPlayer .SetTargetAudioSource(trackIndex, source) | Sets the AudioSource that will receive audio samples for the specified track if this audio target is selected with VideoPlayer.audioOutputMode. |
VideoPlayer .StepForward() | Advances the current time by one frame immediately. |
VideoPlayer .Stop() | Stops the playback and sets the current time to 0. |
Inherited Members
Inherited Properties
Name | Description |
---|---|
VideoPlayer .enabled | Enabled Behaviours are Updated, disabled Behaviours are not. |
VideoPlayer .isActiveAndEnabled | Has the Behaviour had active and enabled called? |
VideoPlayer .gameObject | The game object this component is attached to. A component is always attached to a game object. |
VideoPlayer .tag | The tag of this game object. |
VideoPlayer .transform | The Transform attached to this GameObject. |
VideoPlayer .hideFlags | Should the object be hidden, saved with the Scene or modifiable by the user? |
VideoPlayer .name | The name of the object. |
Inherited Methods
Name | Description |
---|---|
VideoPlayer .BroadcastMessage(methodName, parameter=nil) | Calls the method named methodName on every Lua Script in this game object or any of its children. |
VideoPlayer .CompareTag(tag) | Is this game object tagged with tag ? |
VideoPlayer .GetAllLuaScripts() | Returns an array of all Lua scripts that attached to the game object. |
VideoPlayer .GetComponent(type) | Returns the component of Type type if the game object has one attached, nil if it doesn't. |
VideoPlayer .GetComponentInChildren(t) | Returns the component of Type type in the GameObject or any of its children using depth first search. |
VideoPlayer .GetComponentInParent(t) | Returns the component of Type type in the GameObject or any of its parents. |
VideoPlayer .GetComponents(type) | Returns all components of Type type in the GameObject. |
VideoPlayer .GetComponentsInChildren(t) | Returns all components of Type type in the GameObject or any of its children. |
VideoPlayer .GetComponentsInParent(t) | Returns all components of Type type in the GameObject or any of its parents. |
VideoPlayer .SendMessage(methodName, value=nil) | Calls the method named methodName on every Lua Script in this game object. |
VideoPlayer .SendMessageUpwards(methodName, value=nil) | Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour. |
VideoPlayer .TryGetComponent(type) | Gets the component of the specified type, if it exists. |
VideoPlayer .GetInstanceID() | Returns the instance id of the object. |
Extra Detail
Content can be either a VideoClip imported asset or a URL such as file:// or http://. Video content will be projected onto one of the supported targets, such as camera background or RenderTexture. If the video content includes transparency, this transparency will be present in the target, allowing objects behind the video target to be visible. When the data VideoPlayer.source is set to URL, the audio and video description of what is being played will only be initialized once the VideoPlayer preparation is completed. You can test this with VideoPlayer.isPrepared.