SetVideoLoop

Definition

SetVideoLoop(string videoName, bool loop)

Description

This function sets the loop state of the video videoName to true or false.

Parameters

videoName
Specifies the video name. You can also use the name “this” for this parameter. In this case, “this” string refers to the name of the video to which this script is attached.

loop
Specifies the state of the video loop. Accepted values are true or false.

Example 1

function Init()
    SetVideoLoop("video1"true)
    PlayVideo("video1")
end

function Update()

end
First, we set the loop status of “video1” to true. Then we play “video1”. Since the loop status of video “video1” is true, this video will be played continuously.

Example 2

--Name of script is SetVideoLoop2.lua

function Init()
    SetVideoLoop("this"false)
    PlayVideo("this")
end

function Update()

end
Assume that the above script named SetVideoLoop2.lua is attached to a video object named “video1”. In this case, string “this”  in the SetVideoLoop function will be equal to “video1”.
In our example, we set the loop state of current video, which is “video1”, to false. Then we play current video, which is “video1”. Since the loop status of current video is false, this video will only be played once.
adminSetVideoLoop