@raydiant/playlist-window-manager 0.29.1 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/IFrameRenderer.d.ts +1 -0
- package/build/IFrameRenderer.js +14 -0
- package/build/IFrameRenderer.test.d.ts +1 -0
- package/build/IFrameRenderer.test.js +70 -0
- package/build/PlaylistWindowManager.d.ts +7 -0
- package/build/PlaylistWindowManager.js +186 -65
- package/build/PlaylistWindowManager.test.d.ts +1 -0
- package/build/PlaylistWindowManager.test.js +1763 -0
- package/build/PresentationWindow.d.ts +37 -1
- package/build/PresentationWindow.js +601 -31
- package/build/PresentationWindow.test.js +509 -0
- package/build/SurfaceBroker.d.ts +30 -0
- package/build/SurfaceBroker.js +311 -0
- package/build/SurfaceBroker.test.d.ts +1 -0
- package/build/SurfaceBroker.test.js +432 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/surfaces.d.ts +52 -0
- package/build/surfaces.js +15 -0
- package/build/testUtils.d.ts +56 -0
- package/build/testUtils.js +327 -5
- package/build/types.d.ts +1 -0
- package/package.json +2 -1
- package/src/IFrameRenderer.test.ts +88 -0
- package/src/IFrameRenderer.ts +21 -0
- package/src/PlaylistWindowManager.test.ts +1466 -0
- package/src/PlaylistWindowManager.ts +164 -20
- package/src/PresentationWindow.test.ts +371 -0
- package/src/PresentationWindow.ts +712 -4
- package/src/SurfaceBroker.test.ts +278 -0
- package/src/SurfaceBroker.ts +281 -0
- package/src/__snapshots__/PlaylistWindowManager.test.ts.snap +26 -0
- package/src/index.ts +1 -0
- package/src/surfaces.ts +82 -0
- package/src/testUtils.ts +335 -1
- package/src/types.ts +5 -0
|
@@ -2,6 +2,7 @@ import * as RE from '@raydiant/playlist-rule-engine';
|
|
|
2
2
|
import PlaylistWindowManagerState from './PlaylistWindowManagerState';
|
|
3
3
|
import PlaylistWindowManager from './PlaylistWindowManager';
|
|
4
4
|
import { Presentation, ApplicationVersion, Theme, Device, PresentationWindowRenderer, WindowBounds, Logger, BuilderState, WorkerState, AnalyticsEvent, Charge, ChargeRequest, ChargeResponse, Terminal } from './types';
|
|
5
|
+
import SurfaceBroker from './SurfaceBroker';
|
|
5
6
|
export interface PresentationWindowOptions {
|
|
6
7
|
windowManager?: PlaylistWindowManager;
|
|
7
8
|
windowId: string;
|
|
@@ -34,6 +35,8 @@ export interface PresentationWindowOptions {
|
|
|
34
35
|
}) => void;
|
|
35
36
|
getTerminal?: () => Terminal | null;
|
|
36
37
|
getOnlineStatus?: () => boolean;
|
|
38
|
+
surfaceBroker?: SurfaceBroker;
|
|
39
|
+
surfaceShowDeadlineMs?: number;
|
|
37
40
|
}
|
|
38
41
|
export default class PresentationWindow {
|
|
39
42
|
private options;
|
|
@@ -54,6 +57,8 @@ export default class PresentationWindow {
|
|
|
54
57
|
private disableInterruptLockCallback;
|
|
55
58
|
private analyticsEventCallback;
|
|
56
59
|
private chargeRequestCallback;
|
|
60
|
+
private didPaintSinceLastPlay;
|
|
61
|
+
private firstPaintResolvers;
|
|
57
62
|
private builderState;
|
|
58
63
|
private presentation;
|
|
59
64
|
private playlistWindowManagerState;
|
|
@@ -71,9 +76,19 @@ export default class PresentationWindow {
|
|
|
71
76
|
private createObjectURLTimeouts;
|
|
72
77
|
private interruptLocks;
|
|
73
78
|
private previouslyLocked;
|
|
79
|
+
private surface;
|
|
80
|
+
private surfaceWithdrawn;
|
|
81
|
+
private surfaceShow;
|
|
82
|
+
private wakeSurfaceShow;
|
|
83
|
+
private holeOpenWaiter;
|
|
84
|
+
private playingWaiter;
|
|
85
|
+
private isPlayHeld;
|
|
86
|
+
private isRemoved;
|
|
87
|
+
private frameBackground;
|
|
74
88
|
constructor(options: PresentationWindowOptions);
|
|
75
89
|
load(): Promise<void>;
|
|
76
|
-
show(isFocused?: boolean): void
|
|
90
|
+
show(isFocused?: boolean, onReveal?: () => void, showAfterRevealMs?: number): Promise<void>;
|
|
91
|
+
private showFrame;
|
|
77
92
|
hide(): void;
|
|
78
93
|
remove(): Promise<void>;
|
|
79
94
|
reinitializePresentationWindowRuleEngineState(newRulesDataStoreObj: RE.RulesDataStore): void;
|
|
@@ -81,6 +96,13 @@ export default class PresentationWindow {
|
|
|
81
96
|
pause(): void;
|
|
82
97
|
resume(): void;
|
|
83
98
|
reset(): void;
|
|
99
|
+
waitForFirstPaint(timeoutMs: number): Promise<void>;
|
|
100
|
+
detachCallbacks(): void;
|
|
101
|
+
mute(): void;
|
|
102
|
+
wasRemoved(): boolean;
|
|
103
|
+
holdsSurface(): boolean;
|
|
104
|
+
muteSurfaceOrFrame(): void;
|
|
105
|
+
private resolveFirstPaintWaiters;
|
|
84
106
|
onComplete(callback: (() => void) | null): void;
|
|
85
107
|
onError(callback: ((err: Error) => void) | null): void;
|
|
86
108
|
onEnableInterruptLock(callback: (() => void) | null): void;
|
|
@@ -124,6 +146,20 @@ export default class PresentationWindow {
|
|
|
124
146
|
private getEmbeddedAppUrl;
|
|
125
147
|
private handleEmbeddedMessage;
|
|
126
148
|
private handleLegacyMessage;
|
|
149
|
+
private handleOpenVideo;
|
|
150
|
+
private handleVideoBounds;
|
|
151
|
+
private handleSurfaceEvent;
|
|
152
|
+
private isSurfaceReady;
|
|
153
|
+
private isOfferedVideoUrl;
|
|
154
|
+
private showSurface;
|
|
155
|
+
private showSurfaceAfterReveal;
|
|
156
|
+
private revealOverHole;
|
|
157
|
+
private withdrawSurface;
|
|
158
|
+
private dropSurface;
|
|
159
|
+
private wakeSurfaceShowWaiters;
|
|
160
|
+
private releaseHeldPlay;
|
|
161
|
+
private refuseVideo;
|
|
162
|
+
private sendVideoMessage;
|
|
127
163
|
private handleReady;
|
|
128
164
|
private handleComplete;
|
|
129
165
|
private handleError;
|