2025-02-13 11:21:49 -06:00
|
|
|
export enum Opcode {
|
|
|
|
None = 0,
|
|
|
|
Play = 1,
|
|
|
|
Pause = 2,
|
|
|
|
Resume = 3,
|
|
|
|
Stop = 4,
|
|
|
|
Seek = 5,
|
|
|
|
PlaybackUpdate = 6,
|
|
|
|
VolumeUpdate = 7,
|
|
|
|
SetVolume = 8,
|
|
|
|
PlaybackError = 9,
|
|
|
|
SetSpeed = 10,
|
|
|
|
Version = 11,
|
|
|
|
Ping = 12,
|
|
|
|
Pong = 13
|
|
|
|
};
|
|
|
|
|
2023-06-20 08:45:01 +02:00
|
|
|
export class PlayMessage {
|
|
|
|
constructor(
|
2024-01-04 12:38:39 +01:00
|
|
|
public container: string,
|
|
|
|
public url: string = null,
|
|
|
|
public content: string = null,
|
2023-12-07 16:10:18 +01:00
|
|
|
public time: number = null,
|
2024-01-04 12:38:39 +01:00
|
|
|
public speed: number = null,
|
|
|
|
public headers: { [key: string]: string } = null
|
2023-06-20 08:45:01 +02:00
|
|
|
) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SeekMessage {
|
|
|
|
constructor(
|
|
|
|
public time: number,
|
|
|
|
) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class PlaybackUpdateMessage {
|
|
|
|
constructor(
|
2023-12-06 11:50:26 +01:00
|
|
|
public generationTime: number,
|
2023-06-20 08:45:01 +02:00
|
|
|
public time: number,
|
2023-12-06 11:50:26 +01:00
|
|
|
public duration: number,
|
2023-12-07 16:10:18 +01:00
|
|
|
public state: number,
|
|
|
|
public speed: number
|
|
|
|
) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class PlaybackErrorMessage {
|
|
|
|
constructor(
|
2024-01-04 12:38:39 +01:00
|
|
|
public message: string
|
2023-06-20 08:45:01 +02:00
|
|
|
) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class VolumeUpdateMessage {
|
|
|
|
constructor(
|
2023-12-06 11:50:26 +01:00
|
|
|
public generationTime: number,
|
2023-06-20 08:45:01 +02:00
|
|
|
public volume: number
|
|
|
|
) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SetVolumeMessage {
|
|
|
|
constructor(
|
|
|
|
public volume: number,
|
|
|
|
) {}
|
2023-12-07 16:10:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export class SetSpeedMessage {
|
|
|
|
constructor(
|
|
|
|
public speed: number,
|
|
|
|
) {}
|
2023-12-07 16:56:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export class VersionMessage {
|
|
|
|
constructor(
|
|
|
|
public version: number,
|
|
|
|
) {}
|
2024-12-09 00:56:55 -06:00
|
|
|
}
|