pex.proto.chromecast.client

Module Contents

class pex.proto.chromecast.client.ChromecastClient(host: str, port: int = 8009)

Bases: object

Subclass of pex.proto.chromecast module.

This subclass of pex.proto.chromecast module represents Python implementation of the Chromecast client.

connect() None

Connect to Chromecast socket.

Return None:

None

disconnect() None

Disconnect from Chromecast socket.

Return None:

None

player_state() dict

Return player state.

Return dict:

player state

Raises:

RuntimeError – with trailing error message

play_media(url: str, format: str = 'video/mp4') None

Play media file from URL.

Parameters:
  • url (str) – URL to video file

  • format (str) – video file format

Return None:

None

Raises:

RuntimeError – with trailing error message

play() None

Tap play.

Return None:

None

Raises:

RuntimeError – with trailing error message

pause() None

Tap pause.

Return None:

None

Raises:

RuntimeError – with trailing error message

youtube_play(id: str) None

Play YouTube video.

Parameters:

id (str) – YouTube video ID

Return None:

None

Raises:

RuntimeError – with trailing error message