Merge pull request #669 from 3flex/display-item-on-idle
Some checks are pending
Lint / Lint TS and CSS (push) Waiting to run
Publish / Build (push) Waiting to run
Publish / Publish (push) Blocked by required conditions
Publish / Deploy (push) Blocked by required conditions
Test / Jest (push) Waiting to run

Display content only if player is idle
This commit is contained in:
Niels van Velzen 2024-11-04 08:41:55 +01:00 committed by GitHub
commit 1659262114
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -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];