@vouchfor/embeds 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/es/{browser-4d54600e.js → browser-97265c29.js} +2 -2
- package/dist/es/{browser-4d54600e.js.map → browser-97265c29.js.map} +1 -1
- package/dist/es/embeds.js +1 -1
- package/dist/es/{index-14868944.js → index-d15aeb56.js} +632 -640
- package/dist/es/index-d15aeb56.js.map +1 -0
- package/dist/es/src/components/PlayerEmbed/index.d.ts +73 -0
- package/dist/iife/dialog-embed/{browser-d8ab928d.js → browser-c8adca59.js} +2 -2
- package/dist/iife/dialog-embed/{browser-d8ab928d.js.map → browser-c8adca59.js.map} +1 -1
- package/dist/iife/dialog-embed/embed.iife.js +38 -38
- package/dist/iife/dialog-embed/embed.iife.js.map +1 -1
- package/dist/iife/dialog-embed/embed.js +1 -1
- package/dist/iife/dialog-embed/{index-568f189c.js → index-eb3ec3b3.js} +667 -675
- package/dist/iife/dialog-embed/index-eb3ec3b3.js.map +1 -0
- package/dist/iife/dialog-embed/src/components/PlayerEmbed/index.d.ts +73 -0
- package/dist/iife/embeds.iife.js +38 -38
- package/dist/iife/embeds.iife.js.map +1 -1
- package/dist/iife/player-embed/{browser-951710ee.js → browser-7e2003a9.js} +2 -2
- package/dist/iife/player-embed/{browser-951710ee.js.map → browser-7e2003a9.js.map} +1 -1
- package/dist/iife/player-embed/embed.iife.js +34 -34
- package/dist/iife/player-embed/embed.iife.js.map +1 -1
- package/dist/iife/player-embed/embed.js +1 -1
- package/dist/iife/player-embed/{index-86dfade0.js → index-4541048e.js} +3343 -3351
- package/dist/iife/player-embed/index-4541048e.js.map +1 -0
- package/dist/iife/player-embed/src/components/PlayerEmbed/index.d.ts +73 -0
- package/package.json +2 -2
- package/src/components/PlayerEmbed/index.ts +106 -5
- package/dist/es/index-14868944.js.map +0 -1
- package/dist/iife/dialog-embed/index-568f189c.js.map +0 -1
- package/dist/iife/player-embed/index-86dfade0.js.map +0 -1
- package/src/mixins/media-player-proxy.ts +0 -116
@@ -1,116 +0,0 @@
|
|
1
|
-
import { createRef } from 'lit/directives/ref.js';
|
2
|
-
|
3
|
-
import type { Scene, Scenes } from '@vouchfor/canvas-video';
|
4
|
-
import type { MediaPlayer } from '@vouchfor/media-player';
|
5
|
-
import type { LitElement } from 'lit';
|
6
|
-
|
7
|
-
type Constructor<T = Record<string, never>> = new (...args: any[]) => T;
|
8
|
-
|
9
|
-
const MediaPlayerProxy = <T extends Constructor<LitElement>>(SuperClass: T) => {
|
10
|
-
class MediaPlayerProxyClass extends SuperClass {
|
11
|
-
protected _mediaPlayerRef = createRef<MediaPlayer>();
|
12
|
-
|
13
|
-
get waiting() {
|
14
|
-
return this._mediaPlayerRef.value?.waiting;
|
15
|
-
}
|
16
|
-
|
17
|
-
get initialised() {
|
18
|
-
return this._mediaPlayerRef.value?.initialised;
|
19
|
-
}
|
20
|
-
|
21
|
-
get seeking() {
|
22
|
-
return this._mediaPlayerRef.value?.seeking;
|
23
|
-
}
|
24
|
-
|
25
|
-
get paused() {
|
26
|
-
return this._mediaPlayerRef.value?.paused;
|
27
|
-
}
|
28
|
-
|
29
|
-
get captions() {
|
30
|
-
return this._mediaPlayerRef.value?.captions;
|
31
|
-
}
|
32
|
-
|
33
|
-
get fullscreen() {
|
34
|
-
return this._mediaPlayerRef.value?.fullscreen;
|
35
|
-
}
|
36
|
-
|
37
|
-
get duration() {
|
38
|
-
return this._mediaPlayerRef.value?.duration;
|
39
|
-
}
|
40
|
-
|
41
|
-
set currentTime(value: number) {
|
42
|
-
if (this._mediaPlayerRef.value) {
|
43
|
-
this._mediaPlayerRef.value.currentTime = value;
|
44
|
-
}
|
45
|
-
}
|
46
|
-
get currentTime() {
|
47
|
-
return this._mediaPlayerRef.value?.currentTime ?? 0;
|
48
|
-
}
|
49
|
-
|
50
|
-
set playbackRate(value: number) {
|
51
|
-
if (this._mediaPlayerRef.value) {
|
52
|
-
this._mediaPlayerRef.value.playbackRate = value;
|
53
|
-
}
|
54
|
-
}
|
55
|
-
get playbackRate() {
|
56
|
-
return this._mediaPlayerRef.value?.playbackRate ?? 1;
|
57
|
-
}
|
58
|
-
|
59
|
-
set volume(value: number) {
|
60
|
-
if (this._mediaPlayerRef.value) {
|
61
|
-
this._mediaPlayerRef.value.volume = value;
|
62
|
-
}
|
63
|
-
}
|
64
|
-
get volume() {
|
65
|
-
return this._mediaPlayerRef.value?.volume ?? 1;
|
66
|
-
}
|
67
|
-
|
68
|
-
set muted(value: boolean) {
|
69
|
-
if (this._mediaPlayerRef.value) {
|
70
|
-
this._mediaPlayerRef.value.muted = value;
|
71
|
-
}
|
72
|
-
}
|
73
|
-
get muted() {
|
74
|
-
return this._mediaPlayerRef.value?.muted ?? false;
|
75
|
-
}
|
76
|
-
|
77
|
-
get scene(): Scene | null {
|
78
|
-
return this._mediaPlayerRef.value?.scene ?? null;
|
79
|
-
}
|
80
|
-
|
81
|
-
get scenes(): Scene[] {
|
82
|
-
return this._mediaPlayerRef.value?.scenes ?? [];
|
83
|
-
}
|
84
|
-
|
85
|
-
get sceneConfig(): Scenes | null {
|
86
|
-
return this._mediaPlayerRef.value?.sceneConfig ?? null;
|
87
|
-
}
|
88
|
-
|
89
|
-
get videoState() {
|
90
|
-
return this._mediaPlayerRef.value?.videoState;
|
91
|
-
}
|
92
|
-
|
93
|
-
get mediaPlayer() {
|
94
|
-
return this._mediaPlayerRef.value;
|
95
|
-
}
|
96
|
-
|
97
|
-
play() {
|
98
|
-
this._mediaPlayerRef.value?.play();
|
99
|
-
}
|
100
|
-
|
101
|
-
pause() {
|
102
|
-
this._mediaPlayerRef.value?.pause();
|
103
|
-
}
|
104
|
-
|
105
|
-
reset(time = 0, play = false) {
|
106
|
-
this._mediaPlayerRef.value?.reset(time, play);
|
107
|
-
}
|
108
|
-
|
109
|
-
setScene(index: number) {
|
110
|
-
this._mediaPlayerRef.value?.setScene(index);
|
111
|
-
}
|
112
|
-
}
|
113
|
-
return MediaPlayerProxyClass;
|
114
|
-
};
|
115
|
-
|
116
|
-
export { MediaPlayerProxy };
|