PlayX
static |
AddBookmark(title, provider, uri, keyword, startAt, lowFramerate)
Adds a new bookmark. |
static |
Debug(msg, ...)
Prints debugging messages. |
static |
Disable()
Disables the player. |
static |
Enable()
Enables the player. |
static |
GetBookmark(title)
Get a bookmark by title. |
static |
GetBookmarkByKeyword(keyword)
Get a bookmark by keyword. |
static |
GetCounts()
Returns counts of instances having media, having resumable media, and are playing. |
static |
GetHandler(handler)
Gets a handler by name. |
static |
GetInstance(ply)
Gets the player instance entity. |
static |
GetInstances()
Gets a list of instances. |
static |
GetVolume()
Gets the overall volume. |
static |
HasValidHostURL()
Checks whether the host URL is valid. |
static |
LoadBookmarks()
Load bookmarks from file. |
static |
OpenBookmarksWindow(selectTitle)
Opens the bookmark management window. |
static |
OpenSpawnDialog(forRepeater)
Opens the dialog for choosing a model to spawn the player with. |
static |
OpenUpdateWindow(ver)
Opens the update window. |
static |
PlayerExists()
Checks whether a player is spawned. |
static |
RequestCloseMedia()
Puts in a request to close media. |
static |
RequestOpenMedia(provider, uri, start, forceLowFramerate, useJW)
Puts in a request to open media. |
static |
ResetRenderBounds()
Reset the render bounds of the project screen. |
static |
ResumePlay()
Resume playing if it is not already playing. |
static |
SaveBookmarks()
Write bookmarks to file. |
static |
SetVolume(vol)
Sets the overall volume. |
static |
ShowError(err)
Shows an error message. |
static |
ShowHint(msg)
Shows a hint. |
static |
ShowNotice()
Show the first play notice. |
static |
StopPlay()
Hides the player and stops it. |
static |
UpdatePanels()
Updates the tool panels. |
PlayX.AddBookmark(title, provider, uri, keyword, startAt, lowFramerate)
Adds a new bookmark. All fields are required.
Parameters:
title
- How the bookmark is identifiedprovider
- String or blank stringuri
keyword
- Blank string for no keywordstartAt
- Can be a time string ("3:22")lowFramerate
- BooleanReturn values:
- True for success, false otherwise
- Error message if error
PlayX.Debug(msg, ...)
Prints debugging messages. The cvar playx_debug must be enabled for the debug messages to show.
Parameters:
msg
- Message...
- Vars for sprintf
PlayX.Disable()
Disables the player.
PlayX.Enable()
Enables the player.
PlayX.GetBookmark(title)
Get a bookmark by title.
Parameters:
title
Return value:
- Bookmark object or nil
PlayX.GetBookmarkByKeyword(keyword)
Get a bookmark by keyword.
Parameters:
keyword
Return value:
- Bookmark object or nil
PlayX.GetCounts()
Returns counts of instances having media, having resumable media, and are playing.
Return values:
- Number of players that have media
- Number of players that are resumable
- Number of players that are playing
PlayX.GetHandler(handler)
Gets a handler by name. May return nil if the handler doesn't exist.
Parameters:
handler
- Handler nameReturn value:
- Handler function or nil
PlayX.GetInstance(ply)
Gets the player instance entity. When there are multiple instances out, the behavior is undefined. A hook named PlayXSelectInstance can be defined to return a specific entity. This function may return nil.
Parameters:
ply
- Player that can be passed to specify a userReturn value:
- Entity or nil
PlayX.GetInstances()
Gets a list of instances.
Return value:
- List of entities
PlayX.GetVolume()
Gets the overall volume. This is the overall volume of all players. The value will be between 0 and 100. @return
PlayX.HasValidHostURL()
Checks whether the host URL is valid.
Return value:
- Whether the host URL is valid
PlayX.LoadBookmarks()
Load bookmarks from file.
PlayX.OpenBookmarksWindow(selectTitle)
Opens the bookmark management window. A bookmark title can be provided so that the bookmark is automatically selected when the window is opened.
Parameters:
selectTitle
- Optional bookmark title to select.
PlayX.OpenSpawnDialog(forRepeater)
Opens the dialog for choosing a model to spawn the player with.
Parameters:
forRepeater
PlayX.OpenUpdateWindow(ver)
Opens the update window.
Parameters:
ver
PlayX.PlayerExists()
Checks whether a player is spawned. @return
PlayX.RequestCloseMedia()
Puts in a request to close media. A request will be sent to the server for processing.
PlayX.RequestOpenMedia(provider, uri, start, forceLowFramerate, useJW)
Puts in a request to open media. A request will be sent to the server for processing.
Parameters:
provider
- Name of provider, leave blank to auto-detecturi
- URI to playstart
- Time to start the video at, in secondsforceLowFramerate
- Force the client side players to play at 1 FPSuseJW
- True to allow the use of the JW player, false for otherwise, nil to default trueReturn value:
- The result generated by a provider, or nil and the error message
PlayX.ResetRenderBounds()
Reset the render bounds of the project screen.
PlayX.ResumePlay()
Resume playing if it is not already playing.
PlayX.SaveBookmarks()
Write bookmarks to file.
PlayX.SetVolume(vol)
Sets the overall volume. This is the overall volume of all players. The value is between 0 and 100. @return
Parameters:
vol
PlayX.ShowError(err)
Shows an error message. It will be shown in a popup if it is enabled or if hints do not exist in this gamemode.
Parameters:
err
PlayX.ShowHint(msg)
Shows a hint. This only works on sandbox gamemodes and gamemodes that implement GAMEMODE.AddNotify. If AddNotify is not available, the message will not be shown anywhere.
Parameters:
msg
PlayX.ShowNotice()
Show the first play notice. This will only show anything if hints exist in the gameode.
PlayX.StopPlay()
Hides the player and stops it.
PlayX.UpdatePanels()
Updates the tool panels. This calls the PlayXUpdateUI hook with no arguments and with no regards to the returned value.