indexFunctions
Function: showVideo()
> showVideo(alias, videoUrl?, options?): Promise<VideoSprite>
Defined in: src/canvas/functions/video-utility.ts:69
Add and show a video in the canvas. This function is a combination of addVideo.
Parameters
alias
string
The unique alias of the video. You can use this alias to refer to this video
videoUrl?
string
The url of the video.
options?
The options of the video.
Returns
Promise<VideoSprite>
A promise that is resolved when the video is loaded.
Throws
when videoUrl is not provided and alias is not registered in the asset cache.
Example
let video1 = showVideo("video1", "https://pixijs.com/assets/video1.mp4")
Assets.add({ alias: "video2", src: "https://pixijs.com/assets/video2.png" })
let video2 = showVideo("video2")