Interface PlayerEvents

      interface PlayerEvents {
          disconnected: ((code, reason, byRemote) => void);
          trackEnd: ((track, reason) => void);
          trackException: ((track, exception) => void);
          trackStart: ((track) => void);
          trackStuck: ((track, thresholdMs) => void);
          updated: (() => void);
      }

      Properties

      disconnected: ((code, reason, byRemote) => void)

      Type declaration

        • (code, reason, byRemote): void
        • Parameters

          • code: number
          • reason: string
          • byRemote: boolean

          Returns void

      trackEnd: ((track, reason) => void)

      Type declaration

        • (track, reason): void
        • Parameters

          • track: {
                encoded: string;
                info: {
                    artworkUrl: string;
                    author: string;
                    identifier: string;
                    isSeekable: boolean;
                    isStream: boolean;
                    isrc: string;
                    length: number;
                    position: number;
                    sourceName: string;
                    title: string;
                    uri: string;
                };
                pluginInfo: {
                    [x: string]: unknown;
                };
                userData: {
                    [x: string]: unknown;
                };
            }
            • Readonly encoded: string
            • Readonly info: {
                  artworkUrl: string;
                  author: string;
                  identifier: string;
                  isSeekable: boolean;
                  isStream: boolean;
                  isrc: string;
                  length: number;
                  position: number;
                  sourceName: string;
                  title: string;
                  uri: string;
              }
              • Readonly artworkUrl: string
              • Readonly author: string
              • Readonly identifier: string
              • Readonly isSeekable: boolean
              • Readonly isStream: boolean
              • Readonly isrc: string
              • Readonly length: number
              • Readonly position: number
              • Readonly sourceName: string
              • Readonly title: string
              • Readonly uri: string
            • Readonly pluginInfo: {
                  [x: string]: unknown;
              }
              • [x: string]: unknown
            • Readonly userData: {
                  [x: string]: unknown;
              }
              • [x: string]: unknown
          • reason: "finished" | "loadFailed" | "stopped" | "replaced" | "cleanup"

          Returns void

      trackException: ((track, exception) => void)

      Type declaration

        • (track, exception): void
        • Parameters

          • track: {
                encoded: string;
                info: {
                    artworkUrl: string;
                    author: string;
                    identifier: string;
                    isSeekable: boolean;
                    isStream: boolean;
                    isrc: string;
                    length: number;
                    position: number;
                    sourceName: string;
                    title: string;
                    uri: string;
                };
                pluginInfo: {
                    [x: string]: unknown;
                };
                userData: {
                    [x: string]: unknown;
                };
            }
            • Readonly encoded: string
            • Readonly info: {
                  artworkUrl: string;
                  author: string;
                  identifier: string;
                  isSeekable: boolean;
                  isStream: boolean;
                  isrc: string;
                  length: number;
                  position: number;
                  sourceName: string;
                  title: string;
                  uri: string;
              }
              • Readonly artworkUrl: string
              • Readonly author: string
              • Readonly identifier: string
              • Readonly isSeekable: boolean
              • Readonly isStream: boolean
              • Readonly isrc: string
              • Readonly length: number
              • Readonly position: number
              • Readonly sourceName: string
              • Readonly title: string
              • Readonly uri: string
            • Readonly pluginInfo: {
                  [x: string]: unknown;
              }
              • [x: string]: unknown
            • Readonly userData: {
                  [x: string]: unknown;
              }
              • [x: string]: unknown
          • exception: {
                cause: string;
                message: string;
                severity: "common" | "suspicious" | "fault";
            }
            • Readonly cause: string
            • Readonly message: string
            • Readonly severity: "common" | "suspicious" | "fault"

          Returns void

      trackStart: ((track) => void)

      Type declaration

        • (track): void
        • Parameters

          • track: {
                encoded: string;
                info: {
                    artworkUrl: string;
                    author: string;
                    identifier: string;
                    isSeekable: boolean;
                    isStream: boolean;
                    isrc: string;
                    length: number;
                    position: number;
                    sourceName: string;
                    title: string;
                    uri: string;
                };
                pluginInfo: {
                    [x: string]: unknown;
                };
                userData: {
                    [x: string]: unknown;
                };
            }
            • Readonly encoded: string
            • Readonly info: {
                  artworkUrl: string;
                  author: string;
                  identifier: string;
                  isSeekable: boolean;
                  isStream: boolean;
                  isrc: string;
                  length: number;
                  position: number;
                  sourceName: string;
                  title: string;
                  uri: string;
              }
              • Readonly artworkUrl: string
              • Readonly author: string
              • Readonly identifier: string
              • Readonly isSeekable: boolean
              • Readonly isStream: boolean
              • Readonly isrc: string
              • Readonly length: number
              • Readonly position: number
              • Readonly sourceName: string
              • Readonly title: string
              • Readonly uri: string
            • Readonly pluginInfo: {
                  [x: string]: unknown;
              }
              • [x: string]: unknown
            • Readonly userData: {
                  [x: string]: unknown;
              }
              • [x: string]: unknown

          Returns void

      trackStuck: ((track, thresholdMs) => void)

      Type declaration

        • (track, thresholdMs): void
        • Parameters

          • track: {
                encoded: string;
                info: {
                    artworkUrl: string;
                    author: string;
                    identifier: string;
                    isSeekable: boolean;
                    isStream: boolean;
                    isrc: string;
                    length: number;
                    position: number;
                    sourceName: string;
                    title: string;
                    uri: string;
                };
                pluginInfo: {
                    [x: string]: unknown;
                };
                userData: {
                    [x: string]: unknown;
                };
            }
            • Readonly encoded: string
            • Readonly info: {
                  artworkUrl: string;
                  author: string;
                  identifier: string;
                  isSeekable: boolean;
                  isStream: boolean;
                  isrc: string;
                  length: number;
                  position: number;
                  sourceName: string;
                  title: string;
                  uri: string;
              }
              • Readonly artworkUrl: string
              • Readonly author: string
              • Readonly identifier: string
              • Readonly isSeekable: boolean
              • Readonly isStream: boolean
              • Readonly isrc: string
              • Readonly length: number
              • Readonly position: number
              • Readonly sourceName: string
              • Readonly title: string
              • Readonly uri: string
            • Readonly pluginInfo: {
                  [x: string]: unknown;
              }
              • [x: string]: unknown
            • Readonly userData: {
                  [x: string]: unknown;
              }
              • [x: string]: unknown
          • thresholdMs: number

          Returns void

      updated: (() => void)

      Type declaration

        • (): void
        • Returns void