@media-quest/builder 0.0.13 → 0.0.15

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.
@@ -1,113 +0,0 @@
1
- import { DState, BooleanStateProperty } from "@media-quest/engine";
2
-
3
- export namespace DStateProps {
4
- export const mediaBlockedBySequence = new BooleanStateProperty(
5
- "media-blocked-by-autoplay-sequence",
6
- false,
7
- "Should be true if the page is in a autoplay-sequence. The autoplay-sequence will always block other media.",
8
- );
9
- export const inputBlockingBySequence = new BooleanStateProperty("input-blocked-by-autoplay-sequence", false, "");
10
- export const mediaBlockedByAudio = new BooleanStateProperty("media-blocked-by-audio", false, "");
11
- export const inputBlockedByAudio = new BooleanStateProperty("input-blocked-by-audio", false, "");
12
- export const mediaBlockedByVideo = new BooleanStateProperty("media-blocked-by-video", false, "");
13
- export const inputBlockedByVideo = new BooleanStateProperty(
14
- "input-blocked-by-video",
15
- false,
16
- "Should be true if a video is playing, and this video is suppose to block user-input.",
17
- );
18
- export const userPausedVideo = new BooleanStateProperty(
19
- "user-paused-video",
20
- false,
21
- "Should be true if user paused the video by pressing the pause-button.",
22
- );
23
- export const videoIsPlaying = new BooleanStateProperty(
24
- "video-is-playing",
25
- false,
26
- "Should be true if any video is playing on the page.",
27
- );
28
- export const audioIsPlaying = new BooleanStateProperty(
29
- "audio-is-playing",
30
- false,
31
- "Should be tru if any audio is playing on page",
32
- );
33
- const _props = {
34
- inputBlockedByAudio,
35
- mediaBlockedByAudio,
36
- inputBlockingBySequence,
37
- mediaBlockedBySequence,
38
- inputBlockedByVideo,
39
- mediaBlockedByVideo,
40
- userPausedVideo,
41
- videoIsPlaying,
42
- };
43
-
44
- const disableAudioIconQuery: DState.StateQuery = {
45
- name: "disable-Audio",
46
- condition: {
47
- kind: "complex-condition",
48
- name: "audio-controls-are-blocked",
49
- some: [
50
- mediaBlockedBySequence.getIsTrueCondition(),
51
- mediaBlockedByAudio.getIsTrueCondition(),
52
- mediaBlockedByVideo.getIsTrueCondition(),
53
- ],
54
- all: [],
55
- },
56
- };
57
- const hideVideoPlayQuery: DState.StateQuery = {
58
- name: "hide-video-play-button",
59
- condition: {
60
- kind: "complex-condition",
61
- name: "video-is-playing-condition",
62
- all: [videoIsPlaying.getIsTrueCondition()],
63
- some: [],
64
- },
65
- };
66
-
67
- const hideVideoPauseQuery: DState.StateQuery = {
68
- name: "hide-video-pause-button",
69
- condition: {
70
- kind: "complex-condition",
71
- name: "video-is-not-playing-condition",
72
- all: [videoIsPlaying.getIsFalseCondition()],
73
- some: [],
74
- },
75
- };
76
-
77
- const disableVideoPlayQuery: DState.StateQuery = {
78
- name: "disable-video",
79
- condition: {
80
- kind: "complex-condition",
81
- name: "video-play shall be disabled",
82
- all: [userPausedVideo.getIsFalseCondition()],
83
- some: [
84
- mediaBlockedBySequence.getIsTrueCondition(),
85
- mediaBlockedByAudio.getIsTrueCondition(),
86
- mediaBlockedByVideo.getIsTrueCondition(),
87
- audioIsPlaying.getIsTrueCondition(),
88
- ],
89
- },
90
- };
91
- const disableUserInputQuery: DState.StateQuery = {
92
- name: "disable-user-input",
93
- condition: {
94
- kind: "complex-condition",
95
- name: "User input shall be disabled (Response-buttons, FormControls...)",
96
- all: [],
97
- some: [
98
- inputBlockedByAudio.getIsTrueCondition(),
99
- inputBlockedByVideo.getIsTrueCondition(),
100
- inputBlockingBySequence.getIsTrueCondition(),
101
- ],
102
- },
103
- };
104
- export const _Queries = {
105
- disableAudioIconQuery,
106
- disableVideoPlayQuery,
107
- disableUserInputQuery,
108
- hideVideoPauseQuery,
109
- hideVideoPlayQuery,
110
- };
111
- export const allDefaultProperties = Object.values(_props);
112
- export const allDefaultQueries = Object.values(_Queries);
113
- }