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
class OkHttpSocketConnection(clientOptions: HttpClientOptions, scope: CoroutineScope) : SocketConnection
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> SocketApi.subscribe(): <Error class: unknown class><T>

Subscribe to a specific WebSocket message type.

Link copied to clipboard
inline fun SocketApi.subscribeGeneralCommand(command: <Error class: unknown class>): <Error class: unknown class><<Error class: unknown class>>

Subscribe to a specific GeneralCommandType message.

Link copied to clipboard
inline fun SocketApi.subscribeGeneralCommands(commands: Set<<Error class: unknown class>> = GeneralCommandType.values().toSet()): <Error class: unknown class><<Error class: unknown class>>

Subscribe to specific GeneralCommandType messages.

Link copied to clipboard
inline fun SocketApi.subscribePlayStateCommand(command: <Error class: unknown class>): <Error class: unknown class><<Error class: unknown class>>

Subscribe to a specific PlaystateCommand message.

Link copied to clipboard
inline fun SocketApi.subscribePlayStateCommands(commands: Set<<Error class: unknown class>> = PlaystateCommand.values().toSet()): <Error class: unknown class><<Error class: unknown class>>

Subscribe to specific PlaystateCommand messages.

Link copied to clipboard
inline fun SocketApi.subscribeSyncPlayCommand(command: <Error class: unknown class>): <Error class: unknown class><<Error class: unknown class>>

Subscribe to a specific SendCommandType message.

Link copied to clipboard
inline fun SocketApi.subscribeSyncPlayCommands(commands: Set<<Error class: unknown class>> = SendCommandType.values().toSet()): <Error class: unknown class><<Error class: unknown class>>

Subscribe to specific SendCommandType messages.