Package-level declarations

Types

Link copied to clipboard
class DefaultSocketApi(api: ApiClient, socketReconnectPolicy: SocketReconnectPolicy, socketConnectionFactory: SocketConnectionFactory) : SocketApi

Implementation of the Jellyfin WebSocket API. Each instance of this class maintains its own connection.

Link copied to clipboard
interface SocketApi

The SocketApi maintains a WebSocket connection to the current server specified in its parent ApiClient. Each ApiClient has one SocketApi instance. Updating the server URL, device info, client info or access token using the update function will automatically propagate and reconnect the WebSocket.

Link copied to clipboard
sealed class SocketApiState

The current connection state of the SocketAPI. This is always Disconnected when there are no active subscriptions.

Link copied to clipboard

Reusable WebSocket connection. Constructed using SocketConnectionFactory.

Link copied to clipboard

The factory to create a SocketConnection.

Link copied to clipboard

Possible states for a SocketConnection. This will start out as Disconnected with no error set and switch to Connecting when attempting to initialize a session. The Message state means that the socket is connected.

Link copied to clipboard

The SocketReconnectPolicy describes the behavior for reconnecting WebSockets when there are active subscriptions. It will be notified about specific events and asked for a delay when the socket is disconnected but still has active subscriptions.

Functions

Link copied to clipboard
inline fun <T : ERROR CLASS: Symbol not found for OutboundWebSocketMessage> SocketApi.subscribe(): ERROR CLASS: Symbol not found for Flow<T>

Subscribe to a specific WebSocket message type.

Link copied to clipboard
inline fun SocketApi.subscribeGeneralCommand(command: ERROR CLASS: Symbol not found for GeneralCommandType): ERROR CLASS: Symbol not found for Flow<ERROR CLASS: Symbol not found for GeneralCommandMessage>

Subscribe to a specific GeneralCommandType message.

Link copied to clipboard
inline fun SocketApi.subscribeGeneralCommands(commands: Set<ERROR CLASS: Symbol not found for GeneralCommandType> = GeneralCommandType.values().toSet()): ERROR CLASS: Symbol not found for Flow<ERROR CLASS: Symbol not found for GeneralCommandMessage>

Subscribe to specific GeneralCommandType messages.

Link copied to clipboard
inline fun SocketApi.subscribePlayStateCommand(command: ERROR CLASS: Symbol not found for PlaystateCommand): ERROR CLASS: Symbol not found for Flow<ERROR CLASS: Symbol not found for PlaystateMessage>

Subscribe to a specific PlaystateCommand message.

Link copied to clipboard
inline fun SocketApi.subscribePlayStateCommands(commands: Set<ERROR CLASS: Symbol not found for PlaystateCommand> = PlaystateCommand.values().toSet()): ERROR CLASS: Symbol not found for Flow<ERROR CLASS: Symbol not found for PlaystateMessage>

Subscribe to specific PlaystateCommand messages.

Link copied to clipboard
inline fun SocketApi.subscribeSyncPlayCommand(command: ERROR CLASS: Symbol not found for SendCommandType): ERROR CLASS: Symbol not found for Flow<ERROR CLASS: Symbol not found for SyncPlayCommandMessage>

Subscribe to a specific SendCommandType message.

Link copied to clipboard
inline fun SocketApi.subscribeSyncPlayCommands(commands: Set<ERROR CLASS: Symbol not found for SendCommandType> = SendCommandType.values().toSet()): ERROR CLASS: Symbol not found for Flow<ERROR CLASS: Symbol not found for SyncPlayCommandMessage>

Subscribe to specific SendCommandType messages.