Definition
SetVideoVolume(string videoName, float volume)
Description
This function sets the volume of video videoName to volume.
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.
volume
Specifies the volume of video videoName to be set. This value must be in the range [0.0,1.0].
Example 1
function Init() SetVideoVolume("video1", 0.1) end function Update() end
In this script, we set the volume of video “video1” to 0.1.
Example 2
--Name of script is SetVideoVolume2.lua function Init() SetVideoVolume("this", 0.35) end function Update() end
Assume that the above script named SetVideoVolume2.lua is attached to a video object named “video1”. In this case, string “this” in the SetVideoVolume function will be equal to “video1”. In our example, the function SetVideoVolume sets the volume of current video, which is “video1”, to 0.35.
SetVideoVolume