@gcorevideo/player 2.24.14 → 2.25.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.
Files changed (40) hide show
  1. package/assets/clips/clips.ejs +1 -1
  2. package/assets/clips/clips.scss +7 -5
  3. package/assets/media-control/width370.scss +3 -5
  4. package/dist/core.js +1 -1
  5. package/dist/index.css +870 -871
  6. package/dist/index.embed.js +171 -100
  7. package/dist/index.js +150 -78
  8. package/dist/player.d.ts +106 -42
  9. package/docs/api/player.md +18 -20
  10. package/docs/api/player.mediacontrol.defaultsettings.md +32 -0
  11. package/docs/api/player.mediacontrol.extendsettings.md +77 -0
  12. package/docs/api/player.mediacontrol.md +31 -11
  13. package/docs/api/player.mediacontrol.mount.md +8 -8
  14. package/docs/api/player.mediacontrol.slot.md +97 -0
  15. package/docs/api/player.mediacontrolelement.md +6 -3
  16. package/docs/api/player.mediacontrolpluginsettings.md +13 -0
  17. package/docs/api/player.mediacontrolsettings.md +5 -5
  18. package/docs/api/{player.mediacontrol.enablecontrolbutton.md → player.mediacontrolslotmountpoint.md} +4 -8
  19. package/docs/api/{player.mediacontrol.disabledcontrolbutton.md → player.standardmediacontrolelement.md} +4 -8
  20. package/lib/plugins/clips/Clips.d.ts +1 -0
  21. package/lib/plugins/clips/Clips.d.ts.map +1 -1
  22. package/lib/plugins/clips/Clips.js +16 -2
  23. package/lib/plugins/dvr-controls/DvrControls.js +1 -1
  24. package/lib/plugins/media-control/MediaControl.d.ts +87 -34
  25. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  26. package/lib/plugins/media-control/MediaControl.js +121 -76
  27. package/package.json +1 -1
  28. package/src/plugins/clips/Clips.ts +17 -2
  29. package/src/plugins/clips/__tests__/Clips.test.ts +1 -1
  30. package/src/plugins/clips/__tests__/__snapshots__/Clips.test.ts.snap +1 -1
  31. package/src/plugins/dvr-controls/DvrControls.ts +1 -1
  32. package/src/plugins/dvr-controls/__tests__/DvrControls.test.ts +1 -1
  33. package/src/plugins/media-control/MediaControl.ts +170 -141
  34. package/src/plugins/media-control/__tests__/MediaControl.test.ts +24 -17
  35. package/src/plugins/media-control/__tests__/__snapshots__/MediaControl.test.ts.snap +125 -93
  36. package/temp/player.api.json +186 -108
  37. package/tsconfig.tsbuildinfo +1 -1
  38. package/docs/api/player.mediacontrollayerelement.md +0 -16
  39. package/docs/api/player.mediacontrolleftelement.md +0 -16
  40. package/docs/api/player.mediacontrolrightelement.md +0 -16
@@ -204,7 +204,7 @@ Description
204
204
 
205
205
  </td><td>
206
206
 
207
- **_(BETA)_** `PLUGIN` that provides basic playback controls UI and a foundation for developing custom UI.
207
+ **_(BETA)_** `PLUGIN` that provides framework for building media control UI.
208
208
 
209
209
 
210
210
  </td></tr>
@@ -869,51 +869,38 @@ An ISO 639-1 language code.
869
869
 
870
870
  </td><td>
871
871
 
872
- **_(BETA)_** Built-in media control elements.
872
+ **_(BETA)_** Media control element. Each element's token in the media control layout settings determines where the element is rendered.
873
873
 
874
874
 
875
875
  </td></tr>
876
876
  <tr><td>
877
877
 
878
- [MediaControlLayerElement](./player.mediacontrollayerelement.md)
878
+ [MediaControlPluginSettings](./player.mediacontrolpluginsettings.md)
879
879
 
880
880
 
881
881
  </td><td>
