@gcorevideo/player 2.19.14 → 2.19.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.
Files changed (77) hide show
  1. package/assets/level-selector/list.ejs +2 -2
  2. package/dist/core.js +1 -1
  3. package/dist/index.css +1054 -1054
  4. package/dist/index.js +1232 -1154
  5. package/dist/player.d.ts +157 -22
  6. package/dist/plugins/index.css +634 -634
  7. package/dist/plugins/index.js +1024 -944
  8. package/docs/api/player.bottomgear.getelement.md +56 -0
  9. package/docs/api/player.bottomgear.md +51 -0
  10. package/docs/api/player.bottomgear.setcontent.md +56 -0
  11. package/docs/api/{player.subtitles.levelelement.md → player.gearevents.md} +11 -13
  12. package/docs/api/{player.sourcecontroller.name.md → player.gearitemelement.md} +5 -3
  13. package/docs/api/player.levelselector.md +9 -1
  14. package/docs/api/player.md +37 -0
  15. package/docs/api/{player.sourcecontroller.supportedversion.md → player.mediacontrol.getrightpanel.md} +11 -5
  16. package/docs/api/player.mediacontrol.md +14 -0
  17. package/docs/api/player.mediacontrolelement.md +1 -1
  18. package/docs/api/player.sourcecontroller.md +0 -90
  19. package/docs/api/player.spinnerevents.md +49 -0
  20. package/docs/api/player.spinnerthreebounce._constructor_.md +3 -0
  21. package/docs/api/player.spinnerthreebounce.hide.md +5 -0
  22. package/docs/api/player.spinnerthreebounce.md +14 -95
  23. package/docs/api/player.spinnerthreebounce.show.md +6 -37
  24. package/docs/api/player.subtitles.hide.md +5 -0
  25. package/docs/api/player.subtitles.md +23 -275
  26. package/docs/api/player.subtitles.show.md +5 -0
  27. package/lib/plugins/bottom-gear/BottomGear.d.ts +20 -1
  28. package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
  29. package/lib/plugins/bottom-gear/BottomGear.js +28 -7
  30. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +4 -4
  31. package/lib/plugins/level-selector/LevelSelector.d.ts +10 -3
  32. package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -1
  33. package/lib/plugins/level-selector/LevelSelector.js +20 -19
  34. package/lib/plugins/media-control/MediaControl.d.ts +6 -2
  35. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  36. package/lib/plugins/media-control/MediaControl.js +40 -39
  37. package/lib/plugins/source-controller/SourceController.d.ts +9 -0
  38. package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
  39. package/lib/plugins/source-controller/SourceController.js +11 -1
  40. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts +35 -1
  41. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
  42. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +46 -23
  43. package/lib/plugins/subtitles/Subtitles.d.ts +65 -16
  44. package/lib/plugins/subtitles/Subtitles.d.ts.map +1 -1
  45. package/lib/plugins/subtitles/Subtitles.js +131 -109
  46. package/package.json +1 -1
  47. package/src/plugins/bottom-gear/BottomGear.ts +26 -4
  48. package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +4 -4
  49. package/src/plugins/level-selector/LevelSelector.ts +22 -19
  50. package/src/plugins/media-control/MediaControl.ts +43 -41
  51. package/src/plugins/source-controller/SourceController.ts +11 -1
  52. package/src/plugins/source-controller/__tests__/SourceController.test.ts +1 -1
  53. package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +46 -22
  54. package/src/plugins/subtitles/Subtitles.ts +146 -155
  55. package/temp/player.api.json +293 -822
  56. package/tsconfig.tsbuildinfo +1 -1
  57. package/docs/api/player.sourcecontroller.version.md +0 -14
  58. package/docs/api/player.spinnerthreebounce.attributes.md +0 -14
  59. package/docs/api/player.spinnerthreebounce.name.md +0 -11
  60. package/docs/api/player.spinnerthreebounce.render.md +0 -15
  61. package/docs/api/player.spinnerthreebounce.supportedversion.md +0 -13
  62. package/docs/api/player.subtitles.attributes.md +0 -14
  63. package/docs/api/player.subtitles.bindevents.md +0 -15
  64. package/docs/api/player.subtitles.buttonelement.md +0 -15
  65. package/docs/api/player.subtitles.events.md +0 -14
  66. package/docs/api/player.subtitles.name.md +0 -11
  67. package/docs/api/player.subtitles.preselectedlanguage.md +0 -11
  68. package/docs/api/player.subtitles.reload.md +0 -15
  69. package/docs/api/player.subtitles.render.md +0 -15
  70. package/docs/api/player.subtitles.selectsubtitles.md +0 -15
  71. package/docs/api/player.subtitles.startlevelswitch.md +0 -15
  72. package/docs/api/player.subtitles.stoplevelswitch.md +0 -15
  73. package/docs/api/player.subtitles.supportedversion.md +0 -13
  74. package/docs/api/player.subtitles.template.md +0 -11
  75. package/docs/api/player.subtitles.templatestring.md +0 -11
  76. package/docs/api/player.subtitles.unbindevents.md +0 -15
  77. package/docs/api/player.subtitles.version.md +0 -11
