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

Method revert

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

Source from the content-addressed store, hash-verified

270 }
271
272 override async revert(): Promise<void> {
273 const element = this.engine.element().find(`[data-video="${this.name}"][data-mode="${this.mode}"]`).get(0) as HTMLVideoElement | undefined;
274 if (element) {
275 // Exit fullscreen if we're in fullscreen mode
276 if (this.mode === 'fullscreen' && document.fullscreenElement) {
277 await document.exitFullscreen().catch(() => {
278 // Ignore errors when exiting fullscreen
279 });
280 }
281 Video.cleanupVideoElement(element);
282 element.remove();
283 }
284
285 // Unblock if this was a blocking video
286 if (this.mode === 'immersive' || this.mode === 'fullscreen' || this.mode === 'modal') {
287 Video.blocking = false;
288 }
289 }
290
291 override async didRevert(): Promise<ActionRevertResult> {
292 let foundState = false;

Callers

nothing calls this directly

Calls 4

cleanupVideoElementMethod · 0.80
getMethod · 0.65
removeMethod · 0.65
elementMethod · 0.45

Tested by

no test coverage detected