882
882
 
883
- **_(BETA)_** Media control elements that appear in main layer, spanning the entire width of the player.
884
-
885
883
 
886
884
  </td></tr>
887
885
  <tr><td>
888
886
 
889
- [MediaControlLeftElement](./player.mediacontrolleftelement.md)
887
+ [MediaControlSettings](./player.mediacontrolsettings.md)
890
888
 
891
889
 
892
890
  </td><td>
893
891
 
894
- **_(BETA)_** Media control elements that appear in the left area.
892
+ **_(BETA)_** Specifies the layout of media control elements. Actual elements will be rendered according to the playback settings. Custom elements rendered by the plugins will be mounted at the specified locations.
895
893
 
896
894
 
897
895
  </td></tr>
898
896
  <tr><td>
899
897
 
900
- [MediaControlRightElement](./player.mediacontrolrightelement.md)
898
+ [MediaControlSlotMountPoint](./player.mediacontrolslotmountpoint.md)
901
899
 
902
900
 
903
901
  </td><td>
904
902
 
905
- **_(BETA)_** Media control elements that appear in the right area.
906
-
907
-
908
- </td></tr>
909
- <tr><td>
910
-
911
- [MediaControlSettings](./player.mediacontrolsettings.md)
912
-
913
-
914
- </td><td>
915
-
916
- **_(BETA)_** Specifies the allowed media control elements in each area. Can be used to restrict rendered media control elements.
903
+ **_(BETA)_** Identifies a location for mounting custom media control elements.
917
904
 
918
905
 
919
906
  </td></tr>
@@ -1064,6 +1051,17 @@ A media source to fetch the media data from
1064
1051
  **_(BETA)_** Configuration options for the SeekTime plugin.
1065
1052
 
1066
1053
 
1054
+ </td></tr>
1055
+ <tr><td>
1056
+
1057
+ [StandardMediaControlElement](./player.standardmediacontrolelement.md)
1058
+
1059
+
1060
+ </td><td>
1061
+
1062
+ **_(BETA)_** Built-in media control elements.
1063
+
1064
+
1067
1065
  </td></tr>
1068
1066
  <tr><td>
1069
1067
 
@@ -0,0 +1,32 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@gcorevideo/player](./player.md) &gt; [MediaControl](./player.mediacontrol.md) &gt; [defaultSettings](./player.mediacontrol.defaultsettings.md)
4
+
5
+ ## MediaControl.defaultSettings() method
6
+
7
+ > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
+ >
9
+
10
+ **Signature:**
11
+
12
+ ```typescript
13
+ static defaultSettings(): any;
14
+ ```
15
+ **Returns:**
16
+
17
+ any
18
+
19
+ Default media control layout settings The method can be used to change the default dashboard layout, for example, removing the standard UI elements
20
+
21
+ ## Example
22
+
23
+
24
+ ```ts
25
+ const settings = MediaControl.defaultSettings()
26
+ settings.left = settings.filter(item => item !== 'playpause' && item !== 'playstop')
27
+ ...
28
+ new Player({
29
+ mediaControl: settings,
30
+ })
31
+ ```
32
+
@@ -0,0 +1,77 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@gcorevideo/player](./player.md) &gt; [MediaControl](./player.mediacontrol.md) &gt; [extendSettings](./player.mediacontrol.extendsettings.md)
4
+
5
+ ## MediaControl.extendSettings() method
6
+
7
+ > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
+ >
9
+
10
+ Extend the default media control layout settings
11
+
12
+ **Signature:**
13
+
14
+ ```typescript
15
+ static extendSettings(settings: Partial<MediaControlSettings>): {
16
+ left: string[];
17
+ right: string[];
18
+ default: string[];
19
+ };
20
+ ```
21
+
22
+ ## Parameters
23
+
24
+ <table><thead><tr><th>
25
+
26
+ Parameter
27
+
28
+
29
+ </th><th>
30
+
31
+ Type
32
+
33
+
34
+ </th><th>
35
+
36
+ Description
37
+
38
+
39
+ </th></tr></thead>
40
+ <tbody><tr><td>
41
+
42
+ settings
43
+
44
+
45
+ </td><td>
46
+
47
+ Partial&lt;[MediaControlSettings](./player.mediacontrolsettings.md)<!-- -->&gt;
48
+
49
+
50
+ </td><td>
51
+
52
+ Additional settings
53
+
54
+
55
+ </td></tr>
56
+ </tbody></table>
57
+ **Returns:**
58
+
59
+ { left: string\[\]; right: string\[\]; default: string\[\]; }
60
+
61
+ The extended settings
62
+
63
+ ## Remarks
64
+
65
+ This method allows adding custom elements to the media control dashboard. The default settings are not modified.
66
+
67
+ ## Example
68
+
69
+
70
+ ```ts
71
+ new Player({
72
+ mediaControl: MediaControl.extendSettings({
73
+ left: ['*'], // add all custom elements to the left panel
74
+ }),
75
+ })
76
+ ```
77
+
@@ -7,7 +7,7 @@
7
7
  > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
