@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.
Files changed (30) hide show
  1. package/dist/es/{browser-4d54600e.js → browser-97265c29.js} +2 -2
  2. package/dist/es/{browser-4d54600e.js.map → browser-97265c29.js.map} +1 -1
  3. package/dist/es/embeds.js +1 -1
  4. package/dist/es/{index-14868944.js → index-d15aeb56.js} +632 -640
  5. package/dist/es/index-d15aeb56.js.map +1 -0
  6. package/dist/es/src/components/PlayerEmbed/index.d.ts +73 -0
  7. package/dist/iife/dialog-embed/{browser-d8ab928d.js → browser-c8adca59.js} +2 -2
  8. package/dist/iife/dialog-embed/{browser-d8ab928d.js.map → browser-c8adca59.js.map} +1 -1
  9. package/dist/iife/dialog-embed/embed.iife.js +38 -38
  10. package/dist/iife/dialog-embed/embed.iife.js.map +1 -1
  11. package/dist/iife/dialog-embed/embed.js +1 -1
  12. package/dist/iife/dialog-embed/{index-568f189c.js → index-eb3ec3b3.js} +667 -675
  13. package/dist/iife/dialog-embed/index-eb3ec3b3.js.map +1 -0
  14. package/dist/iife/dialog-embed/src/components/PlayerEmbed/index.d.ts +73 -0
  15. package/dist/iife/embeds.iife.js +38 -38
  16. package/dist/iife/embeds.iife.js.map +1 -1
  17. package/dist/iife/player-embed/{browser-951710ee.js → browser-7e2003a9.js} +2 -2
  18. package/dist/iife/player-embed/{browser-951710ee.js.map → browser-7e2003a9.js.map} +1 -1
  19. package/dist/iife/player-embed/embed.iife.js +34 -34
  20. package/dist/iife/player-embed/embed.iife.js.map +1 -1
  21. package/dist/iife/player-embed/embed.js +1 -1
  22. package/dist/iife/player-embed/{index-86dfade0.js → index-4541048e.js} +3343 -3351
  23. package/dist/iife/player-embed/index-4541048e.js.map +1 -0
  24. package/dist/iife/player-embed/src/components/PlayerEmbed/index.d.ts +73 -0
  25. package/package.json +2 -2
  26. package/src/components/PlayerEmbed/index.ts +106 -5
  27. package/dist/es/index-14868944.js.map +0 -1
  28. package/dist/iife/dialog-embed/index-568f189c.js.map +0 -1
  29. package/dist/iife/player-embed/index-86dfade0.js.map +0 -1
  30. 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 };