@gcorevideo/player 2.20.3 → 2.20.4
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/dist/core.js +30 -6
- package/dist/index.css +859 -859
- package/dist/index.js +39 -10
- package/dist/player.d.ts +10 -0
- package/dist/plugins/index.css +954 -954
- package/dist/plugins/index.js +10 -5
- package/docs/api/player.contextmenupluginsettings.label.md +3 -0
- package/docs/api/player.contextmenupluginsettings.md +8 -3
- package/docs/api/player.contextmenupluginsettings.preventshowcontextmenu.md +3 -0
- package/docs/api/player.contextmenupluginsettings.url.md +3 -0
- package/docs/api/player.md +6 -2
- package/docs/api/player.multicamera._constructor_.md +3 -0
- package/docs/api/player.multicamera.activebyid.md +3 -0
- package/docs/api/player.multicamera.attributes.md +3 -0
- package/docs/api/player.multicamera.bindevents.md +3 -0
- package/docs/api/player.multicamera.events.md +3 -0
- package/docs/api/player.multicamera.getcameraslist.md +3 -0
- package/docs/api/player.multicamera.getcurrentcamera.md +3 -0
- package/docs/api/player.multicamera.md +28 -1
- package/docs/api/player.multicamera.name.md +3 -0
- package/docs/api/player.multicamera.render.md +3 -0
- package/docs/api/player.multicamera.supportedversion.md +3 -0
- package/docs/api/player.multicamera.template.md +3 -0
- package/docs/api/player.multicamera.unbindevents.md +3 -0
- package/docs/api/player.multicamera.version.md +3 -0
- package/docs/api/player.volumefadeevents.md +7 -0
- package/docs/api/player.zeptoresult.md +1 -0
- package/lib/Player.d.ts +5 -3
- package/lib/Player.d.ts.map +1 -1
- package/lib/Player.js +30 -6
- package/lib/internal.types.d.ts +7 -7
- package/lib/internal.types.d.ts.map +1 -1
- package/lib/plugins/context-menu/ContextMenu.d.ts +4 -0
- package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -1
- package/lib/plugins/multi-camera/MultiCamera.d.ts +1 -0
- package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -1
- package/lib/plugins/multi-camera/MultiCamera.js +3 -2
- package/lib/plugins/seek-time/SeekTime.js +1 -1
- package/lib/plugins/share/Share.js +1 -1
- package/lib/plugins/volume-fade/VolumeFade.d.ts +4 -0
- package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -1
- package/lib/plugins/volume-fade/VolumeFade.js +4 -0
- package/lib/types.d.ts +9 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/utils/types.d.ts +1 -0
- package/lib/utils/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/release_notes +297 -0
- package/src/Player.ts +101 -46
- package/src/__tests__/Player.test.ts +23 -1
- package/src/internal.types.ts +86 -79
- package/src/plugins/context-menu/ContextMenu.ts +4 -0
- package/src/plugins/multi-camera/MultiCamera.ts +3 -2
- package/src/plugins/seek-time/SeekTime.ts +1 -1
- package/src/plugins/share/Share.ts +1 -1
- package/src/plugins/volume-fade/VolumeFade.ts +4 -0
- package/src/types.ts +11 -1
- package/src/utils/types.ts +1 -0
- package/temp/player.api.json +24 -24
- package/tsconfig.tsbuildinfo +1 -1
package/dist/index.js
CHANGED
|
@@ -42494,7 +42494,7 @@ class Player {
|
|
|
42494
42494
|
Log.setLevel(0);
|
|
42495
42495
|
}
|
|
42496
42496
|
const coreOpts = this.buildCoreOptions(playerElement);
|
|
42497
|
-
const { core, container } =
|
|
42497
|
+
const { core, container } = Player.getRegisteredPlugins();
|
|
42498
42498
|
trace(`${T$d} init`, {
|
|
42499
42499
|
registeredPlaybacks: Loader.registeredPlaybacks.map((p) => p.name),
|
|
42500
42500
|
});
|
|
@@ -42656,13 +42656,35 @@ class Player {
|
|
|
42656
42656
|
* ```
|
|
42657
42657
|
*/
|
|
42658
42658
|
static registerPlugin(plugin) {
|
|
42659
|
+
assert.ok(plugin.type === 'core' || plugin.type === 'container', 'Invalid plugin type');
|
|
42660
|
+
if (plugin.type === 'core') {
|
|
42661
|
+
if (plugin.prototype.name === 'media_control') {
|
|
42662
|
+
Player.corePlugins.unshift(plugin);
|
|
42663
|
+
}
|
|
42664
|
+
else {
|
|
42665
|
+
Player.corePlugins.push(plugin);
|
|
42666
|
+
}
|
|
42667
|
+
return;
|
|
42668
|
+
}
|
|
42659
42669
|
Loader.registerPlugin(plugin);
|
|
42660
42670
|
}
|
|
42671
|
+
static getRegisteredPlugins() {
|
|
42672
|
+
for (const plugin of Player.corePlugins) {
|
|
42673
|
+
Loader.registerPlugin(plugin);
|
|
42674
|
+
}
|
|
42675
|
+
return Loader.registeredPlugins;
|
|
42676
|
+
}
|
|
42677
|
+
static corePlugins = [];
|
|
42661
42678
|
/**
|
|
42662
42679
|
* Unregisters a plugin registered earlier with {@link Player.registerPlugin}.
|
|
42663
42680
|
* @param plugin - a plugin class
|
|
42664
42681
|
*/
|
|
42665
42682
|
static unregisterPlugin(plugin) {
|
|
42683
|
+
assert.ok(plugin.type === 'core' || plugin.type === 'container', 'Invalid plugin type');
|
|
42684
|
+
if (plugin.type === 'core') {
|
|
42685
|
+
Player.corePlugins = Player.corePlugins.filter((p) => p !== plugin);
|
|
42686
|
+
return;
|
|
42687
|
+
}
|
|
42666
42688
|
Loader.unregisterPlugin(plugin);
|
|
42667
42689
|
}
|
|
42668
42690
|
setConfig(config) {
|
|
@@ -42803,8 +42825,10 @@ class Player {
|
|
|
42803
42825
|
}, null);
|
|
42804
42826
|
}
|
|
42805
42827
|
bindCoreListeners() {
|
|
42806
|
-
|
|
42807
|
-
|
|
42828
|
+
// TODO create an class inherited from PlayerClappr
|
|
42829
|
+
assert.ok(this.player, 'Player is not initialized');
|
|
42830
|
+
const core = this.player.core;
|
|
42831
|
+
core.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
|
|
42808
42832
|
trace(`${T$d} on CORE_SCREEN_ORIENTATION_CHANGED`, {
|
|
42809
42833
|
orientation,
|
|
42810
42834
|
rootNode: {
|
|
@@ -42819,14 +42843,14 @@ class Player {
|
|
|
42819
42843
|
});
|
|
42820
42844
|
}
|
|
42821
42845
|
}, null);
|
|
42822
|
-
core
|
|
42846
|
+
core.on(Events$1.CORE_RESIZE, ({ width, height }) => {
|
|
42823
42847
|
trace(`${T$d} on CORE_RESIZE`, {
|
|
42824
42848
|
width,
|
|
42825
42849
|
height,
|
|
42826
42850
|
});
|
|
42827
42851
|
this.safeTriggerEvent(PlayerEvent.Resize, { width, height });
|
|
42828
42852
|
}, null);
|
|
42829
|
-
core
|
|
42853
|
+
core.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
|
|
42830
42854
|
trace(`${T$d} CORE_FULLSCREEN`, {
|
|
42831
42855
|
isFullscreen,
|
|
42832
42856
|
});
|
|
@@ -42835,7 +42859,7 @@ class Player {
|
|
|
42835
42859
|
}
|
|
42836
42860
|
}
|
|
42837
42861
|
|
|
42838
|
-
var version$1 = "2.20.
|
|
42862
|
+
var version$1 = "2.20.4";
|
|
42839
42863
|
|
|
42840
42864
|
var packages = {
|
|
42841
42865
|
"node_modules/@clappr/core": {
|
|
@@ -48961,9 +48985,10 @@ const streamsMomentoIcon = "<svg id=\"Слой_1\" data-name=\"Слой 1\" xmln
|
|
|
48961
48985
|
const streamsWhiteNightsIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"50\" height=\"50\" viewBox=\"0 0 50 50\">\n <defs>\n <clipPath id=\"clip-Icon\">\n <rect width=\"50\" height=\"50\"/>\n </clipPath>\n </defs>\n <g id=\"Icon\" clip-path=\"url(#clip-Icon)\">\n <g id=\"icon2\" transform=\"translate(-0.041 0)\">\n <path id=\"Контур_77\" data-name=\"Контур 77\" d=\"M6.493,13v8.266h6.275V19.74H8.31V17.714h4.006V16.3H8.31V14.53h4.365V13Zm7.5,0v8.266h1.7V15.732h.023l3.438,5.534h1.818V13h-1.7v5.545h-.023L15.8,13Z\" fill=\"#fff\"/>\n <path id=\"Контур_76\" data-name=\"Контур 76\" d=\"M29.949,29.1V26.774H31.94a1.4,1.4,0,0,1,.938.272,1.1,1.1,0,0,1,.313.874,1.155,1.155,0,0,1-.313.9,1.375,1.375,0,0,1-.938.278ZM28.132,25.36v8.266h1.817V30.4h1.818a1.353,1.353,0,0,1,.984.3,1.637,1.637,0,0,1,.394.949c.046.333.079.681.1,1.042a3.2,3.2,0,0,0,.185.938h1.819a1.218,1.218,0,0,1-.191-.423,3.611,3.611,0,0,1-.093-.527c-.019-.185-.033-.367-.041-.544s-.016-.332-.023-.463a5.052,5.052,0,0,0-.087-.625,2.109,2.109,0,0,0-.2-.573,1.586,1.586,0,0,0-.359-.451,1.414,1.414,0,0,0-.556-.284v-.023a1.926,1.926,0,0,0,1-.81,2.494,2.494,0,0,0,.307-1.262,2.308,2.308,0,0,0-.165-.88,2.128,2.128,0,0,0-.486-.724,2.3,2.3,0,0,0-.764-.492,2.67,2.67,0,0,0-1-.179ZM43.506,30.5V25.36H41.689V30.5a2.065,2.065,0,0,1-.37,1.36,1.7,1.7,0,0,1-1.343.434,2.086,2.086,0,0,1-.886-.156,1.283,1.283,0,0,1-.758-.978,3.748,3.748,0,0,1-.058-.66V25.36H36.456V30.5a3.16,3.16,0,0,0,.92,2.5,3.807,3.807,0,0,0,2.6.81,3.82,3.82,0,0,0,2.593-.816,3.132,3.132,0,0,0,.937-2.492Z\" fill=\"#fff\"/>\n <path id=\"Контур_80\" data-name=\"Контур 80\" d=\"M22.646,31.2H4.689a4.505,4.505,0,0,1-4.5-4.5V8.5A4.505,4.505,0,0,1,4.689,4h18.2a4.505,4.505,0,0,1,4.5,4.5v8.445l-.893.1a3.184,3.184,0,0,0-2.846,3.177V30.5l-.465.7ZM4.689,6a2.5,2.5,0,0,0-2.5,2.5V26.7a2.5,2.5,0,0,0,2.5,2.5H21.65V20.22a5.18,5.18,0,0,1,3.739-4.992V8.5a2.5,2.5,0,0,0-2.5-2.5Z\" fill=\"#fff\"/>\n <path id=\"Контур_81\" data-name=\"Контур 81\" d=\"M30.127,47.884a1,1,0,0,1-1-1V43.267H26.846a5.206,5.206,0,0,1-5.2-5.2V20.222a5.206,5.206,0,0,1,5.2-5.2H44.692a5.206,5.206,0,0,1,5.2,5.2V38.068a5.206,5.206,0,0,1-5.2,5.2H35.058l-4.216,4.316A1,1,0,0,1,30.127,47.884ZM26.846,17.022a3.2,3.2,0,0,0-3.2,3.2V38.067a3.2,3.2,0,0,0,3.2,3.2h3.281a1,1,0,0,1,1,1v2.162l2.8-2.86a1,1,0,0,1,.715-.3H44.692a3.2,3.2,0,0,0,3.2-3.2V20.222a3.2,3.2,0,0,0-3.2-3.2Z\" fill=\"#fff\"/>\n </g>\n </g>\n</svg>\n";
|
|
48962
48986
|
|
|
48963
48987
|
const VERSION$3 = '0.0.1';
|
|
48964
|
-
const T$7 = 'plugins.
|
|
48988
|
+
const T$7 = 'plugins.multicamera';
|
|
48965
48989
|
/**
|
|
48966
48990
|
* The plugin adds support for loading multiple streams and switching between them using the media control UI.
|
|
48991
|
+
* @beta
|
|
48967
48992
|
*/
|
|
48968
48993
|
class MultiCamera extends UICorePlugin {
|
|
48969
48994
|
currentCamera = null;
|
|
@@ -48972,7 +48997,7 @@ class MultiCamera extends UICorePlugin {
|
|
|
48972
48997
|
multicamera = [];
|
|
48973
48998
|
noActiveStreams = false;
|
|
48974
48999
|
get name() {
|
|
48975
|
-
return '
|
|
49000
|
+
return 'multicamera';
|
|
48976
49001
|
}
|
|
48977
49002
|
get supportedVersion() {
|
|
48978
49003
|
return { min: CLAPPR_VERSION };
|
|
@@ -49927,7 +49952,7 @@ const { formatTime } = Utils;
|
|
|
49927
49952
|
*/
|
|
49928
49953
|
class SeekTime extends UICorePlugin {
|
|
49929
49954
|
get name() {
|
|
49930
|
-
return '
|
|
49955
|
+
return 'seek_time';
|
|
49931
49956
|
}
|
|
49932
49957
|
get supportedVersion() {
|
|
49933
49958
|
return { min: CLAPPR_VERSION };
|
|
@@ -50088,7 +50113,7 @@ class Share extends UICorePlugin {
|
|
|
50088
50113
|
hide = false;
|
|
50089
50114
|
container = null;
|
|
50090
50115
|
get name() {
|
|
50091
|
-
return '
|
|
50116
|
+
return 'share';
|
|
50092
50117
|
}
|
|
50093
50118
|
get supportedVersion() {
|
|
50094
50119
|
return { min: CLAPPR_VERSION };
|
|
@@ -51731,6 +51756,10 @@ class Thumbnails extends UICorePlugin {
|
|
|
51731
51756
|
}
|
|
51732
51757
|
}
|
|
51733
51758
|
|
|
51759
|
+
/**
|
|
51760
|
+
* Events emitted by the VolumeFade plugin.
|
|
51761
|
+
* @beta
|
|
51762
|
+
*/
|
|
51734
51763
|
var VolumeFadeEvents;
|
|
51735
51764
|
(function (VolumeFadeEvents) {
|
|
51736
51765
|
VolumeFadeEvents["FADE"] = "core:volume:fade";
|
package/dist/player.d.ts
CHANGED
|
@@ -529,6 +529,10 @@ export declare class ContextMenu extends UIContainerPlugin {
|
|
|
529
529
|
private hideOnBodyClick;
|
|
530
530
|
}
|
|
531
531
|
|
|
532
|
+
/**
|
|
533
|
+
* The plugin adds a context menu to the player.
|
|
534
|
+
* @beta
|
|
535
|
+
*/
|
|
532
536
|
export declare interface ContextMenuPluginSettings {
|
|
533
537
|
label?: string;
|
|
534
538
|
url?: string;
|
|
@@ -1218,6 +1222,7 @@ declare type MetricsUpdateFn = (metrics: Metrics) => void;
|
|
|
1218
1222
|
|
|
1219
1223
|
/**
|
|
1220
1224
|
* The plugin adds support for loading multiple streams and switching between them using the media control UI.
|
|
1225
|
+
* @beta
|
|
1221
1226
|
*/
|
|
1222
1227
|
export declare class MultiCamera extends UICorePlugin {
|
|
1223
1228
|
private currentCamera;
|
|
@@ -2670,6 +2675,10 @@ export declare class VolumeFade extends UICorePlugin {
|
|
|
2670
2675
|
private onLeave;
|
|
2671
2676
|
}
|
|
2672
2677
|
|
|
2678
|
+
/**
|
|
2679
|
+
* Events emitted by the VolumeFade plugin.
|
|
2680
|
+
* @beta
|
|
2681
|
+
*/
|
|
2673
2682
|
export declare enum VolumeFadeEvents {
|
|
2674
2683
|
FADE = "core:volume:fade"
|
|
2675
2684
|
}
|
|
@@ -2683,6 +2692,7 @@ export declare interface WatchEventData {
|
|
|
2683
2692
|
}
|
|
2684
2693
|
|
|
2685
2694
|
/**
|
|
2695
|
+
* {@link https://zeptojs.com/#$() | Zepto query result}
|
|
2686
2696
|
* @beta
|
|
2687
2697
|
*/
|
|
2688
2698
|
export declare type ZeptoResult = ReturnType<typeof $>;
|