Remote player

This class plays video from the network. E.g. a cpl_media.remote.server.RemoteData can be configured to broadcast video from a FFmpeg camera. This client plays the video from the server.

class cpl_media.remote.client.ClientPlayerSettingsWidget(player=None, **kwargs)

Bases: BoxLayout

Settings widget for RemoteVideoPlayer.

player: RemoteVideoPlayer = None

The player.

class cpl_media.remote.client.RemoteVideoPlayer(**kwargs)

Bases: BasePlayer, RemoteData

A player that is a network client that plays images received from a cpl_media.remote.server.RemoteData over the network.

_config_props_: Tuple[str] = ('server', 'port', 'timeout')

A list of configurable property names of the class that is set/read by the configuration API.

Each sub/super-class can define this and the properties are accumulated across all the sub/super-classes.

client_active

Whether the client thread is currently running.

from_kivy_queue = None

The queue that receives messages from Kivy.

listener_run(from_kivy_queue, to_kivy_queue)

Client method, that is executed in the internal client thread.

listener_thread = None

The client thread instance.

play()

Starts playing the video source and sets the play_state to starting.

May be called from main kivy thread only.

May only be called when play_state is none, otherwise an exception is raised.

Players need to eventually call complete_start() to finish starting playing.

play_thread_run()

The method that runs in the internal play thread.

port

The server port that broadcasts the data.

process_in_kivy_thread(*largs)

Processes messages from the client in the kivy thread.

send_message_to_server(key, value)

Sends the message to the server over the network.

Parameters
  • msg – The message name string.

  • value – The message value.

server

The server address that broadcasts the data.

start_listener()

Starts the client, so that we can play().

stop(*largs, join=False)

Stops playing the video source, if it is playing and sets the play_state to stopping.

Players need to eventually call complete_stop() to finish stopping playing.

Parameters

join – whether to block the thread until the internal play thread has exited.

Returns

Whether we stopped playing (True) or were already stop(ping/ed) playing.

stop_all(join=False)

Causes all internal threads to stop and exit.

Parameters

join – Whether to wait and block the calling thread until the internal threads exit.

stop_listener(join=False)

Stops the client and also stops playing if we were playing.

timeout

How long to wait before timing out when reading data before checking the queue for other requests.

to_kivy_queue = None

The queue that sends messages to Kivy.