Client-side Module gmod_playx

Function Summary

BeginMedia(handler, uri, start, resumeSupported, lowFramerate, handlerArgs)
Begins media.
EndMedia()
Stop what's playing.
GetLocalVolume()
Get the local sound volume, which is the PlayX volume combined with this player's individual volume.
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.
GetProjectorTrace()
Get the trace used for the projector.
GetSourcePos()
Returns the center position of the player, not necessarily where the screen is, in the case of non-projectors.
GetVolume()
Get the volume of this individual player.
HasMedia()
Returns true if this instance has media.
IsResumable()
Returns true if this instance has resumable media.
MediaBegan(handler, uri, start, resumeSupported, lowFramerate, handlerArgs)
Called when media has begun.
MediaEnded()
Undocumented.
MetadataReceive(existingMedia, newData)
Overridable function that works the same as the hook.
Play()
Starts playing.
Played()
Called when media has started playing.
ResetRenderBounds()
Reset the render bounds for this player.
SetVolume(volume)
Changes the volume of this player.
Stop()
Stop playing.
Stopped()
Called on stop.
UpdateMetadata(data)
Updates the current media metadata.

Functions

BeginMedia

gmod_playx:BeginMedia(handler, uri, start, resumeSupported, lowFramerate, handlerArgs)

Begins media.

Parameters:

  • handler
  • uri
  • start
  • resumeSupported
  • lowFramerate
  • handlerArgs

EndMedia

gmod_playx:EndMedia()

Stop what's playing.


GetLocalVolume

gmod_playx:GetLocalVolume()

Get the local sound volume, which is the PlayX volume combined with this player's individual volume. Value is 0 to 100.

Return value:

  • Volume

GetProjectedDistance

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 - Position

Return value:

  • Distance

GetProjectionPos

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:

  1. Position
  2. Normal
  3. Boolean indicating whether a screen is showing

GetProjectorTrace

gmod_playx:GetProjectorTrace()

Get the trace used for the projector.

Return value:

  • Trace result

GetSourcePos

gmod_playx:GetSourcePos()

Returns the center position of the player, not necessarily where the screen is, in the case of non-projectors.

Return values:

  1. Position
  2. Normal

GetVolume

gmod_playx:GetVolume()

Get the volume of this individual player. Volume is 0 to 100.

Return value:

  • Volume

HasMedia

gmod_playx:HasMedia()

Returns true if this instance has media.

Return value:

  • Boolean

IsResumable

gmod_playx:IsResumable()

Returns true if this instance has resumable media.

Return value:

  • Boolean

MediaBegan

gmod_playx:MediaBegan(handler, uri, start, resumeSupported, lowFramerate, handlerArgs)

Called when media has begun.

Parameters:

  • handler
  • uri
  • start
  • resumeSupported
  • lowFramerate
  • handlerArgs

MediaEnded

gmod_playx:MediaEnded()

Undocumented.


MetadataReceive

gmod_playx:MetadataReceive(existingMedia, newData)

Overridable function that works the same as the hook.

Parameters:

  • existingMedia - Also accessible as self.Media
  • newData - Incoming data

Return value:

  • Nil or the new data

Play

gmod_playx:Play()

Starts playing. This will only work if the entity has media assigned to it, possibly received from the server.


Played

gmod_playx:Played()

Called when media has started playing.


ResetRenderBounds

gmod_playx:ResetRenderBounds()

Reset the render bounds for this player.


SetVolume

gmod_playx:SetVolume(volume)

Changes the volume of this player. This does not affect the overall PlayX volume, nor will it override it.

Parameters:

  • volume - Volume (0-100) to change to

Stop

gmod_playx:Stop()

Stop playing. The play can be resumed at any time (until EndMedia() is called), but not all media can be resumed.


Stopped

gmod_playx:Stopped()

Called on stop.


UpdateMetadata

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