package/dist/player.d.ts CHANGED
@@ -121,6 +121,10 @@ declare type BitrateTrackRecord = {
121
121
  * @beta
122
122
  * @remarks
123
123
  * The plugins provides a base for attaching custom settings UI in the gear menu
124
+ *
125
+ * Depends on:
126
+ *
127
+ * - {@link MediaControl | media_control}
124
128
  */
125
129
  export declare class BottomGear extends UICorePlugin {
126
130
  private isHd;
@@ -156,6 +160,16 @@ export declare class BottomGear extends UICorePlugin {
156
160
  * @internal
157
161
  */
158
162
  bindEvents(): void;
163
+ /**
164
+ * @param name - Name of a gear menu placeholder item to attach custom UI
165
+ * @returns Zepto result of the element
166
+ */
167
+ getElement(name: GearItemElement): ZeptoResult | null;
168
+ /**
169
+ * Replaces the content of the gear menu
170
+ * @param content - Zepto result of the element
171
+ */
172
+ setContent(content: ZeptoResult): void;
159
173
  private onActiveContainerChanged;
160
174
  private bindContainerEvents;
161
175
  private highDefinitionUpdate;
@@ -199,7 +213,7 @@ export declare class ClapprNerdStats extends UICorePlugin {
199
213
  constructor(core: Core);
200
214
  bindEvents(): void;
201
215
  private init;
202
- private showOrHide;
216
+ private toggle;
203
217
  private show;
204
218
  private hide;
205
219
  private onPlayerResize;
@@ -486,6 +500,22 @@ export declare class Favicon extends CorePlugin {
486
500
  private changeIcon;
487
501
  }
488
502
 
503
+ /**
504
+ * Custom events emitted by the plugin
505
+ */
506
+ export declare enum GearEvents {
507
+ /**
508
+ * Emitted when the gear menu is rendered
509
+ */
510
+ MEDIACONTROL_GEAR_RENDERED = "mediacontrol:gear:rendered"
511
+ }
512
+
513
+ /**
514
+ * An element inside the gear menu
515
+ * @beta
516
+ */
517
+ export declare type GearItemElement = 'quality' | 'rate' | 'nerd';
518
+
489
519
  export declare class GoogleAnalytics extends ContainerPlugin {
490
520
  private account;
491
521
  private trackerName;
@@ -552,7 +582,14 @@ export declare type LangTag = string;
552
582
  * @beta
553
583
  *
554
584
  * @remarks
555
- * The plugin is rendered as a button in the {@link BottomGear | gear menu}.
585
+ * Depends on:
586
+ *
587
+ * - {@link MediaControl}
588
+ *
589
+ * - {@link BottomGear}
590
+ *
591
+ * The plugin is rendered as an item in the gear menu.
592
+ *
556
593
  * When clicked, it shows a list of quality levels to choose from.
557
594
  *
558
595
  * Configuration options:
@@ -577,8 +614,8 @@ export declare class LevelSelector extends UICorePlugin {
577
614
  private removeAuto;
578
615
  private isHd;
579
616
  private isOpen;
580
- private buttonTemplate;
581
- private listTemplate;
617
+ private static readonly buttonTemplate;
618
+ private static readonly listTemplate;
582
619
  /**
583
620
  * @internal
584
621
  */
@@ -869,7 +906,6 @@ export declare class MediaControl extends UICorePlugin {
869
906
  private hide;
870
907
  private updateCursorStyle;
871
908
  private settingsUpdate;
872
- private getSettings;
873
909
  private highDefinitionUpdate;
874
910
  private createCachedElements;
875
911
  /**
@@ -891,6 +927,11 @@ export declare class MediaControl extends UICorePlugin {
891
927
  * ```
892
928
  */
893
929
  getElement(name: MediaControlElement): ZeptoResult | null;
930
+ /**
931
+ * Get the right panel area to append custom elements to
932
+ * @returns ZeptoSelector of the right panel element
933
+ */
934
+ getRightPanel(): any;
894
935
  private resetIndicators;
895
936
  private initializeIcons;
896
937
  private setSeekPercentage;
@@ -930,7 +971,7 @@ export declare class MediaControl extends UICorePlugin {
930
971
  * Media control elements, mount points for additional plugins
931
972
  * @beta
932
973
  */
933
- export declare type MediaControlElement = 'bottomGear' | 'clipText' | 'pip' | 'playbackRate' | 'seekBarContainer';
974
+ export declare type MediaControlElement = 'bottomGear' | 'clipText' | 'gear' | 'pip' | 'playbackRate' | 'seekBarContainer' | 'subtitlesSelector';
934
975
 
935
976
  declare type MediaSourceInfo = {
936
977
  live: boolean;
@@ -1827,7 +1868,13 @@ export declare class SourceController extends CorePlugin {
1827
1868
  private sourcesDelay;
1828
1869
  private active;
1829
1870
  private sync;
1871
+ /**
1872
+ * @internal
1873
+ */
1830
1874
  get name(): string;
1875
+ /**
1876
+ * @internal
1877
+ */
1831
1878
  get supportedVersion(): {
1832
1879
  min: string;
1833
1880
  };
@@ -1841,14 +1888,43 @@ export declare class SourceController extends CorePlugin {
1841
1888
  private reset;
1842
1889
  private retryPlayback;
1843
1890
  private getNextMediaSource;
1891
+ /**
1892
+ * @internal
1893
+ */
1844
1894
  static get version(): string;
1845
1895
  }
1846
1896
 
1897
+ /**
1898
+ * Custom events emitted by the plugin
1899
+ */
1900
+ export declare enum SpinnerEvents {
1901
+ /**
1902
+ * Emitted at the end of the spinner animation cycle to facilitate smooth UI updates,
1903
+ * e.g. {@link SourceController} listens to this event to reload the source when the spinner is hidden
1904
+ */
1905
+ SYNC = "plugins:spinner:sync"
1906
+ }
1907
+
1908
+ /**
1909
+ * Shows a pending operation indicator when playback is buffering or in other appropriate cases
1910
+ * @beta
1911
+ * @remarks
1912
+ * The plugin emits
1913
+ */
1847
1914
  export declare class SpinnerThreeBounce extends UIContainerPlugin {
1915
+ /**
1916
+ * @internal
1917
+ */
1848
1918
  get name(): string;
1919
+ /**
1920
+ * @internal
1921
+ */
1849
1922
  get supportedVersion(): {
1850
1923
  min: string;
1851
1924
  };
1925
+ /**
1926
+ * @internal
1927
+ */
1852
1928
  get attributes(): {
1853
1929
  'data-spinner': string;
1854
1930
  class: string;
@@ -1863,8 +1939,17 @@ export declare class SpinnerThreeBounce extends UIContainerPlugin {
1863
1939
  private onPlay;
1864
1940
  private onStop;
1865
1941
  private onError;
1866
- show(immediate?: boolean): void;
1942
+ /**
1943
+ * Shows the spinner
1944
+ */
1945
+ show(): void;
1946
+ /**
1947
+ * Hides the spinner
1948
+ */
1867
1949
  hide(): void;
1950
+ /**
1951
+ * @internal
1952
+ */
1868
1953
  render(): this;
1869
1954
  }
1870
1955
 
@@ -1912,45 +1997,95 @@ declare type StatisticsRecord = {
1912
1997
  type: PlaybackType;
1913
1998
  } & StatisticsEventData;
1914
1999
 
2000
+ /**
2001
+ * A {@link MediaControl | media control} plugin that provides a UI to select the subtitles when available.
2002
+ * @beta
2003
+ *
2004
+ * @remarks
2005
+ * Depends on:
2006
+ *
2007
+ * - {@link MediaControl}
2008
+ *
2009
+ * Configuration options:
2010
+ *
2011
+ * - subtitles.language - The language of the subtitles to select by default.
2012
+ *
2013
+ * @example
2014
+ * ```ts
2015
+ * import { Subtitles } from '@gcorevideo/player'
2016
+ *
2017
+ * Player.registerPlugin(Subtitles)
2018
+ *
2019
+ * new Player({
2020
+ * ...
2021
+ * subtitles: {
2022
+ * language: 'en',
2023
+ * },
2024
+ * })
2025
+ * ```
2026
+ */
1915
2027
  export declare class Subtitles extends UICorePlugin {
1916
- private currentContainer;
1917
2028
  private currentLevel;
1918
- private currentPlayback;
2029
+ private isPreselectedApplied;
1919
2030
  private isShowing;
2031
+ private track;
1920
2032
  private tracks;
1921
2033
  private $string;
2034
+ /**
2035
+ * @internal
2036
+ */
1922
2037
  get name(): string;
2038
+ /**
2039
+ * @internal
2040
+ */
1923
2041
  get supportedVersion(): {
1924
2042
  min: string;
1925
2043
  };
2044
+ /**
2045
+ * @internal
2046
+ */
1926
2047
  static get version(): string;
1927
- get template(): any;
1928
- get templateString(): any;
2048
+ private static readonly template;
2049
+ private static readonly templateString;
2050
+ /**
2051
+ * @internal
2052
+ */
1929
2053
  get attributes(): {
1930
2054
  class: string;
1931
2055
  'data-subtitles': string;
1932
2056
  };
2057
+ /**
2058
+ * @internal
2059
+ */
1933
2060
  get events(): {
1934
2061
  'click [data-subtitles-select]': string;
1935
2062
  'click [data-subtitles-button]': string;
1936
2063
  };
1937
- private isPreselectedApplied;
1938
- private track;
1939
- get preselectedLanguage(): string;
2064
+ private get preselectedLanguage();
2065
+ /**
2066
+ * @internal
2067
+ */
1940
2068
  bindEvents(): void;
1941
- unBindEvents(): void;
1942
2069
  private bindPlaybackEvents;
1943
2070
  private getTracks;
1944
2071
  private onStartAd;
1945
2072
  private onFinishAd;
1946
- reload(): void;
1947
2073
  private playerResize;
2074
+ /**
2075
+ * Hides the subtitles menu and the subtitles.
2076
+ */
1948
2077
  hide(): void;
2078
+ /**
2079
+ * Shows the subtitles menu and the subtitles.
2080
+ */
1949
2081
  show(): void;
1950
2082
  private shouldRender;
1951
2083
  private resizeFont;
2084
+ /**
2085
+ * @internal
2086
+ */
1952
2087
  render(): this;
1953
- private fillLevels;
2088
+ private setTracks;
1954
2089
  private findLevelBy;
1955
2090
  private selectLevel;
1956
2091
  private onLevelSelect;
@@ -1958,11 +2093,11 @@ export declare class Subtitles extends UICorePlugin {
1958
2093
  private onShowLevelSelectMenu;
1959
2094
  private hideSelectLevelMenu;
1960
2095
  private toggleContextMenu;
1961
- buttonElement(): ZeptoResult;
1962
- levelElement(id?: string): ZeptoResult;
1963
- startLevelSwitch(): void;
1964
- stopLevelSwitch(): void;
1965
- selectSubtitles(): void;
2096
+ private buttonElement;
2097
+ private levelElement;
2098
+ private startLevelSwitch;
2099
+ private stopLevelSwitch;
2100
+ private selectSubtitles;
1966
2101
  private setSubtitleText;
1967
2102
  private clearSubtitleText;
1968
2103
  private updateCurrentLevel;