diff --git a/src/components/commandHandler.ts b/src/components/commandHandler.ts index 6c070119..80dad7d2 100644 --- a/src/components/commandHandler.ts +++ b/src/components/commandHandler.ts @@ -83,7 +83,7 @@ export abstract class CommandHandler { } static displayContentHandler(data: DataMessage): void { - if (!PlaybackManager.isPlaying()) { + if (PlaybackManager.isIdle()) { DocumentManager.showItemId((data.options as DisplayRequest).ItemId); } } diff --git a/src/components/playbackManager.ts b/src/components/playbackManager.ts index b0406c9d..0c24e908 100644 --- a/src/components/playbackManager.ts +++ b/src/components/playbackManager.ts @@ -104,6 +104,13 @@ export abstract class PlaybackManager { ); } + static isIdle(): boolean { + return ( + this.playerManager.getPlayerState() === + cast.framework.messages.PlayerState.IDLE + ); + } + static async playFromOptions(options: PlayRequest): Promise { const firstItem = options.items[0];