8
  >
9
9
 
10
- `PLUGIN` that provides basic playback controls UI and a foundation for developing custom UI.
10
+ `PLUGIN` that provides framework for building media control UI.
11
11
 
12
12
  **Signature:**
13
13
 
@@ -20,13 +20,15 @@ export declare class MediaControl extends UICorePlugin
20
20
 
21
21
  The methods exposed are to be used by the other plugins that extend the media control UI.
22
22
 
23
- Configuration options:
23
+ Configuration options (root level)
24
24
 
25
- - `mediaControl`<!-- -->: [MediaControlSettings](./player.mediacontrolsettings.md) - specifies the allowed media control elements in each area
25
+ - `hideMediaControlDelay`<!-- -->: number - specifies the delay in milliseconds before the media control UI is hidden after the last user interaction
26
+
27
+ - `mediaControl`<!-- -->: [MediaControlSettings](./player.mediacontrolsettings.md) - specifies the media control dashboard layout
26
28
 
27
29
  - `persistConfig`<!-- -->: boolean - `common` option, makes the plugin persist the media control settings
28
30
 
29
- - `chromeless`<!-- -->: boolean
31
+ - `chromeless`<!-- -->: boolean - `common` option, hides the media control UI
30
32
 
31
33
  ## Constructors
32
34
 
@@ -170,21 +172,23 @@ Description
170
172
  </th></tr></thead>
171
173
  <tbody><tr><td>
172
174
 
173
- [disable()](./player.mediacontrol.disable.md)
175
+ [defaultSettings()](./player.mediacontrol.defaultsettings.md)
174
176
 
175
177
 
176
178
  </td><td>
177
179
 
180
+ `static`
181
+
178
182
 
179
183
  </td><td>
180
184
 
181
- **_(BETA)_** Hides the media control UI
185
+ **_(BETA)_**
182
186
 
183
187
 
184
188
  </td></tr>
185
189
  <tr><td>
186
190
 
187
- [disabledControlButton()](./player.mediacontrol.disabledcontrolbutton.md)
191
+ [disable()](./player.mediacontrol.disable.md)
188
192
 
189
193
 
190
194
  </td><td>
@@ -192,7 +196,7 @@ Description
192
196
 
193
197
  </td><td>
194
198
 
195
- **_(BETA)_** Disable the user interaction for the control buttons
199
+ **_(BETA)_** Hides the media control UI
196
200
 
197
201
 
198
202
  </td></tr>
@@ -212,15 +216,17 @@ Description
212
216
  </td></tr>
213
217
  <tr><td>
214
218
 
215
- [enableControlButton()](./player.mediacontrol.enablecontrolbutton.md)
219
+ [extendSettings(settings)](./player.mediacontrol.extendsettings.md)
216
220
 
217
221
 
218
222
  </td><td>
219
223
 
224
+ `static`
225
+
220
226
 
