session_controller = client.session
SessionController
- Add User to Session
- Display Content
- Get Auth Providers
- Get Password Reset Providers
- Get Sessions
- Play
- Post Capabilities
- Post Full Capabilities
- Remove User From Session
- Report Session Ended
- Report Viewing
- Send Full General Command
- Send General Command
- Send Message Command
- Send Playstate Command
- Send System Command
Adds an additional user to a session.
def add_user_to_session(self,
session_id,
user_id)
Parameter | Type | Tags | Description |
---|---|---|---|
session_id |
string |
Template, Required | The session id. |
user_id |
uuid|string |
Template, Required | The user id. |
void
session_id = 'sessionId8'
user_id = '000013ec-0000-0000-0000-000000000000'
result = session_controller.add_user_to_session(session_id, user_id)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Instructs a session to browse to an item or view.
def display_content(self,
session_id,
item_type,
item_id,
item_name)
Parameter | Type | Tags | Description |
---|---|---|---|
session_id |
string |
Template, Required | The session Id. |
item_type |
BaseItemKindEnum |
Query, Required | The type of item to browse to. |
item_id |
string |
Query, Required | The Id of the item. |
item_name |
string |
Query, Required | The name of the item. |
void
session_id = 'sessionId8'
item_type = BaseItemKindEnum.LIVETVPROGRAM
item_id = 'itemId8'
item_name = 'itemName0'
result = session_controller.display_content(session_id, item_type, item_id, item_name)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Get all auth providers.
def get_auth_providers(self)
result = session_controller.get_auth_providers()
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Get all password reset providers.
def get_password_reset_providers(self)
result = session_controller.get_password_reset_providers()
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Gets a list of sessions.
def get_sessions(self,
controllable_by_user_id=None,
device_id=None,
active_within_seconds=None)
Parameter | Type | Tags | Description |
---|---|---|---|
controllable_by_user_id |
uuid|string |
Query, Optional | Filter by sessions that a given user is allowed to remote control. |
device_id |
string |
Query, Optional | Filter by device Id. |
active_within_seconds |
int |
Query, Optional | Optional. Filter by sessions that were active in the last n seconds. |
result = session_controller.get_sessions()
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Instructs a session to play an item.
def play(self,
session_id,
play_command,
item_ids,
start_position_ticks=None,
media_source_id=None,
audio_stream_index=None,
subtitle_stream_index=None,
start_index=None)
Parameter | Type | Tags | Description |
---|---|---|---|
session_id |
string |
Template, Required | The session id. |
play_command |
PlayCommandEnum |
Query, Required | The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet implemented play next and play last may play now. |
item_ids |
List of uuid|string |
Query, Required | The ids of the items to play, comma delimited. |
start_position_ticks |
long|int |
Query, Optional | The starting position of the first item. |
media_source_id |
string |
Query, Optional | Optional. The media source id. |
audio_stream_index |
int |
Query, Optional | Optional. The index of the audio stream to play. |
subtitle_stream_index |
int |
Query, Optional | Optional. The index of the subtitle stream to play. |
start_index |
int |
Query, Optional | Optional. The start index. |
void
session_id = 'sessionId8'
play_command = PlayCommandEnum.PLAYNEXT
item_ids = ['00000f27-0000-0000-0000-000000000000', '00000f28-0000-0000-0000-000000000000']
result = session_controller.play(session_id, play_command, item_ids)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Updates capabilities for a device.
def post_capabilities(self,
id=None,
playable_media_types=None,
supported_commands=None,
supports_media_control=False,
supports_sync=False,
supports_persistent_identifier=True)
Parameter | Type | Tags | Description |
---|---|---|---|
id |
string |
Query, Optional | The session id. |
playable_media_types |
List of string |
Query, Optional | A list of playable media types, comma delimited. Audio, Video, Book, Photo. |
supported_commands |
List of GeneralCommandTypeEnum |
Query, Optional | A list of supported remote control commands, comma delimited. |
supports_media_control |
bool |
Query, Optional | Determines whether media can be played remotely.. Default: False |
supports_sync |
bool |
Query, Optional | Determines whether sync is supported. Default: False |
supports_persistent_identifier |
bool |
Query, Optional | Determines whether the device supports a unique identifier. Default: True |
void
supports_media_control = False
supports_sync = False
supports_persistent_identifier = True
result = session_controller.post_capabilities(None, None, None, supports_media_control, supports_sync, supports_persistent_identifier)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Updates capabilities for a device.
def post_full_capabilities(self,
body,
id=None)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
ClientCapabilitiesDto |
Body, Required | The MediaBrowser.Model.Session.ClientCapabilities. |
id |
string |
Query, Optional | The session id. |
void
body = ClientCapabilitiesDto()
result = session_controller.post_full_capabilities(body)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Removes an additional user from a session.
def remove_user_from_session(self,
session_id,
user_id)
Parameter | Type | Tags | Description |
---|---|---|---|
session_id |
string |
Template, Required | The session id. |
user_id |
uuid|string |
Template, Required | The user id. |
void
session_id = 'sessionId8'
user_id = '000013ec-0000-0000-0000-000000000000'
result = session_controller.remove_user_from_session(session_id, user_id)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Reports that a session has ended.
def report_session_ended(self)
void
result = session_controller.report_session_ended()
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Reports that a session is viewing an item.
def report_viewing(self,
item_id,
session_id=None)
Parameter | Type | Tags | Description |
---|---|---|---|
item_id |
string |
Query, Required | The item id. |
session_id |
string |
Query, Optional | The session id. |
void
item_id = 'itemId8'
result = session_controller.report_viewing(item_id)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Issues a full general command to a client.
def send_full_general_command(self,
session_id,
body)
Parameter | Type | Tags | Description |
---|---|---|---|
session_id |
string |
Template, Required | The session id. |
body |
GeneralCommand |
Body, Required | The MediaBrowser.Model.Session.GeneralCommand. |
void
session_id = 'sessionId8'
body = GeneralCommand()
result = session_controller.send_full_general_command(session_id, body)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Issues a general command to a client.
def send_general_command(self,
session_id,
command)
Parameter | Type | Tags | Description |
---|---|---|---|
session_id |
string |
Template, Required | The session id. |
command |
GeneralCommandTypeEnum |
Template, Required | The command to send. |
void
session_id = 'sessionId8'
command = GeneralCommandTypeEnum.SETVOLUME
result = session_controller.send_general_command(session_id, command)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Issues a command to a client to display a message to the user.
def send_message_command(self,
session_id,
body)
Parameter | Type | Tags | Description |
---|---|---|---|
session_id |
string |
Template, Required | The session id. |
body |
MessageCommand |
Body, Required | The MediaBrowser.Model.Session.MessageCommand object containing Header, Message Text, and TimeoutMs. |
void
session_id = 'sessionId8'
body = MessageCommand()
body.text = 'Text8'
result = session_controller.send_message_command(session_id, body)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Issues a playstate command to a client.
def send_playstate_command(self,
session_id,
command,
seek_position_ticks=None,
controlling_user_id=None)
Parameter | Type | Tags | Description |
---|---|---|---|
session_id |
string |
Template, Required | The session id. |
command |
PlaystateCommandEnum |
Template, Required | The MediaBrowser.Model.Session.PlaystateCommand. |
seek_position_ticks |
long|int |
Query, Optional | The optional position ticks. |
controlling_user_id |
string |
Query, Optional | The optional controlling user id. |
void
session_id = 'sessionId8'
command = PlaystateCommandEnum.FASTFORWARD
result = session_controller.send_playstate_command(session_id, command)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Issues a system command to a client.
def send_system_command(self,
session_id,
command)
Parameter | Type | Tags | Description |
---|---|---|---|
session_id |
string |
Template, Required | The session id. |
command |
GeneralCommandTypeEnum |
Template, Required | The command to send. |
void
session_id = 'sessionId8'
command = GeneralCommandTypeEnum.SETVOLUME
result = session_controller.send_system_command(session_id, command)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |