ReadonlyautoplayReturns true if autoplay is enabled for this video texture.
ReadonlycurrentReturns the number of played cycles.
ReadonlycurrentReturns the current time in seconds, or zero if accessed during playback being in unprepared state.
ReadonlydurationReturns the duration of playback range in seconds, or zero if accessed while playback is in an unprepared state.
ReadonlyisReturns true if video file has been loaded and is ready for decoding and false otherwise.
ReadonlylastReturns the time of the last acquired texture in seconds, or zero if accessed during playback being in unprepared state.
ReadonlyonThe event for being reported about playback finished. When this event is triggered, lens developers can evict this texture from material slots to avoid disrupting user's experience.
ReadonlyonThe event for being reported about playback start. When this event is triggered, lens developers can set video texture to material slots and see actual video frames.
The playback rate of the video. This value is applied when the video is loaded via VideoTextureProvider.load. To change the playback rate after loading, call VideoTextureProvider.unload first, set the new rate, then call VideoTextureProvider.load again. Defaults to 1.0.
The relative end time of playback in the range [0, 1], where 0 is the beginning and 1 is the end of the video. This value is applied when the video is loaded via VideoTextureProvider.load. To change after loading, call VideoTextureProvider.unload first, set the new value, then call VideoTextureProvider.load again. Defaults to 1.
The relative start time of playback in the range [0, 1], where 0 is the beginning and 1 is the end of the video. This value is applied when the video is loaded via VideoTextureProvider.load. To change after loading, call VideoTextureProvider.unload first, set the new value, then call VideoTextureProvider.load again. Defaults to 0.
ReadonlystatusA read-only property that returns the status of provider. Suggested as a substitution for the existing getStatus()
ReadonlytotalReturns the duration of loaded video file in seconds, or zero if accessed during playback being in unprepared state.
The audio volume of the video resource, normalized from 0 to 1. Can be changed dynamically during playback.
Returns the texture's aspect ratio, which is calculated as width / height.
Returns the height of the texture in pixels.
Returns the name of this object's type.
Returns the width of the texture in pixels.
Returns true if the object matches or derives from the passed in type.
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Loads the video stream and stops on the first frame. Results in the video being in the Stopped state, ready to play. loopOnLoad If true, prepares the video for looped playback. If false, prepares for single playback. This may affect which decoder is used on some platforms.
// Load video and stop on first frame
var videoControl = videoTexture.control;
videoControl.load(false); // Load for single playback
// Wait for video to be ready
videoControl.onPlaybackReady.add(function() {
print("Video ready at first frame, Status=Stopped");
// Now you can play it
videoControl.play(1);
});
// Load video prepared for looping
var videoControl = videoTexture.control;
videoControl.load(true); // Load prepared for looping
videoControl.onPlaybackReady.add(function() {
videoControl.play(-1); // Play infinitely
});
Pauses the video playback.
Plays the video playCount times. If playCount is less than 0, it loops infinitely.
Resumes the video playback.
Sets the current playback time to the specified time in seconds.
Sets callback as the function invoked when the video resource stops playing.
Use VideoTextureProvider.onPlaybackDone instead
Sets callback as the function invoked when the video resource is ready to be played.
Use VideoTextureProvider.onPlaybackReady instead
Stops the video playback and resets position to the beginning. Resources remain loaded. To resume playback, call play() again.
Controls a video texture resource. Can be accessed through Texture.control.
Example