221
227
  </td><td>
222
228
 
223
- **_(BETA)_** Enable the user interaction disabled earlier
229
+ **_(BETA)_** Extend the default media control layout settings
224
230
 
225
231
 
226
232
  </td></tr>
@@ -248,7 +254,7 @@ Description
248
254
 
249
255
  </td><td>
250
256
 
251
- **_(BETA)_** Get a media control element DOM node
257
+ **_(BETA)_** Mounts a media control element at a specific location
252
258
 
253
259
 
254
260
  </td></tr>
@@ -279,6 +285,20 @@ Description
279
285
  **_(BETA)_** Set the volume
280
286
 
281
287
 
288
+ </td></tr>
289
+ <tr><td>
290
+
291
+ [slot(name, element)](./player.mediacontrol.slot.md)
292
+
293
+
294
+ </td><td>
295
+
296
+
297
+ </td><td>
298
+
299
+ **_(BETA)_** Mount a media control to its configured location
300
+
301
+
282
302
  </td></tr>
283
303
  <tr><td>
284
304
 
@@ -7,12 +7,12 @@
7
7
  > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
8
  >
9
9
 
10
- Get a media control element DOM node
10
+ Mounts a media control element at a specific location
11
11
 
12
12
  **Signature:**
13
13
 
14
14
  ```typescript
15
- mount(name: MediaControlElement, element: ZeptoResult): void;
15
+ mount(name: MediaControlSlotMountPoint, element: ZeptoResult): void;
16
16
  ```
17
17
 
18
18
  ## Parameters
@@ -40,12 +40,12 @@ name
40
40
 
41
41
  </td><td>
42
42
 
43
- [MediaControlElement](./player.mediacontrolelement.md)
43
+ [MediaControlSlotMountPoint](./player.mediacontrolslotmountpoint.md)
44
44
 
45
45
 
46
46
  </td><td>
47
47
 
48
- The name of the media control element
48
+ The location to mount the element
49
49
 
50
50
 
51
51
  </td></tr>
@@ -61,6 +61,8 @@ element
61
61
 
62
62
  </td><td>
63
63
 
64
+ The element to mount
65
+
64
66
 
65
67
  </td></tr>
66
68
  </tbody></table>
@@ -68,8 +70,6 @@ element
68
70
 
69
71
  void
70
72
 
71
- The DOM node to render to or extend
72
-
73
73
  ## Remarks
74
74
 
75
75
  Use this method to render custom media control UI in a plugin
