GetVideoLoop

Definition

bool GetVideoLoop(string videoName)

Description

This function returns the state of the video loop as a Boolean value of 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 name to which this script is attached.

Return Value

If the state of the loop is true, it returns true, otherwise it returns false.

Example 1

video_loop = false

message = ""

function Init()
    video_loop = GetVideoLoop("video1")

    if video_loop then
          message = string.format("\nVideo Loop is ON")
    else
          message = string.format("\nVideo Loop is OFF")
    end

    PrintConsole(message)
end

function Update()

end
First, we specify the loop state of “video1”. Then we display loop status in the console using the PrintConsole function.

Example 2

--Name of script is GetVideoLoop2.lua

video_loop = false
message = ""

function Init()
    video_loop = GetVideoLoop("this")

    if video_loop then
          message = string.format("\nVideo Loop is ON")
    else
          message = string.format("\nVideo Loop is OFF")
    end

    PrintConsole(message)
end

function Update()

end
Assume that the above script named GetVideoLoop2.lua is attached to a video object named “video1”. In this case, string “this”  in the GetVideoLoop function will be equal to “video1”. In our example, the function GetVideoLoop returns the loop state of the video “video1”.
adminGetVideoLoop