Plex_Client_Controller_Playback
class Plex_Client_Controller_Playback extends Plex_Client_ControllerAbstract
Represents a Plex client on the network.
Constants
| DEFAULT_PORT |
The default port on which a Plex client listens. |
| TYPE_NAVIGATION |
String representing the navigation controller type. |
| TYPE_PLAYBACK |
String representing the playback controller type. |
| TYPE_APPLICATION |
String representing the application controller type. |
Properties
| protected string | $name | The name of the Plex machine on the network. | from Plex_MachineAbstract |
| protected string | $address | The IP address of the Plex machine on the network. | from Plex_MachineAbstract |
| protected integer | $port | The port on which the Plex machine is listening. Typically 32400 for servers and 3000 for clients. | from Plex_MachineAbstract |
| protected string | $token | The token of the Plex machine on the network. | from Plex_MachineAbstract |
Methods
Returns the base URL, which will be standard for all requests made to the Plex machine.
Typically the useful data returned by a Plex machine will containted in XML attributes. This allows a set of XML nodes to be passed and all the attribues extracted and returned as an associated array.
Utilizes php-curl to send a request to the passed URL and returns an XML document reprentation of the returned content.
Universal function so any method belonging to a child class of a Plex machine can discover which function called it. This is used mainly for some of our polymorphic requests as the calling function can tell us what type of item is being requested.
Sets up our Plex client using the minimum amount of data required to interact.
Returns the navigation controller.
Returns the playback controller.
Returns the application controller.
Sets the mac address of the Plex client.
Returns the version of the Plex software the Plex client is running.
Sets the version of the Plex software the Plex client is running.
Using the calling class and function builds and calls the URL for the Plex client controller command.
Static factory method for instantiating and returning a child controller class.
Executes the play command.
Executes the pause command.
Executes the stop command.
Executes the rewind command.
Executes the fast forward command.
Executes the step forward command.
Executes the big step forward command.
Executes the step back command.
Executes the big step back command.
Executes the skip next command.
Executes the skip previous command.
Details
in Plex_MachineAbstract at line 78
protected string
getBaseUrl()
Returns the base URL, which will be standard for all requests made to the Plex machine.
in Plex_MachineAbstract at line 102
protected array
xmlAttributesToArray(SimpleXMLElement $xml, integer $pass = 0)
Typically the useful data returned by a Plex machine will containted in XML attributes. This allows a set of XML nodes to be passed and all the attribues extracted and returned as an associated array.
in Plex_MachineAbstract at line 149
protected array
makeCall(string $url)
Utilizes php-curl to send a request to the passed URL and returns an XML document reprentation of the returned content.
in Plex_MachineAbstract at line 196
protected string
getCallingFunction(integer $depth = 2)
Universal function so any method belonging to a child class of a Plex machine can discover which function called it. This is used mainly for some of our polymorphic requests as the calling function can tell us what type of item is being requested.
in Plex_Client at line 90
void
__construct(string $name, string $address, integer $port, string $token)
Sets up our Plex client using the minimum amount of data required to interact.
in Plex_Client at line 131
Plex_Client_Controller_Navigation
getNavigationController()
Returns the navigation controller.
in Plex_Client at line 146
Plex_Client_Controller_Playback
getPlaybackController()
Returns the playback controller.
in Plex_Client at line 161
Plex_Client_Controller_Application
getApplicationController()
Returns the application controller.
in Plex_Client at line 175
string
getName()
Returns the Plex client's name.
in Plex_Client at line 187
string
getAddress()
Returns the Plex client's IP address.
in Plex_Client at line 199
integer
getPort()
Returns the port on which the Plex client listens.
in Plex_Client at line 209
string
getToken()
Returns the token on which the Plex machine listens.
in Plex_Client at line 221
string
getHost()
Returns the hostname of the Plex client.
in Plex_Client at line 235
void
setHost(string $host)
Sets the hostname of the Plex client.
in Plex_Client at line 247
string
getMachineIdentifier()
Returns the mac address of the Plex client.
in Plex_Client at line 261
void
setMachineIdentifier(string $machineIdentifier)
Sets the mac address of the Plex client.
in Plex_Client at line 274
string
getVersion()
Returns the version of the Plex software the Plex client is running.
in Plex_Client at line 289
void
setVersion(string $version)
Sets the version of the Plex software the Plex client is running.
in Plex_Client at line 301
protected Plex_Server
getServer()
Returns the server that registered the client.
in Plex_Client at line 315
void
setServer(Plex_Server $server)
Sets the server that registered the client.
in Plex_Client_ControllerAbstract at line 96
protected void
executeCommand(array $params = array())
Using the calling class and function builds and calls the URL for the Plex client controller command.
in Plex_Client_ControllerAbstract at line 126
static Plex_Client_ControllerAbstract
factory(string $type, string $name, string $address, integer $port, string $token, Plex_Server $server)
Static factory method for instantiating and returning a child controller class.
at line 51
void
play()
Executes the play command.
at line 63
void
pause()
Executes the pause command.
at line 75
void
stop()
Executes the stop command.
at line 87
void
rewind()
Executes the rewind command.
at line 99
void
fastForward()
Executes the fast forward command.
at line 111
void
stepForward()
Executes the step forward command.
at line 123
void
bigStepForward()
Executes the big step forward command.
at line 135
void
stepBack()
Executes the step back command.
at line 147
void
bigStepBack()
Executes the big step back command.
at line 159
void
skipNext()
Executes the skip next command.
at line 171
void
skipPrevious()
Executes the skip previous command.