Skip to content

Commit

Permalink
Merge pull request #669 from 3flex/display-item-on-idle
Browse files Browse the repository at this point in the history
Display content only if player is idle
  • Loading branch information
nielsvanvelzen authored Nov 4, 2024
2 parents c36bc05 + 6591f61 commit 1659262
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/commandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/components/playbackManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
const firstItem = options.items[0];

Expand Down

0 comments on commit 1659262

Please sign in to comment.