@@ -80,8 +80,8 @@ Use this method to render custom media control UI in a plugin
80
80
  ```ts
81
81
  class MyPlugin extends UICorePlugin {
82
82
  override render() {
83
- this.$el.html('<div data-clips>Here we go</div>')
84
- this.core.getPlugin('media_control').mount('clips', this.$el)
83
+ this.$el.html('<div id="my-element" class="my-class">Here we go</div>')
84
+ this.core.getPlugin('media_control').mount('left', this.$el)
85
85
  return this
86
86
  }
87
87
  }
@@ -0,0 +1,97 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@gcorevideo/player](./player.md) &gt; [MediaControl](./player.mediacontrol.md) &gt; [slot](./player.mediacontrol.slot.md)
4
+
5
+ ## MediaControl.slot() method
6
+
7
+ > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
+ >
9
+
10
+ Mount a media control to its configured location
11
+
12
+ **Signature:**
13
+
14
+ ```typescript
15
+ slot(name: MediaControlElement, element: ZeptoResult): void;
16
+ ```
17
+
18
+ ## Parameters
19
+
20
+ <table><thead><tr><th>
21
+
22
+ Parameter
23
+
24
+
25
+ </th><th>
26
+
27
+ Type
28
+
29
+
30
+ </th><th>
31
+
32
+ Description
33
+
34
+
35
+ </th></tr></thead>
36
+ <tbody><tr><td>
37
+
38
+ name
39
+
40
+
41
+ </td><td>
42
+
43
+ [MediaControlElement](./player.mediacontrolelement.md)
44
+
45
+
46
+ </td><td>
47
+
48
+ The name of the media control element
49
+
50
+
51
+ </td></tr>
52
+ <tr><td>
53
+
54
+ element
55
+
56
+
57
+ </td><td>
58
+
59
+ [ZeptoResult](./player.zeptoresult.md)
60
+
61
+
62
+ </td><td>
63
+
64
+ The DOM node/fragment to mount
65
+
66
+
67
+ </td></tr>
68
+ </tbody></table>
69
+ **Returns:**
70
+
71
+ void
72
+
73
+ ## Remarks
74
+
75
+ Media controls layout is configured via [MediaControlSettings](./player.mediacontrolsettings.md)<!-- -->. A plugin implementing custom elements on the media control dashboard, should use this method to mount the element to the correct location. The actual location is defined by the occurence of the element token in the `left`<!-- -->, `right` or `default` section of the [MediaControlSettings](./player.mediacontrolsettings.md)<!-- -->.
76
+
77
+ ## Example
78
+
79
+
80
+ ```ts
81
+ class MyPlugin extends UICorePlugin {
82
+ override render() {
83
+ // mount the element where it is configured in the layout
84
+ this.core.getPlugin('media_control').slot('my-element', this.$el)
85
+ }
86
+ }
87
+ ...
88
+ Player.registerPlugin(MyPlugin)
89
+ ...
90
+ // Configuration of the media control layout
91
+ new Player({
92
+ mediaControl: {
93
+ left: ['my-element'], // the element will be mounted to the left panel
94
+ },
95
+ })
96
+ ```
97
+
@@ -7,12 +7,15 @@
7
7
  > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
8
  >
9
9
 
10
- Built-in media control elements.
10
+ Media control element. Each element's token in the media control layout settings determines where the element is rendered.
11
11
 
12
12
  **Signature:**
13
13
 
14
14
  ```typescript
15
- export type MediaControlElement = MediaControlLeftElement | MediaControlLayerElement | MediaControlRightElement;
15
+ export type MediaControlElement = string;
16
16
  ```
17
- **References:** [MediaControlLeftElement](./player.mediacontrolleftelement.md)<!-- -->, [MediaControlLayerElement](./player.mediacontrollayerelement.md)<!-- -->, [MediaControlRightElement](./player.mediacontrolrightelement.md)
17
+
18
+ ## Remarks
19
+
20
+ Standard media control elements are defined in the [StandardMediaControlElement](./player.standardmediacontrolelement.md) type. Custom media control elements can be identified by a unique token.
18
21
 
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@gcorevideo/player](./player.md) &gt; [MediaControlPluginSettings](./player.mediacontrolpluginsettings.md)
4
+
5
+ ## MediaControlPluginSettings type
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ export type MediaControlPluginSettings = {
11
+ hideMediaControlDelay?: number;
12
+ };
13
+ ```
@@ -7,17 +7,17 @@
7
7
  > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
8
  >
9
9
 
10
- Specifies the allowed media control elements in each area. Can be used to restrict rendered media control elements.
10
+ Specifies the layout of media control elements. Actual elements will be rendered according to the playback settings. Custom elements rendered by the plugins will be mounted at the specified locations.
11
11
 
12
12
  **Signature:**
13
13
 
14
14
  ```typescript
15
15
  export type MediaControlSettings = {
16
- left: MediaControlLeftElement[];
17
- right: MediaControlRightElement[];
18
- default: MediaControlLayerElement[];
16
+ left: MediaControlElement[];
17
+ right: MediaControlElement[];
18
+ default: MediaControlElement[];
19
19
  seekEnabled: boolean;
20
20
  };
21
21
  ```
22
- **References:** [MediaControlLeftElement](./player.mediacontrolleftelement.md)<!-- -->, [MediaControlRightElement](./player.mediacontrolrightelement.md)<!-- -->, [MediaControlLayerElement](./player.mediacontrollayerelement.md)
22
+ **References:** [MediaControlElement](./player.mediacontrolelement.md)
23
23
 
@@ -1,20 +1,16 @@
1
1
  <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
2
 
3
- [Home](./index.md) &gt; [@gcorevideo/player](./player.md) &gt; [MediaControl](./player.mediacontrol.md) &gt; [enableControlButton](./player.mediacontrol.enablecontrolbutton.md)
3
+ [Home](./index.md) &gt; [@gcorevideo/player](./player.md) &gt; [MediaControlSlotMountPoint](./player.mediacontrolslotmountpoint.md)
4
4
 
5
- ## MediaControl.enableControlButton() method
5
+ ## MediaControlSlotMountPoint type
6
6
 
7
7
  > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
8
  >
9
9
 
10
- Enable the user interaction disabled earlier
10
+ Identifies a location for mounting custom media control elements.
11
11
 
12
12
  **Signature:**
13
13
 
14
14
  ```typescript
15
- enableControlButton(): void;
15
+ export type MediaControlSlotMountPoint = 'root' | 'base' | 'left' | 'right' | 'center' | 'seekbar';
16
16
  ```
17
- **Returns:**
18
-
19
- void
20
-
@@ -1,20 +1,16 @@
1
1
  <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
2
 
3
- [Home](./index.md) &gt; [@gcorevideo/player](./player.md) &gt; [MediaControl](./player.mediacontrol.md) &gt; [disabledControlButton](./player.mediacontrol.disabledcontrolbutton.md)
3
+ [Home](./index.md) &gt; [@gcorevideo/player](./player.md) &gt; [StandardMediaControlElement](./player.standardmediacontrolelement.md)
4
4
 
5
- ## MediaControl.disabledControlButton() method
5
+ ## StandardMediaControlElement type
6
6
 
7
7
  > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
8
  >
9
9
 
10
- Disable the user interaction for the control buttons
10
+ Built-in media control elements.
11
11
 
12
12
  **Signature:**
13
13
 
14
14
  ```typescript
15
- disabledControlButton(): void;
15
+ export type StandardMediaControlElement = 'duration' | 'fullscreen' | 'hd-indicator' | 'playpause' | 'playstop' | 'position' | 'seekbar' | 'volume';
16
16
  ```
