@gcorevideo/player 2.22.0 → 2.22.2

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 (125) hide show
  1. package/assets/bottom-gear/bottomgear copy.ejs +10 -0
  2. package/assets/bottom-gear/bottomgear.ejs +4 -8
  3. package/assets/bottom-gear/gear-sub-menu.scss +0 -1
  4. package/assets/bottom-gear/gear.scss +0 -1
  5. package/assets/clappr-nerd-stats/button.ejs +3 -3
  6. package/assets/level-selector/button.ejs +2 -4
  7. package/assets/level-selector/list.ejs +14 -10
  8. package/assets/level-selector/style.scss +9 -4
  9. package/assets/media-control/container.scss +1 -1
  10. package/assets/playback-rate/list.ejs +5 -5
  11. package/assets/spinner-three-bounce/spinner.scss +1 -1
  12. package/dist/core.js +1 -2
  13. package/dist/index.css +885 -884
  14. package/dist/index.js +3938 -3779
  15. package/dist/player.d.ts +246 -108
  16. package/dist/plugins/index.css +1230 -1229
  17. package/dist/plugins/index.js +4036 -3878
  18. package/docs/api/player.bottomgear.additem.md +95 -0
  19. package/docs/api/player.bottomgear.md +63 -19
  20. package/docs/api/player.bottomgear.refresh.md +5 -1
  21. package/docs/api/player.clapprnerdstats.md +0 -2
  22. package/docs/api/player.clicktopause.md +1 -1
  23. package/docs/api/player.closedcaptions.md +2 -2
  24. package/docs/api/player.closedcaptionspluginsettings.md +5 -0
  25. package/docs/api/player.errorscreen.md +18 -4
  26. package/docs/api/player.errorscreenpluginsettings.md +1 -4
  27. package/docs/api/player.errorscreensettings.md +15 -0
  28. package/docs/api/{player.mediacontrolevents.md → player.gearevents.md} +7 -7
  29. package/docs/api/player.levelselector.events.md +0 -1
  30. package/docs/api/player.levelselector.md +1 -1
  31. package/docs/api/player.md +33 -36
  32. package/docs/api/{player.bottomgear.setcontent.md → player.mediacontrol.handlecustomarea.md} +5 -9
  33. package/docs/api/player.mediacontrol.md +10 -24
  34. package/docs/api/player.mediacontrol.putelement.md +2 -2
  35. package/docs/api/{player.bottomgear.getelement.md → player.mediacontrol.toggleelement.md} +23 -9
  36. package/docs/api/player.mediacontrolelement.md +1 -1
  37. package/docs/api/player.playbackrate.md +22 -3
  38. package/docs/api/{player.gearoptionsitem.md → player.playbackrateoption.md} +6 -4
  39. package/docs/api/{player.mediacontrol.getcenterpanel.md → player.playbackratesettings.md} +8 -6
  40. package/docs/api/player.sourcecontroller._constructor_.md +49 -0
  41. package/docs/api/player.sourcecontroller.md +70 -7
  42. package/docs/api/player.spinnerevents.md +1 -4
  43. package/docs/api/player.spinnerthreebounce._constructor_.md +0 -3
  44. package/docs/api/player.spinnerthreebounce.hide.md +0 -3
  45. package/docs/api/player.spinnerthreebounce.md +5 -8
  46. package/docs/api/player.spinnerthreebounce.show.md +2 -5
  47. package/lib/internal.types.d.ts +5 -0
  48. package/lib/internal.types.d.ts.map +1 -1
  49. package/lib/playback/dash-playback/DashPlayback.d.ts.map +1 -1
  50. package/lib/playback/dash-playback/DashPlayback.js +0 -1
  51. package/lib/playback.types.d.ts +0 -5
  52. package/lib/playback.types.d.ts.map +1 -1
  53. package/lib/plugins/bottom-gear/BottomGear.d.ts +93 -20
  54. package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
  55. package/lib/plugins/bottom-gear/BottomGear.js +145 -37
  56. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts +2 -3
  57. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts.map +1 -1
  58. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +18 -15
  59. package/lib/plugins/click-to-pause/ClickToPause.d.ts +1 -1
  60. package/lib/plugins/click-to-pause/ClickToPause.d.ts.map +1 -1
  61. package/lib/plugins/click-to-pause/ClickToPause.js +3 -2
  62. package/lib/plugins/dvr-controls/DvrControls.js +1 -1
  63. package/lib/plugins/error-screen/ErrorScreen.d.ts +29 -4
  64. package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
  65. package/lib/plugins/error-screen/ErrorScreen.js +17 -2
  66. package/lib/plugins/level-selector/LevelSelector.d.ts +8 -11
  67. package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -1
  68. package/lib/plugins/level-selector/LevelSelector.js +66 -102
  69. package/lib/plugins/media-control/MediaControl.d.ts +6 -15
  70. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  71. package/lib/plugins/media-control/MediaControl.js +36 -30
  72. package/lib/plugins/picture-in-picture/PictureInPicture.d.ts.map +1 -1
  73. package/lib/plugins/picture-in-picture/PictureInPicture.js +7 -2
  74. package/lib/plugins/playback-rate/PlaybackRate.d.ts +42 -14
  75. package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -1
  76. package/lib/plugins/playback-rate/PlaybackRate.js +101 -83
  77. package/lib/plugins/source-controller/SourceController.d.ts +40 -4
  78. package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
  79. package/lib/plugins/source-controller/SourceController.js +41 -4
  80. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts +8 -6
  81. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
  82. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +10 -6
  83. package/lib/plugins/subtitles/ClosedCaptions.d.ts +7 -7
  84. package/lib/plugins/subtitles/ClosedCaptions.d.ts.map +1 -1
  85. package/lib/plugins/subtitles/ClosedCaptions.js +3 -3
  86. package/lib/testUtils.d.ts +1 -0
  87. package/lib/testUtils.d.ts.map +1 -1
  88. package/lib/testUtils.js +13 -0
  89. package/package.json +1 -1
  90. package/src/internal.types.ts +6 -0
  91. package/src/playback/dash-playback/DashPlayback.ts +0 -1
  92. package/src/playback.types.ts +0 -5
  93. package/src/plugins/bottom-gear/BottomGear.ts +186 -77
  94. package/src/plugins/bottom-gear/__tests__/BottomGear.test.ts +21 -5
  95. package/src/plugins/bottom-gear/__tests__/__snapshots__/BottomGear.test.ts.snap +5 -12
  96. package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +27 -25
  97. package/src/plugins/click-to-pause/ClickToPause.ts +3 -2
  98. package/src/plugins/dvr-controls/DvrControls.ts +1 -1
  99. package/src/plugins/dvr-controls/__tests__/DvrControls.test.ts +1 -1
  100. package/src/plugins/error-screen/ErrorScreen.ts +30 -4
  101. package/src/plugins/level-selector/LevelSelector.ts +80 -120
  102. package/src/plugins/level-selector/__tests__/LevelSelector.test.ts +69 -79
  103. package/src/plugins/level-selector/__tests__/__snapshots__/LevelSelector.test.ts.snap +38 -71
  104. package/src/plugins/media-control/MediaControl.ts +50 -36
  105. package/src/plugins/media-control/__tests__/MediaControl.test.ts +4 -4
  106. package/src/plugins/picture-in-picture/PictureInPicture.ts +7 -2
  107. package/src/plugins/playback-rate/PlaybackRate.ts +136 -108
  108. package/src/plugins/playback-rate/__tests__/PlaybackRate.test.ts +84 -37
  109. package/src/plugins/playback-rate/__tests__/__snapshots__/PlaybackRate.test.ts.snap +55 -6
  110. package/src/plugins/source-controller/SourceController.ts +41 -4
  111. package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +10 -6
  112. package/src/plugins/subtitles/ClosedCaptions.ts +9 -10
  113. package/src/plugins/subtitles/__tests__/ClosedCaptions.test.ts +1 -1
  114. package/src/testUtils.ts +14 -0
  115. package/src/typings/vitest.d.ts +1 -0
  116. package/temp/player.api.json +303 -370
  117. package/tsconfig.tsbuildinfo +1 -1
  118. package/docs/api/player.gearitemelement.md +0 -18
  119. package/docs/api/player.mediacontrol.getleftpanel.md +0 -22
  120. package/docs/api/player.mediacontrol.getrightpanel.md +0 -22
  121. package/docs/api/player.subtitlespluginsettings.md +0 -18
  122. package/docs/api/player.texttrackitem.id.md +0 -11
  123. package/docs/api/player.texttrackitem.md +0 -87
  124. package/docs/api/player.texttrackitem.name.md +0 -11
  125. package/docs/api/player.texttrackitem.track.md +0 -11
