gmod_playx
|
BeginMedia(handler, uri, start, resumeSupported, lowFramerate, handlerArgs, length)
This directly processes media given as a handler. |
|
CloseMedia()
Safe method of ending the media. |
|
GetProjectedDistance(pos)
Gets the closet distance between a point and this instance. |
|
GetProjectionPos()
Gets the projector's screen position, or if it's not a projector, a psuedo projection line endpoint. |
|
GetSourcePos()
Returns the center position of the player, not necessarily where the screen is, in the case of non-projectors. |
|
GetSubscribers()
Gets a list of Player objects. |
|
IsSubscribed(ply)
Returns true if the passed player has subscribed to this instance. |
|
MediaBegan(handler, uri, start, resumeSupported, lowFramerate, handlerArgs, length)
Function for overriding. |
|
MediaBegin(handler, uri, start, resumeSupported, lowFramerate, handlerArgs, length)
Function for overriding. |
|
MediaEnd()
Function for overriding. |
|
MediaEnded()
Function for overriding. |
|
MediaExpire()
Overridable function that is called on media expiration. |
|
MediaOpen(provider, uri, start, forceLowFramerate, useJW, result)
Function for overriding. |
|
MetadataReceive(existingMedia, newData)
Overridable function that works the same as the hook. |
|
OpenMedia(provider, uri, start, forceLowFramerate, useJW)
Plays something as if you had typed it in the tool panel. |
|
RaceProtectionTriggered()
Returns true if race protection is still wearing off. |
|
ShouldAutoSubscribe(ply)
Returns true if the user should be automatically subscribed to the instance. |
|
Subscribe(ply)
Add a user to this player's subscription list. |
|
Unsubscribe(ply)
Remove the user from this player's subscription list. |
|
UpdateMetadata(data)
Updates the current media metadata. |
gmod_playx:BeginMedia(handler, uri, start, resumeSupported, lowFramerate, handlerArgs, length)
This directly processes media given as a handler. Use OpenMedia() if you want provider detection. Use PlayX.ResolveProvider() if you want to do provider detection manually. Remember that if you want metadata later on, you will have to manually supply this entity with it, as BeginMedia() does not do that (OpenMedia() does, but because it polls the provider framework).
Parameters:
handler
uri
start
resumeSupported
lowFramerate
handlerArgs
- Arguments for the handler, can be nillength
- Length of the media in seconds, can be nil
gmod_playx:CloseMedia()
Safe method of ending the media. This can be called even if nothing is being played at the moment.
gmod_playx:GetProjectedDistance(pos)
Gets the closet distance between a point and this instance. This returns the distance to the point projected onto the finite line segment between self:GetSourcePos() and self:GetProjectionPos().
Parameters:
pos
- PositionReturn value:
- Distance
gmod_playx:GetProjectionPos()
Gets the projector's screen position, or if it's not a projector, a psuedo projection line endpoint. If the entity is not a projector then nil will be returned.
Return values:
- Position
- Normal
- Boolean indicating whether a screen is showing
gmod_playx:GetSourcePos()
Returns the center position of the player, not necessarily where the screen is, in the case of non-projectors.
Return values:
- Position
- Normal
gmod_playx:GetSubscribers()
Gets a list of Player objects.
Return value:
- Table of subscribers
gmod_playx:IsSubscribed(ply)
Returns true if the passed player has subscribed to this instance.
Parameters:
ply
Return value:
- Boolean
gmod_playx:MediaBegan(handler, uri, start, resumeSupported, lowFramerate, handlerArgs, length)
Function for overriding. Called after media has begun.
Parameters:
handler
uri
start
resumeSupported
lowFramerate
handlerArgs
- Arguments for the handler, can be nillength
- Length of the media in seconds, can be nil
gmod_playx:MediaBegin(handler, uri, start, resumeSupported, lowFramerate, handlerArgs, length)
Function for overriding. Called after media has begun.
Parameters:
handler
uri
start
resumeSupported
lowFramerate
handlerArgs
- Arguments for the handler, can be nillength
- Length of the media in seconds, can be nilReturn value:
- False to deny
gmod_playx:MediaEnd()
Function for overriding. Called like PlayXMediaEnd after PlayXMediaEnd.
Return value:
- False to deny
gmod_playx:MediaEnded()
Function for overriding. Called after media has ended.
gmod_playx:MediaExpire()
Overridable function that is called on media expiration. See the MediaExpire hook for more information.
gmod_playx:MediaOpen(provider, uri, start, forceLowFramerate, useJW, result)
Function for overriding. Called like the PlayXMediaOpen hook. Overriding this function will not call the hook unless you call BaseClass.
Parameters:
provider
- Name of provider (detected or provided, but it will exist)uri
- 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 trueresult
- Handler informationReturn value:
- False to deny, table to override
gmod_playx:MetadataReceive(existingMedia, newData)
Overridable function that works the same as the hook.
Parameters:
existingMedia
- Also accessible as self.MedianewData
- Incoming dataReturn value:
- Nil or the new data
gmod_playx:OpenMedia(provider, uri, start, forceLowFramerate, useJW)
Plays something as if you had typed it in the tool panel. It will attempt to guess the handler frrom the provided provider and URI. If you've already got a handler to play, look into BeginMedia(). You can manually detect providers using the PlayX.ResolveProvider() API function.
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 values:
- The result generated by a provider or nil
- Error message if error
gmod_playx:RaceProtectionTriggered()
Returns true if race protection is still wearing off. return Boolean
gmod_playx:ShouldAutoSubscribe(ply)
Returns true if the user should be automatically subscribed to the instance. By default this returns true, but you can override the behavior by defining a hook called PlayXShouldAutoSubscribe or by overriding the function on this entity (or derived entity class). You can manually subscribe and unsubscribe users without having this function matching. This function is only called when a PlayX entity is created and when a player joins but it is never called to "check" subscriptions.
Parameters:
ply
Return value:
- False to deny
gmod_playx:Subscribe(ply)
Add a user to this player's subscription list. The user will start seeing the media if something is already playing. If the player is already subscribed, nothing will happen.
Parameters:
ply
Return value:
- False if the player was already subscribed
gmod_playx:Unsubscribe(ply)
Remove the user from this player's subscription list. The media will stop for the player. If the player was not subscribed, then nothing will happen.
Parameters:
ply
Return value:
- False if the player was not subscribed to begin with
gmod_playx:UpdateMetadata(data)
Updates the current media metadata. Calling this while nothing is playing has no effect. This can be called many times and multiple times.
Parameters:
data
- Metadata structure