Scripting/Server/Functions/PlayCinema
(v0.5-rc3+) Plays a video on that screen for everybody near it, replacing what played before. url is a web page address (YouTube and every site yt-dlp knows, it needs yt-dlp and for YouTube node or deno next to the server) or a direct video address / file (.mp4, .webm, .m3u8 ...). The SERVER transcodes it with ffmpeg (which ships next to Server.exe / Server) and sends one stream that all players watch live, so everybody sees the same moment. seekSeconds starts later in the video. Returns false when the screen does not exist or the address is not allowed (only letters, digits and : / ? = & . _ ~ + , @ # % -). If the video cannot be opened the reason is in the server log and in cinema_ffmpeg_<id>.log.
Syntax
PlayCinema(id, url[, seekSeconds])Arguments
- int id
- string url –
urlis a web page address (YouTube and every site yt-dlp knows, it needsyt-dlpand for YouTube node or deno next to the server) or a direct video address / file (.mp4,.webm,.m3u8...). - any seekSeconds (optional) –
seekSecondsstarts later in the video.
Returns
bool
Example
function onPlayerCommand( player, cmd, params )
{
if ( cmd == "playcinema" )
{
local result = PlayCinema( 0, "http://example.com/" );
MessagePlayer( "PlayCinema returned: " + result, player );
}
}This sample was generated from the signature – adapt the values to your gamemode.
Related pages
- ToggleRealMoney
- SetTime
- SetTimeLock
- SetTimeScale
- SetWeatherLock
- GetTime
- SetWeather
- SetVirtualWorldTime
- SetVirtualWorldWeather
- SetGamespeed
- SetGravity
- ToggleImprovedCarCam
Section: World settings