@@ -3,23 +3,82 @@ import '../../../assets/bottom-gear/gear.scss';
3
3
  import '../../../assets/bottom-gear/gear-sub-menu.scss';
4
4
  import { ZeptoResult } from '../../types.js';
5
5
  /**
6
- * An element inside the gear menu
6
+ * Events triggered by the plugin
7
7
  * @beta
8
8
  */
9
- export type GearOptionsItem = 'quality' | 'rate' | 'nerd';
10
- /**
11
- * @deprecated Use {@link GearOptionsItem} instead
12
- */
13
- export type GearItemElement = GearOptionsItem;
9
+ export declare enum GearEvents {
10
+ /**
11
+ * Use this event to accurately attach an item to the gear menu
12
+ */
13
+ RENDERED = "rendered"
14
+ }
14
15
  /**
15
- * `PLUGIN` that adds the gear button with an extra options menu on the right side of the {@link MediaControl | media control} UI
16
+ * `PLUGIN` that adds a button to extend the media controls UI with extra options.
16
17
  * @beta
17
18
  * @remarks
18
- * The plugins provides a base for attaching custom settings UI in the gear menu
19
+ * The plugin renders small gear icon to the right of the media controls.
20
+ * It provides a base for attaching custom settings UI in the gear menu
19
21
  *
20
22
  * Depends on:
21
23
  *
22
24
  * - {@link MediaControl}
25
+ *
26
+ * @example
27
+ * You can use bottom gear to add custom settings UI to the gear menu.
28
+ *
29
+ * ```ts
30
+ * import { BottomGear } from '@gcorevideo/player/plugins/bottom-gear';
31
+ *
32
+ * class CustomOptionsPlugin extends UICorePlugin {
33
+ * // ...
34
+ *
35
+ * override get events() {
36
+ * return {
37
+ * 'click #my-button': 'doMyAction',
38
+ * }
39
+ * }
40
+ *
41
+ * private doMyAction() {
42
+ * // ...
43
+ * }
44
+ *
45
+ * override render() {
46
+ * const bottomGear = this.core.getPlugin('bottom_gear');
47
+ * if (!bottomGear) {
48
+ * return this;
49
+ * }
50
+ * this.$el.html('<button class="custom-option">Custom option</button>');
51
+ * // Put rendered element into the gear menu
52
+ * bottomGear.addItem('custom').html(this.$el)
53
+ * return this;
54
+ * }
55
+ *
56
+ * // alternatively, add an option with a submenu
57
+ * override render() {
58
+ * this.$el.html(template(templateHtml)({
59
+ * // ...
60
+ * })));
61
+ * return this;
62
+ * }
63
+ *
64
+ * private addGearOption() {
65
+ * this.core.getPlugin('bottom_gear')
66
+ * .addItem('custom', this.$el)
67
+ * .html($('<button class="custom-option">Custom option</button>'))
68
+ * }
69
+ *
70
+ * override bindEvents() {
71
+ * this.listenToOnce(this.core, ClapprEvents.CORE_READY, () => {
72
+ * const bottomGear = this.core.getPlugin('bottom_gear');
73
+ * assert(bottomGear, 'bottom_gear plugin is required');
74
+ * // simple case
75
+ * this.listenTo(bottomGear, GearEvents.RENDERED, this.render);
76
+ * // or with a submenu
77
+ * this.listenTo(bottomGear, GearEvents.RENDERED, this.addGearOption);
78
+ * });
79
+ * }
80
+ * }
81
+ * ```
23
82
  */
