playstate_controller = client.playstate
PlaystateController
- Mark Played Item
- Mark Unplayed Item
- On Playback Progress
- On Playback Start
- On Playback Stopped
- Ping Playback Session
- Report Playback Progress
- Report Playback Start
- Report Playback Stopped
Marks an item as played for user.
def mark_played_item(self,
user_id,
item_id,
date_played=None)
Parameter | Type | Tags | Description |
---|---|---|---|
user_id |
uuid|string |
Template, Required | User id. |
item_id |
uuid|string |
Template, Required | Item id. |
date_played |
datetime |
Query, Optional | Optional. The date the item was played. |
user_id = '000013ec-0000-0000-0000-000000000000'
item_id = '0000130e-0000-0000-0000-000000000000'
result = playstate_controller.mark_played_item(user_id, item_id)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Marks an item as unplayed for user.
def mark_unplayed_item(self,
user_id,
item_id)
Parameter | Type | Tags | Description |
---|---|---|---|
user_id |
uuid|string |
Template, Required | User id. |
item_id |
uuid|string |
Template, Required | Item id. |
user_id = '000013ec-0000-0000-0000-000000000000'
item_id = '0000130e-0000-0000-0000-000000000000'
result = playstate_controller.mark_unplayed_item(user_id, item_id)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Reports a user's playback progress.
def on_playback_progress(self,
user_id,
item_id,
media_source_id=None,
position_ticks=None,
audio_stream_index=None,
subtitle_stream_index=None,
volume_level=None,
play_method=None,
live_stream_id=None,
play_session_id=None,
repeat_mode=None,
is_paused=False,
is_muted=False)
Parameter | Type | Tags | Description |
---|---|---|---|
user_id |
uuid|string |
Template, Required | User id. |
item_id |
uuid|string |
Template, Required | Item id. |
media_source_id |
string |
Query, Optional | The id of the MediaSource. |
position_ticks |
long|int |
Query, Optional | Optional. The current position, in ticks. 1 tick = 10000 ms. |
audio_stream_index |
int |
Query, Optional | The audio stream index. |
subtitle_stream_index |
int |
Query, Optional | The subtitle stream index. |
volume_level |
int |
Query, Optional | Scale of 0-100. |
play_method |
PlayMethodEnum |
Query, Optional | The play method. |
live_stream_id |
string |
Query, Optional | The live stream id. |
play_session_id |
string |
Query, Optional | The play session id. |
repeat_mode |
RepeatModeEnum |
Query, Optional | The repeat mode. |
is_paused |
bool |
Query, Optional | Indicates if the player is paused. Default: False |
is_muted |
bool |
Query, Optional | Indicates if the player is muted. Default: False |
void
user_id = '000013ec-0000-0000-0000-000000000000'
item_id = '0000130e-0000-0000-0000-000000000000'
is_paused = False
is_muted = False
result = playstate_controller.on_playback_progress(user_id, item_id, None, None, None, None, None, None, None, None, None, is_paused, is_muted)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Reports that a user has begun playing an item.
def on_playback_start(self,
user_id,
item_id,
media_source_id=None,
audio_stream_index=None,
subtitle_stream_index=None,
play_method=None,
live_stream_id=None,
play_session_id=None,
can_seek=False)
Parameter | Type | Tags | Description |
---|---|---|---|
user_id |
uuid|string |
Template, Required | User id. |
item_id |
uuid|string |
Template, Required | Item id. |
media_source_id |
string |
Query, Optional | The id of the MediaSource. |
audio_stream_index |
int |
Query, Optional | The audio stream index. |
subtitle_stream_index |
int |
Query, Optional | The subtitle stream index. |
play_method |
PlayMethodEnum |
Query, Optional | The play method. |
live_stream_id |
string |
Query, Optional | The live stream id. |
play_session_id |
string |
Query, Optional | The play session id. |
can_seek |
bool |
Query, Optional | Indicates if the client can seek. Default: False |
void
user_id = '000013ec-0000-0000-0000-000000000000'
item_id = '0000130e-0000-0000-0000-000000000000'
can_seek = False
result = playstate_controller.on_playback_start(user_id, item_id, None, None, None, None, None, None, can_seek)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Reports that a user has stopped playing an item.
def on_playback_stopped(self,
user_id,
item_id,
media_source_id=None,
next_media_type=None,
position_ticks=None,
live_stream_id=None,
play_session_id=None)
Parameter | Type | Tags | Description |
---|---|---|---|
user_id |
uuid|string |
Template, Required | User id. |
item_id |
uuid|string |
Template, Required | Item id. |
media_source_id |
string |
Query, Optional | The id of the MediaSource. |
next_media_type |
string |
Query, Optional | The next media type that will play. |
position_ticks |
long|int |
Query, Optional | Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms. |
live_stream_id |
string |
Query, Optional | The live stream id. |
play_session_id |
string |
Query, Optional | The play session id. |
void
user_id = '000013ec-0000-0000-0000-000000000000'
item_id = '0000130e-0000-0000-0000-000000000000'
result = playstate_controller.on_playback_stopped(user_id, item_id)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Pings a playback session.
def ping_playback_session(self,
play_session_id)
Parameter | Type | Tags | Description |
---|---|---|---|
play_session_id |
string |
Query, Required | Playback session id. |
void
play_session_id = 'playSessionId2'
result = playstate_controller.ping_playback_session(play_session_id)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Reports playback progress within a session.
def report_playback_progress(self,
body=None)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
PlaybackProgressInfo |
Body, Optional | The playback progress info. |
void
result = playstate_controller.report_playback_progress()
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Reports playback has started within a session.
def report_playback_start(self,
body=None)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
PlaybackStartInfo |
Body, Optional | The playback start info. |
void
result = playstate_controller.report_playback_start()
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Reports playback has stopped within a session.
def report_playback_stopped(self,
body=None)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
PlaybackStopInfo |
Body, Optional | The playback stop info. |
void
result = playstate_controller.report_playback_stopped()
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |