@playkit-js/hotspots 3.1.7 → 3.1.8-canary.0-b1a4e2c
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/CHANGELOG.md +7 -0
- package/dist/playkit-hotspots.js +1 -1
- package/dist/playkit-hotspots.js.map +1 -1
- package/package.json +4 -2
- package/src/hotspots-plugin.tsx +11 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playkit-js/hotspots",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.8-canary.0-b1a4e2c",
|
|
4
4
|
"private": false,
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/kaltura/playkit-js-hotspots/issues"
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@playkit-js/kaltura-player-js": "canary",
|
|
18
|
+
"@playkit-js/ui-managers": "1.4.3-canary.0-b33eab0",
|
|
18
19
|
"conventional-github-releaser": "3.1.3",
|
|
19
20
|
"cross-env": "^7.0.3",
|
|
20
21
|
"css-loader": "^6.7.1",
|
|
@@ -82,7 +83,8 @@
|
|
|
82
83
|
"kaltura": {
|
|
83
84
|
"name": "playkit-js-hotspots",
|
|
84
85
|
"dependencies": {
|
|
85
|
-
"playkit-kaltura-cuepoints": "3.0.6"
|
|
86
|
+
"playkit-kaltura-cuepoints": "3.0.6",
|
|
87
|
+
"@playkit-js/ui-managers": "1.4.1"
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
}
|
package/src/hotspots-plugin.tsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import {h, ComponentChildren} from 'preact';
|
|
2
|
-
import {
|
|
2
|
+
import {FloatingItem, FloatingManager, FloatingItemProps} from '@playkit-js/ui-managers';
|
|
3
|
+
|
|
4
|
+
import {ContribServices, CuePoint, TimedMetadataEvent} from '@playkit-js/common';
|
|
3
5
|
import {RawLayoutHotspot, LayoutHotspot, Canvas, RawFloatingCuepoint, Layout} from './utils/hotspot';
|
|
4
6
|
import HotspotWrapper from './components/HotspotWrapper';
|
|
5
7
|
import {ScaleCalculation, scaleVideo} from './utils/scale-video';
|
|
@@ -29,7 +31,6 @@ export class HotspotsPlugin extends KalturaPlayer.core.BasePlugin {
|
|
|
29
31
|
static defaultConfig: HotspotsPluginConfig = {};
|
|
30
32
|
|
|
31
33
|
private _player: KalturaPlayerTypes.Player;
|
|
32
|
-
private _contribServices: ContribServices;
|
|
33
34
|
private _hotspots: LayoutHotspot[] = [];
|
|
34
35
|
private _floatingItem: FloatingItem | null = null;
|
|
35
36
|
private _canvas: Canvas | null = null;
|
|
@@ -37,19 +38,18 @@ export class HotspotsPlugin extends KalturaPlayer.core.BasePlugin {
|
|
|
37
38
|
constructor(name: string, player: KalturaPlayerTypes.Player, config: HotspotsPluginConfig) {
|
|
38
39
|
super(name, player, config);
|
|
39
40
|
this._player = player;
|
|
40
|
-
this._contribServices = ContribServices.get({kalturaPlayer: this._player});
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
static isValid(): boolean {
|
|
44
44
|
return true;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
get
|
|
48
|
-
return this.
|
|
47
|
+
private get floatingManager(): FloatingManager {
|
|
48
|
+
return (this.player.getService('floatingManager') as FloatingManager) || {};
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
return this.
|
|
51
|
+
get cuePointManager() {
|
|
52
|
+
return this._player.getService('kalturaCuepoints') as any;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
loadMedia(): void {
|
|
@@ -142,10 +142,10 @@ export class HotspotsPlugin extends KalturaPlayer.core.BasePlugin {
|
|
|
142
142
|
};
|
|
143
143
|
|
|
144
144
|
private _addHotspotsContainer(): void {
|
|
145
|
-
this._floatingItem = this.
|
|
145
|
+
this._floatingItem = this.floatingManager.add({
|
|
146
146
|
label: 'Hotspots',
|
|
147
|
-
mode:
|
|
148
|
-
position:
|
|
147
|
+
mode: 'MediaLoaded',
|
|
148
|
+
position: 'VideoArea',
|
|
149
149
|
renderContent: this._renderRoot
|
|
150
150
|
});
|
|
151
151
|
}
|
|
@@ -199,7 +199,7 @@ export class HotspotsPlugin extends KalturaPlayer.core.BasePlugin {
|
|
|
199
199
|
this._hotspots = [];
|
|
200
200
|
this._canvas = null;
|
|
201
201
|
if (this._floatingItem) {
|
|
202
|
-
this.
|
|
202
|
+
this.floatingManager.remove(this._floatingItem);
|
|
203
203
|
this._floatingItem = null;
|
|
204
204
|
}
|
|
205
205
|
}
|