24
83
  export declare class BottomGear extends UICorePlugin {
25
84
  private isHd;
@@ -48,22 +107,35 @@ export declare class BottomGear extends UICorePlugin {
48
107
  * @internal
49
108
  */
50
109
  get events(): {
51
- 'click .button-gear': string;
110
+ 'click #gear-button': string;
52
111
  };
53
112
  /**
54
113
  * @internal
55
114
  */
56
115
  bindEvents(): void;
57
116
  /**
58
- * @param name - Name of a gear menu placeholder item to attach custom UI
59
- * @returns Zepto result of the element
60
- */
61
- getElement(name: GearOptionsItem): ZeptoResult | null;
62
- /**
63
- * Replaces the content of the gear menu
64
- * @param content - Zepto result of the element
117
+ * Adds a custom option to the gear menu
118
+ * @param name - A unique name of the option
119
+ * @param $subMenu - The submenu to attach to the option
120
+ * @returns The added item placeholder to attach custom markup
121
+ * @remarks
122
+ * When called with $submenu param, a click on the added item will toggle the submenu visibility.
123
+ *
124
+ * When added without submenu, it's responsibility of the caller to handle the click event however needed.
125
+ * @example
126
+ * ```ts
127
+ * class MyPlugin extends UICorePlugin {
128
+ * override render() {
129
+ * this.$el.html('<div class="my-awesome-settings">...</div>')
130
+ * this.core.getPlugin('bottom_gear')
131
+ * ?.addItem('custom', this.$el)
132
+ * .html($('<button>Custom settings</button>'))
133
+ * return this
134
+ * }
135
+ * }
136
+ * ```
65
137
  */
66
- setContent(content: ZeptoResult): void;
138
+ addItem(name: string, $subMenu?: ZeptoResult): ZeptoResult;
67
139
  private onActiveContainerChanged;
68
140
  private bindContainerEvents;
69
141
  private highDefinitionUpdate;
@@ -72,13 +144,14 @@ export declare class BottomGear extends UICorePlugin {
72
144
  */
73
145
  render(): this;
74
146
  /**
75
- * Re-renders the gear menu.
76
- * It fires the {@link MediaControlEvents.MEDIACONTROL_GEAR_RENDERED | MEDIACONTROL_GEAR_RENDERED} event,
77
- * which the plugins that attach to the gear menu can listen to to re-render themselves.
147
+ * Collapses any submenu open back to the gear menu.
148
+ * @remarks
149
+ * Should be called by the UI plugin that added a gear item with a submenu when the latter is closed (e.g., when a "back" button is clicked).
78
150
  */
79
151
  refresh(): void;
80
152
  private toggleGearMenu;
81
153
  private hide;
82
154
  private onCoreReady;
155
+ private onMediaControlRendered;
83
156
  }
84
157
  //# sourceMappingURL=BottomGear.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BottomGear.d.ts","sourceRoot":"","sources":["../../../src/plugins/bottom-gear/BottomGear.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoC,MAAM,cAAc,CAAC;AAO9E,OAAO,uCAAuC,CAAC;AAC/C,OAAO,gDAAgD,CAAC;AAGxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAO7C;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC;AAI9C;;;;;;;;;GASG;AACH,qBAAa,UAAW,SAAQ,YAAY;IAC1C,OAAO,CAAC,IAAI,CAAS;IAErB;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACH,MAAM,KAAK,OAAO,WAEjB;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAuB;IAEvD;;OAEG;IACH,IAAa,UAAU;;MAItB;IAED;;OAEG;IACH,IAAa,MAAM;;MAIlB;IAED;;OAEG;IACM,UAAU;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wB;IAKhC,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,oBAAoB;IAM5B;;OAEG;IACM,MAAM;IAsBf;;;;OAIG;IACH,OAAO;IAKP,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,IAAI;IAIZ,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,sBAAsB;CAI/B"}
@@ -1,4 +1,4 @@
1
- import { UICorePlugin, template, Events as ClapprEvents } from '@clappr/core';
1
+ import { UICorePlugin, template, Events as ClapprEvents, $ } from '@clappr/core';
2
2
  import { trace } from '@gcorevideo/utils';
3
3
  import assert from 'assert';
4
4
  import { CLAPPR_VERSION } from '../../build.js';
@@ -7,19 +7,87 @@ import '../../../assets/bottom-gear/gear.scss';
7
7
  import '../../../assets/bottom-gear/gear-sub-menu.scss';
8
8
  import gearIcon from '../../../assets/icons/new/gear.svg';
9
9
  import gearHdIcon from '../../../assets/icons/new/gear-hd.svg';
10
- import { MediaControlEvents } from '../media-control/MediaControl';
11
10
  const VERSION = '2.19.12';
12
11
  const T = 'plugins.bottom_gear';
12
+ /**
13
+ * Events triggered by the plugin
14
+ * @beta
15
+ */
16
+ export var GearEvents;
17
+ (function (GearEvents) {
18
+ /**
19
+ * Use this event to accurately attach an item to the gear menu
20
+ */
21
+ GearEvents["RENDERED"] = "rendered";
22
+ })(GearEvents || (GearEvents = {}));
13
23
  // TODO disabled if no items added
14
24
  /**
15
- * `PLUGIN` that adds the gear button with an extra options menu on the right side of the {@link MediaControl | media control} UI
25
+ * `PLUGIN` that adds a button to extend the media controls UI with extra options.
16
26
  * @beta
17
27
  * @remarks
18
- * The plugins provides a base for attaching custom settings UI in the gear menu
28
+ * The plugin renders small gear icon to the right of the media controls.
29
+ * It provides a base for attaching custom settings UI in the gear menu
19
30
  *
20
31
  * Depends on:
21
32
  *
22
33
  * - {@link MediaControl}
34
+ *
35
+ * @example
36
+ * You can use bottom gear to add custom settings UI to the gear menu.
37
+ *
38
+ * ```ts
39
+ * import { BottomGear } from '@gcorevideo/player/plugins/bottom-gear';
40
+ *
41
+ * class CustomOptionsPlugin extends UICorePlugin {
42
+ * // ...
43
+ *
44
+ * override get events() {
45
+ * return {
46
+ * 'click #my-button': 'doMyAction',
47
+ * }
48
+ * }
49
+ *
50
+ * private doMyAction() {
51
+ * // ...
52
+ * }
53
+ *
54
+ * override render() {
55
+ * const bottomGear = this.core.getPlugin('bottom_gear');
56
+ * if (!bottomGear) {
57
+ * return this;
58
+ * }
59
+ * this.$el.html('<button class="custom-option">Custom option</button>');
60
+ * // Put rendered element into the gear menu
61
+ * bottomGear.addItem('custom').html(this.$el)
62
+ * return this;
63
+ * }
64
+ *
65
+ * // alternatively, add an option with a submenu
66
+ * override render() {
67
+ * this.$el.html(template(templateHtml)({
68
+ * // ...
69
+ * })));
70
+ * return this;
71
+ * }
72
+ *
73
+ * private addGearOption() {
74
+ * this.core.getPlugin('bottom_gear')
75
+ * .addItem('custom', this.$el)
76
+ * .html($('<button class="custom-option">Custom option</button>'))
77
+ * }
78
+ *
79
+ * override bindEvents() {
80
+ * this.listenToOnce(this.core, ClapprEvents.CORE_READY, () => {
81
+ * const bottomGear = this.core.getPlugin('bottom_gear');
82
+ * assert(bottomGear, 'bottom_gear plugin is required');
83
+ * // simple case
84
+ * this.listenTo(bottomGear, GearEvents.RENDERED, this.render);
85
+ * // or with a submenu
86
+ * this.listenTo(bottomGear, GearEvents.RENDERED, this.addGearOption);
87
+ * });
88
+ * }
89
+ * }
90
+ * ```
23
91
  */
24
92
  export class BottomGear extends UICorePlugin {
25
93
  isHd = false;
@@ -47,7 +115,7 @@ export class BottomGear extends UICorePlugin {
47
115
  */
48
116
  get attributes() {
49
117
  return {
50
- 'class': 'media-control-gear',
118
+ class: 'media-control-gear',
51
119
  };
52
120
  }
53
121
  /**
@@ -55,30 +123,61 @@ export class BottomGear extends UICorePlugin {
55
123
  */
56
124
  get events() {
57
125
  return {
58
- 'click .button-gear': 'toggleGearMenu',
126
+ 'click #gear-button': 'toggleGearMenu',
59
127
  };
60
128
  }
61
129
  /**
62
130
  * @internal
63
131
  */
64
132
  bindEvents() {
65
- this.listenTo(this.core, ClapprEvents.CORE_READY, this.onCoreReady);
133
+ this.listenToOnce(this.core, ClapprEvents.CORE_READY, this.onCoreReady);
66
134
  this.listenTo(this.core, ClapprEvents.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
67
135
  }
68
136
  /**
69
- * @param name - Name of a gear menu placeholder item to attach custom UI
70
- * @returns Zepto result of the element
71
- */
72
- getElement(name) {
73
- return this.$el.find(`.gear-options-list [data-${name}]`);
74
- }
75
- // TODO implement putElement/addElement method
76
- /**
77
- * Replaces the content of the gear menu
78
- * @param content - Zepto result of the element
137
+ * Adds a custom option to the gear menu
138
+ * @param name - A unique name of the option
139
+ * @param $subMenu - The submenu to attach to the option
140
+ * @returns The added item placeholder to attach custom markup
141
+ * @remarks
142
+ * When called with $submenu param, a click on the added item will toggle the submenu visibility.
143
+ *
144
+ * When added without submenu, it's responsibility of the caller to handle the click event however needed.
145
+ * @example
146
+ * ```ts
147
+ * class MyPlugin extends UICorePlugin {
148
+ * override render() {
149
+ * this.$el.html('<div class="my-awesome-settings">...</div>')
150
+ * this.core.getPlugin('bottom_gear')
151
+ * ?.addItem('custom', this.$el)
152
+ * .html($('<button>Custom settings</button>'))
153
+ * return this
154
+ * }
155
+ * }
156
+ * ```
79
157
  */
80
- setContent(content) {
81
- this.$el.find('.gear-wrapper').html(content);
158
+ addItem(name, $subMenu) {
159
+ const $existingItem = this.$el.find(`#gear-options li[data-${name}`);
160
+ if ($existingItem.length) {
161
+ trace(`${T} addItem already exists`, { name });
162
+ return $existingItem;
163
+ }
164
+ const $item = $('<li></li>')
165
+ .attr(`data-${name}`, '')
166
+ .appendTo(this.$el.find('#gear-options'));
167
+ if ($subMenu) {
168
+ trace(`${T} addItem adding submenu`, { name });
169
+ $subMenu
170
+ .addClass('gear-sub-menu-wrapper')
171
+ .hide()
172
+ .appendTo(this.$el.find('#gear-options-wrapper'));
173
+ $item.on('click', (e) => {
174
+ trace(`${T} addItem submenu clicked`, { name });
175
+ e.stopPropagation();
176
+ $subMenu.show();
177
+ this.$el.find('#gear-options').hide();
178
+ });
179
+ }
180
+ return $item;
82
181
  }
83
182
  onActiveContainerChanged() {
84
183
  trace(`${T} onActiveContainerChanged`);
@@ -97,38 +196,47 @@ export class BottomGear extends UICorePlugin {
97
196
  * @internal
98
197
  */
99
198
  render() {
199
+ trace(`${T} render`);
100
200
  const mediaControl = this.core.getPlugin('media_control');
101
- // TODO use options.mediaControl.gear.items
102
- const items = [
103
- 'quality',
104
- 'rate',
105
- 'nerd',
106
- ];
201
+ if (!mediaControl) {
202
+ return this; // TODO test
203
+ }
107
204
  const icon = this.isHd ? gearHdIcon : gearIcon;
108
- this.$el.html(BottomGear.template({ icon, items }));
109
- mediaControl.putElement('gear', this.el);
110
- mediaControl.trigger(MediaControlEvents.MEDIACONTROL_GEAR_RENDERED);
205
+ this.$el
206
+ .html(BottomGear.template({ icon }))
207
+ .find('#gear-sub-menu-wrapper')
208
+ .hide();
209
+ // TODO make non-clickable when there are no items
210
+ mediaControl.putElement('gear', this.$el);
211
+ setTimeout(() => {
212
+ this.trigger(GearEvents.RENDERED);
213
+ }, 0);
111
214
  return this;
112
215
  }
113
216
  /**
114
- * Re-renders the gear menu.
115
- * It fires the {@link MediaControlEvents.MEDIACONTROL_GEAR_RENDERED | MEDIACONTROL_GEAR_RENDERED} event,
116
- * which the plugins that attach to the gear menu can listen to to re-render themselves.
217
+ * Collapses any submenu open back to the gear menu.
218
+ * @remarks
219
+ * Should be called by the UI plugin that added a gear item with a submenu when the latter is closed (e.g., when a "back" button is clicked).
117
220
  */
118
221
  refresh() {
119
- this.render();
120
- this.$el.find('.gear-wrapper').show();
222
+ this.$el.find('.gear-sub-menu-wrapper').hide();
223
+ this.$el.find('#gear-options').show();
121
224
  }
122
225
  toggleGearMenu() {
123
- this.$el.find('.gear-wrapper').toggle();
226
+ this.$el.find('#gear-options-wrapper').toggle();
124
227
  }
125
228
  hide() {
126
- this.$el.find('.gear-wrapper').hide();
229
+ this.$el.find('#gear-options-wrapper').hide();
127
230
  }
128
231
  onCoreReady() {
232
+ trace(`${T} onCoreReady`);
129
233
  const mediaControl = this.core.getPlugin('media_control');
130
234
  assert(mediaControl, 'media_control plugin is required');
131
- this.listenTo(mediaControl, ClapprEvents.MEDIACONTROL_RENDERED, this.render);
132
- this.listenTo(mediaControl, ClapprEvents.MEDIACONTROL_HIDE, this.hide); // TODO mediacontrol show as well
235
+ this.listenTo(mediaControl, ClapprEvents.MEDIACONTROL_RENDERED, this.onMediaControlRendered);
236
+ this.listenTo(mediaControl, ClapprEvents.MEDIACONTROL_HIDE, this.hide);
237
+ }
238
+ onMediaControlRendered() {
239
+ trace(`${T} onMediaControlRendered`);
240
+ this.render();
133
241
  }
134
242
  }
@@ -7,8 +7,6 @@ import '../../../assets/clappr-nerd-stats/clappr-nerd-stats.scss';
7
7
  * @remarks
8
8
  * Depends on:
9
9
  *
10
- * - {@link MediaControl}
11
- *
12
10
  * - {@link BottomGear}
13
11
  *
14
12
  * - {@link ClapprStats}
@@ -25,6 +23,7 @@ export declare class ClapprNerdStats extends UICorePlugin {
25
23
  private showing;
26
24
  private shortcut;
27
25
  private iconPosition;
26
+ private static readonly buttonTemplate;
28
27
  /**
29
28
  * @internal
30
29
  */
@@ -60,7 +59,7 @@ export declare class ClapprNerdStats extends UICorePlugin {
60
59
  * @internal
61
60
  */
62
61
  bindEvents(): void;
63
- private init;
62
+ private onCoreReady;
64
63
  private toggle;
65
64
  private show;
66
65
  private hide;
@@ -1 +1 @@
1
- {"version":3,"file":"ClapprNerdStats.d.ts","sourceRoot":"","sources":["../../../src/plugins/clappr-nerd-stats/ClapprNerdStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoB,IAAI,EAAa,MAAM,cAAc,CAAA;AAsB9E,OAAO,0DAA0D,CAAA;AAgGjE;;;;;;;;;;;;;;;;;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OAAO,CAAC,SAAS,CAAyB;IAE1C,OAAO,CAAC,aAAa,CAIpB;IAED,OAAO,CAAC,OAAO,CAAwB;IAEvC,OAAO,CAAC,OAAO,CAAQ;IAEvB,OAAO,CAAC,QAAQ,CAAU;IAE1B,OAAO,CAAC,YAAY,CAAc;IAElC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAuB;IAE7D;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAuB;IAEvD;;OAEG;IACH,IAAa,UAAU;;;MAKtB;IAED;;OAEG;IACH,IAAa,MAAM;;;;MAMlB;IAED,OAAO,KAAK,YAAY,GAEvB;IAED,OAAO,KAAK,sBAAsB,GAEjC;IAED,OAAO,KAAK,WAAW,GAEtB;IAED,OAAO,KAAK,YAAY,GAEvB;gBAEW,IAAI,EAAE,IAAI;IAgBtB;;OAEG;IACM,UAAU;IAInB,OAAO,CAAC,WAAW;IAiCnB,OAAO,CAAC,MAAM;IAQd,OAAO,CAAC,IAAI;IAeZ,OAAO,CAAC,IAAI;IAMZ,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,gBAAgB;IA+BxB,OAAO,CAAC,aAAa;IA4BrB,OAAO,CAAC,eAAe;IAUvB;;OAEG;IACM,MAAM;IASf,OAAO,CAAC,eAAe;IAiBvB,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,gBAAgB;CAWzB"}
@@ -1,5 +1,5 @@
1
1
  import { UICorePlugin, Events, template } from '@clappr/core';
2
- import { reportError } from '@gcorevideo/utils';
2
+ import { reportError, trace } from '@gcorevideo/utils';
3
3
  import Mousetrap from 'mousetrap';
4
4
  import { CLAPPR_VERSION } from '../../build.js';
5
5
  import { ClapprStatsEvents, } from '../clappr-stats/types.js';
@@ -10,7 +10,7 @@ import '../../../assets/clappr-nerd-stats/clappr-nerd-stats.scss';
10
10
  import pluginHtml from '../../../assets/clappr-nerd-stats/clappr-nerd-stats.ejs';
11
11
  import buttonHtml from '../../../assets/clappr-nerd-stats/button.ejs';
12
12
  import statsIcon from '../../../assets/icons/new/stats.svg';
13
- import { MediaControlEvents } from '../media-control/MediaControl.js';
13
+ import { GearEvents } from '../bottom-gear/BottomGear.js';
14
14
  import assert from 'assert';
15
15
  const qualityClasses = [
16
16
  'speedtest-quality-value-1',
@@ -79,7 +79,7 @@ const drawSummary = (customMetrics, vodContainer, liveContainer) => {
79
79
  vodContainer.html(vodHtml);
80
80
  liveContainer.html(liveHtml);
81
81
  };
82
- // const T = 'plugins.clappr_nerd_stats';
82
+ const T = 'plugins.clappr_nerd_stats';
83
83
  /**
84
84
  * `PLUGIN` that displays useful network-related statistics.
85
85
  * @beta
@@ -87,8 +87,6 @@ const drawSummary = (customMetrics, vodContainer, liveContainer) => {
87
87
  * @remarks
88
88
  * Depends on:
89
89
  *
90
- * - {@link MediaControl}
91
- *
92
90
  * - {@link BottomGear}
93
91
  *
94
92
  * - {@link ClapprStats}
@@ -109,6 +107,7 @@ export class ClapprNerdStats extends UICorePlugin {
109
107
  showing = false;
110
108
  shortcut;
111
109
  iconPosition;
110
+ static buttonTemplate = template(buttonHtml);
112
111
  /**
113
112
  * @internal
114
113
  */
@@ -172,12 +171,12 @@ export class ClapprNerdStats extends UICorePlugin {
172
171
  * @internal
173
172
  */
174
173
  bindEvents() {
175
- const mediaControl = this.core.getPlugin('media_control');
176
- assert(mediaControl, 'media_control plugin is required');
177
- this.listenToOnce(this.core, Events.CORE_READY, this.init);
178
- this.listenTo(mediaControl, MediaControlEvents.MEDIACONTROL_GEAR_RENDERED, this.addToBottomGear);
174
+ this.listenToOnce(this.core, Events.CORE_READY, this.onCoreReady);
179
175
  }
180
- init() {
176
+ onCoreReady() {
177
+ const bottomGear = this.core.getPlugin('bottom_gear');
178
+ assert(bottomGear, 'bottom_gear plugin is required');
179
+ this.listenTo(bottomGear, GearEvents.RENDERED, this.addToBottomGear);
181
180
  this.container = this.core.activeContainer;
182
181
  const clapprStats = this.container?.getPlugin('clappr_stats');
183
182
  if (!clapprStats) {
@@ -289,18 +288,22 @@ export class ClapprNerdStats extends UICorePlugin {
289
288
  * @internal
290
289
  */
291
290
  render() {
291
+ trace(`${T} render`);
292
292
  // TODO append to the container
293
293
  this.core.$el.append(this.$el[0]);
294
294
  this.hide();
295
295
  return this;
296
296
  }
297
297
  addToBottomGear() {
298
+ trace(`${T} addToBottomGear`);
298
299
  const gear = this.core.getPlugin('bottom_gear');
299
- const $el = gear.getElement('nerd');
300
- $el.html(buttonHtml);
301
- const $button = $el.find('.nerd-button');
302
- $button.find('.stats-icon').html(statsIcon);
303
- $button.on('click', (e) => {
300
+ const $button = gear
301
+ .addItem('nerd')
302
+ .html(ClapprNerdStats.buttonTemplate({
303
+ icon: statsIcon,
304
+ i18n: this.core.i18n,
305
+ }))
306
+ .on('click', (e) => {
304
307
  e.stopPropagation();
305
308
  this.toggle();
306
309
  });
@@ -1,6 +1,6 @@
1
1
  import { ContainerPlugin } from '@clappr/core';
2
2
  /**
3
- * `PLUGIN` that adds a behavior of toggling the playback state on click over the container
3
+ * A small `PLUGIN` that toggles the playback state on click over the video container
4
4
  * @beta
5
5
  */
6
6
  export declare class ClickToPause extends ContainerPlugin {
@@ -1 +1 @@
1
- {"version":3,"file":"ClickToPause.d.ts","sourceRoot":"","sources":["../../../src/plugins/click-to-pause/ClickToPause.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAoB,MAAM,cAAc,CAAA;AAShE;;;GAGG;AACH,qBAAa,YAAa,SAAQ,eAAe;IAC/C,OAAO,CAAC,cAAc,CAAQ;IAE9B,OAAO,CAAC,KAAK,CAAqB;IAElC;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACM,UAAU;IASnB,OAAO,CAAC,KAAK;IAoBb,OAAO,CAAC,cAAc;IActB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,UAAU;CAMnB"}
1
+ {"version":3,"file":"ClickToPause.d.ts","sourceRoot":"","sources":["../../../src/plugins/click-to-pause/ClickToPause.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAoB,MAAM,cAAc,CAAA;AAShE;;;GAGG;AACH,qBAAa,YAAa,SAAQ,eAAe;IAC/C,OAAO,CAAC,cAAc,CAAQ;IAE9B,OAAO,CAAC,KAAK,CAAqB;IAElC;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACM,UAAU;IASnB,OAAO,CAAC,KAAK;IAoBb,OAAO,CAAC,cAAc;IActB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,UAAU;CAMnB"}
@@ -1,4 +1,5 @@
1
- //Copyright 2014 Globo.com Player authors. All rights reserved.
1
+ // This work is based on the original work of the following authors:
2
+ // Copyright 2014 Globo.com Player authors. All rights reserved.
2
3
  // Use of this source code is governed by a BSD-style
3
4
  // license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE.
4
5
  import { ContainerPlugin, Events, Playback } from '@clappr/core';
@@ -6,7 +7,7 @@ import { trace } from '@gcorevideo/utils';
6
7
  import { CLAPPR_VERSION } from '../../build.js';
7
8
  const T = 'plugins.click_to_pause_custom';
8
9
  /**
9
- * `PLUGIN` that adds a behavior of toggling the playback state on click over the container
10
+ * A small `PLUGIN` that toggles the playback state on click over the video container
10
11
  * @beta
11
12
  */
12
13
  export class ClickToPause extends ContainerPlugin {
@@ -97,7 +97,7 @@ export class DvrControls extends UICorePlugin {
97
97
  this.$el.html(DvrControls.template({
98
98
  i18n: this.core.i18n,
99
99
  }));
100
- mediaControl.putElement('dvr', this.el);
100
+ mediaControl.putElement('dvr', this.$el);
101
101
  return this;
102
102
  }
103
103
  }
@@ -1,8 +1,18 @@
1
1
  import { UICorePlugin } from '@clappr/core';
2
2
  import '../../../assets/error-screen/error_screen.scss';
3
3
  /**
4
- * Configuration options for the {@link ErrorScreen | error screen} plugin.
5
- * @beta
4
+ * Settings for the {@link ErrorScreen} plugin.
5
+ * @public
6
+ */
7
+ export type ErrorScreenSettings = {
8
+ /**
9
+ * Whether to hide the reload button. The reload button triggers reload of the current source.
10
+ */
11
+ noReload?: boolean;
12
+ };
13
+ /**
14
+ * Configuration options for the {@link ErrorScreen} plugin.
15
+ * @public
6
16
  */
7
17
  export type ErrorScreenPluginSettings = {
8
18
  /**
@@ -11,8 +21,23 @@ export type ErrorScreenPluginSettings = {
11
21
  noReload?: boolean;
12
22
  };
13
23
  /**
14
- * `PLUGIN` that displays errors nicely in the overlay on top of the player.
15
- * @beta
24
+ * `PLUGIN` that displays fatal errors nicely in the overlay on top of the player.
25
+ * @public
26
+ * @remarks
27
+ * A fatal error is an error that prevents the player from playing the content.
28
+ * It's usually a network error that persists after multiple retries.
29
+ *
30
+ * The error screen should not be confused with the content stub that is shown when no media sources are available.
31
+ * This can happen due to the lack of the support of the given sources type or because the sources are misconfigured (e.g., omitted).
32
+ *
33
+ * Configuration options - {@link ErrorScreenPluginSettings}
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * import { ErrorScreen, Player } from '@gcorevideo/player'
38
+ *
39
+ * Player.registerPlugin(ErrorScreen)
40
+ * ```
16
41
  */
17
42
  export declare class ErrorScreen extends UICorePlugin {
18
43
  private err;
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorScreen.d.ts","sourceRoot":"","sources":["../../../src/plugins/error-screen/ErrorScreen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoB,MAAM,cAAc,CAAA;AAO7D,OAAO,gDAAgD,CAAA;AAUvD;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAID;;;GAGG;AACH,qBAAa,WAAY,SAAQ,YAAY;IAC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AAwB;IAqBhC,OAAO,CAAC,OAAO;IAgBf;;OAEG;IACM,MAAM;CAkBhB"}
@@ -6,8 +6,23 @@ import templateHtml from '../../../assets/error-screen/error_screen.ejs';
6
6
  import '../../../assets/error-screen/error_screen.scss';
7
7
  const T = 'plugins.error_screen';
8
8
  /**
9
- * `PLUGIN` that displays errors nicely in the overlay on top of the player.
10
- * @beta
9
+ * `PLUGIN` that displays fatal errors nicely in the overlay on top of the player.
10
+ * @public
11
+ * @remarks
12
+ * A fatal error is an error that prevents the player from playing the content.
13
+ * It's usually a network error that persists after multiple retries.
14
+ *
15
+ * The error screen should not be confused with the content stub that is shown when no media sources are available.
16
+ * This can happen due to the lack of the support of the given sources type or because the sources are misconfigured (e.g., omitted).
17
+ *
18
+ * Configuration options - {@link ErrorScreenPluginSettings}
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * import { ErrorScreen, Player } from '@gcorevideo/player'
23
+ *
24
+ * Player.registerPlugin(ErrorScreen)
25
+ * ```
11
26
  */
12
27
  export class ErrorScreen extends UICorePlugin {
13
28
  err = null;