17
- **Returns:**
18
-
19
- void
20
-
@@ -62,6 +62,7 @@ export declare class Clips extends UICorePlugin {
62
62
  private onMcRender;
63
63
  private onContainerChanged;
64
64
  private playerResize;
65
+ private toggleCompact;
65
66
  private onTimeUpdate;
66
67
  private parseClips;
67
68
  private makeSvg;
@@ -1 +1 @@
1
- {"version":3,"file":"Clips.d.ts","sourceRoot":"","sources":["../../../src/plugins/clips/Clips.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAe,MAAM,cAAc,CAAA;AAI3E,OAAO,EAAgB,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEjE,OAAO,kCAAkC,CAAA;AAOzC;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;CACb;AAKD;;;;;;;;;;;GAWG;AACH,qBAAa,KAAM,SAAQ,YAAY;IACrC,OAAO,CAAC,QAAQ,CAAgC;IAEhD,OAAO,CAAC,KAAK,CAAiB;IAE9B,OAAO,CAAC,YAAY,CAAuB;IAE3C,OAAO,CAAC,OAAO,CAA2B;IAE1C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAEtD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAa,UAAU;;MAItB;IAED,IAAI,OAAO,WAEV;IAED,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACM,UAAU;IAUV,MAAM;IAUN,OAAO;IAQP,OAAO;IAQP,MAAM;IAKf;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS;IAK5C,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,kBAAkB;IAsB1B,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,OAAO;IASf,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,WAAW;CAOpB"}
1
+ {"version":3,"file":"Clips.d.ts","sourceRoot":"","sources":["../../../src/plugins/clips/Clips.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAe,MAAM,cAAc,CAAA;AAI3E,OAAO,EAAgB,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEjE,OAAO,kCAAkC,CAAA;AAOzC;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;CACb;AAOD;;;;;;;;;;;GAWG;AACH,qBAAa,KAAM,SAAQ,YAAY;IACrC,OAAO,CAAC,QAAQ,CAAgC;IAEhD,OAAO,CAAC,KAAK,CAAiB;IAE9B,OAAO,CAAC,YAAY,CAAuB;IAE3C,OAAO,CAAC,OAAO,CAA2B;IAE1C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAEtD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAa,UAAU;;MAItB;IAED,IAAI,OAAO,WAEV;IAED,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACM,UAAU;IAUV,MAAM;IAUN,OAAO;IAQP,OAAO;IAQP,MAAM;IAKf;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS;IAK5C,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,kBAAkB;IAwB1B,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,OAAO;IASf,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,WAAW;CAOpB"}
@@ -7,6 +7,7 @@ import clipsHTML from '../../../assets/clips/clips.ejs';
7
7
  const T = 'plugins.clips';
8
8
  const VERSION = '2.22.16';
9
9
  const CLAPPR_VERSION = '0.11.4';
10
+ const COMPACT_WIDTH = 495;
10
11
  /**
11
12
  * `PLUGIN` that allows marking up the timeline of the video
12
13
  * @beta
@@ -36,7 +37,7 @@ export class Clips extends UICorePlugin {
36
37
  */
37
38
  get attributes() {
38
39
  return {
39
- class: 'media-control-clips',
40
+ class: 'media-control-clips gplayer-mc-clips',
40
41
  };
41
42
  }
42
43
  get version() {
@@ -104,6 +105,7 @@ export class Clips extends UICorePlugin {
104
105
  onContainerChanged() {
105
106
  trace(`${T} onContainerChanged`);
106
107
  // TODO figure out the conditions of changing the container (without destroying the previous one)
108
+ // probably it is the case with the MultiCamera plugin
107
109
  if (this.oldContainer) {
108
110
  this.stopListening(this.oldContainer, Events.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
109
111
  }
@@ -113,12 +115,24 @@ export class Clips extends UICorePlugin {
113
115
  this.svgMask = null;
114
116
  }
115
117
  this.listenTo(this.core.activeContainer, Events.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
118
+ this.toggleCompact();
116
119
  }
117
120
  playerResize() {
118
121
  const duration = this.core.activeContainer.getDuration();
122
+ // TODO check
119
123
  if (duration) {
120
124
  this.makeSvg(duration);
121
125
  }
126
+ this.toggleCompact();
127
+ }
128
+ toggleCompact() {
129
+ const elText = this.$el.find('#gplayer-mc-clips-text');
130
+ if (this.core.activeContainer.el.clientWidth <= COMPACT_WIDTH) {
131
+ elText.addClass('compact');
132
+ }
133
+ else {
134
+ elText.removeClass('compact');
135
+ }
122
136
  }
123
137
  onTimeUpdate(event) {
124
138
  if (!this.svgMask) {
@@ -156,7 +170,7 @@ export class Clips extends UICorePlugin {
156
170
  }
157
171
  setClipText(text) {
158
172
  if (text) {
159
- this.$el.show().find('#clips-text').text(text);
173
+ this.$el.show().find('#gplayer-mc-clips-text').text(text);
160
174
  }
161
175
  else {
162
176
  this.$el.hide();
@@ -99,7 +99,7 @@ export class DvrControls extends UICorePlugin {
99
99
  // TODO -> to MediaControl (auto hide)
100
100
  mediaControl.toggleElement('duration', false);
101
101
  mediaControl.toggleElement('position', false);
102
- mediaControl.mount('left', this.$el); // TODO use independent mount point
102
+ mediaControl.slot('dvr', this.$el); // TODO use independent mount point
103
103
  }
104
104
  onDvrStateChanged(dvrInUse) {
105
105
  this.toggleState(dvrInUse);