DefaultSocketApi

class DefaultSocketApi(api: ApiClient, socketReconnectPolicy: SocketReconnectPolicy, socketConnectionFactory: SocketConnectionFactory) : SocketApi

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

See also

Constructors

Link copied to clipboard
constructor(api: ApiClient, socketReconnectPolicy: SocketReconnectPolicy, socketConnectionFactory: SocketConnectionFactory)

Properties

Link copied to clipboard
open override val state: <Error class: unknown class><SocketApiState>

Flow indicating the current status of the WebSocket connection.

Functions

Link copied to clipboard

Notify this SocketApi instance of changes in the parent ApiClient.

Link copied to clipboard
open override fun <T> subscribe(messageType: KClass<T>): <Error class: unknown class><T>

Subscribe to a specific WebSocket message type. Returns a flow that emits each deserialized message of type T.

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
open override fun subscribeAll(): <Error class: unknown class><<Error class: unknown class>>

Subscribe to all incoming WebSocket messages. Returns a flow that emits each deserialized message.

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.