MCPcopy Create free account
hub / github.com/Monogatari/Monogatari / shouldProceed

Method shouldProceed

src/actions/Video.ts:29–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27 }
28
29 static override async shouldProceed(): Promise<void> {
30 if (Video.blocking) {
31 throw new Error('Video is still playing');
32 }
33
34 return new Promise((resolve, reject) => {
35 $_('[data-video]').each((element: HTMLElement) => {
36 const videoElement = element as HTMLVideoElement;
37 if (videoElement.ended !== true && videoElement.dataset.mode !== 'background' && videoElement.dataset.mode !== 'displayable') {
38 reject('Playing video must end before proceeding.');
39 }
40 });
41
42 resolve();
43 });
44 }
45
46 static override async onLoad(): Promise<void> {
47 const state = this.engine.state('videos');

Callers

nothing calls this directly

Calls 1

eachMethod · 0.65

Tested by

no test coverage detected