@vouchfor/embeds 0.0.0-experiment.b565b72 → 0.0.0-experiment.dcc3e68
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/es/components/Embed/controllers/event-forwarder.d.ts +14 -0
- package/dist/es/components/Embed/controllers/fetcher.d.ts +20 -0
- package/dist/es/components/Embed/controllers/tracking.d.ts +28 -0
- package/dist/es/components/Embed/index.d.ts +63 -0
- package/dist/es/embeds.js +1234 -13
- package/dist/es/embeds.js.map +1 -1
- package/dist/es/index.d.ts +1 -1
- package/dist/es/utils/env.d.ts +18 -0
- package/dist/es/utils/events.d.ts +2 -0
- package/dist/iife/embeds.iife.js +334 -195
- package/dist/iife/embeds.iife.js.map +1 -1
- package/package.json +11 -6
- package/src/components/Embed/Embed.stories.ts +79 -0
- package/src/components/Embed/controllers/event-forwarder.ts +47 -0
- package/src/components/Embed/controllers/fetcher.ts +115 -0
- package/src/components/Embed/controllers/tracking.ts +261 -0
- package/src/components/Embed/index.ts +208 -0
- package/src/index.ts +1 -1
- package/src/utils/env.ts +78 -0
- package/src/utils/events.ts +13 -0
- package/dist/es/components/InlineEmbed.d.ts +0 -12
- package/dist/es/components/index.d.ts +0 -2
- package/src/components/InlineEmbed.stories.ts +0 -119
- package/src/components/InlineEmbed.ts +0 -18
- package/src/components/index.ts +0 -2
@@ -0,0 +1,14 @@
|
|
1
|
+
import type { Embed } from '..';
|
2
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
3
|
+
type EmbedHost = ReactiveControllerHost & Embed;
|
4
|
+
declare class EventForwardController implements ReactiveController {
|
5
|
+
host: EmbedHost;
|
6
|
+
private _events;
|
7
|
+
private _cleanup;
|
8
|
+
private _forwardElementRef;
|
9
|
+
constructor(host: EmbedHost, events: string[]);
|
10
|
+
register(): import("lit-html/directive.js").DirectiveResult<typeof import("lit-html/directives/ref.js").RefDirective>;
|
11
|
+
hostConnected(): void;
|
12
|
+
hostDisconnected(): void;
|
13
|
+
}
|
14
|
+
export { EventForwardController };
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import type { Embed } from '..';
|
2
|
+
import type { TemplateInstance } from '@vouchfor/canvas-video';
|
3
|
+
import type { ReactiveControllerHost } from 'lit';
|
4
|
+
type EmbedHost = ReactiveControllerHost & Embed;
|
5
|
+
declare class FetcherController {
|
6
|
+
host: EmbedHost;
|
7
|
+
private _fetching;
|
8
|
+
private _vouch;
|
9
|
+
private _template;
|
10
|
+
set fetching(value: boolean);
|
11
|
+
get fetching(): boolean;
|
12
|
+
set vouch(value: import("@vouchfor/media-player/dist/src/components/MediaPlayer/types").Vouch | null | undefined);
|
13
|
+
get vouch(): import("@vouchfor/media-player/dist/src/components/MediaPlayer/types").Vouch | null | undefined;
|
14
|
+
set template(value: TemplateInstance | null);
|
15
|
+
get template(): TemplateInstance | null;
|
16
|
+
private getVouch;
|
17
|
+
private getTemplate;
|
18
|
+
constructor(host: EmbedHost);
|
19
|
+
}
|
20
|
+
export { FetcherController };
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import type { Embed } from '..';
|
2
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
3
|
+
type EmbedHost = ReactiveControllerHost & Embed;
|
4
|
+
declare class TrackingController implements ReactiveController {
|
5
|
+
host: EmbedHost;
|
6
|
+
private _tabId;
|
7
|
+
private _clientId;
|
8
|
+
private _visitorId;
|
9
|
+
private _hasPlayed;
|
10
|
+
private _hasLoaded;
|
11
|
+
private _answersViewed;
|
12
|
+
private _streamedTime;
|
13
|
+
private _streamedPrevTimestamp;
|
14
|
+
constructor(host: EmbedHost);
|
15
|
+
private _findVouchId;
|
16
|
+
private _createVisitor;
|
17
|
+
private _getUids;
|
18
|
+
private _getReportingMetadata;
|
19
|
+
private _sendTrackingEvent;
|
20
|
+
private _handleVouchLoaded;
|
21
|
+
private _handlePlay;
|
22
|
+
private _handleVideoPlay;
|
23
|
+
private _handleVideoTimeUpdate;
|
24
|
+
private _handleVideoPause;
|
25
|
+
hostConnected(): void;
|
26
|
+
hostDisconnected(): void;
|
27
|
+
}
|
28
|
+
export { TrackingController };
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import { LitElement } from 'lit';
|
2
|
+
import type { Scene, TemplateInstance } from '@vouchfor/canvas-video';
|
3
|
+
import type { MediaPlayer, MediaPlayerProps } from '@vouchfor/media-player';
|
4
|
+
import type { Environment } from '../../utils/env';
|
5
|
+
type EmbedProps = Pick<MediaPlayerProps, 'data' | 'resolution' | 'aspectRatio' | 'preload' | 'autoplay' | 'controls'> & {
|
6
|
+
env: Environment;
|
7
|
+
apiKey: string;
|
8
|
+
vouchId?: string;
|
9
|
+
templateId?: string;
|
10
|
+
};
|
11
|
+
declare class Embed extends LitElement {
|
12
|
+
private _mediaPlayerRef;
|
13
|
+
data: EmbedProps['data'];
|
14
|
+
vouchId: EmbedProps['vouchId'];
|
15
|
+
templateId: EmbedProps['templateId'];
|
16
|
+
env: EmbedProps['env'];
|
17
|
+
apiKey: EmbedProps['apiKey'];
|
18
|
+
preload: EmbedProps['preload'];
|
19
|
+
autoplay: EmbedProps['autoplay'];
|
20
|
+
resolution: EmbedProps['resolution'];
|
21
|
+
aspectRatio: EmbedProps['aspectRatio'];
|
22
|
+
controls: EmbedProps['controls'];
|
23
|
+
private eventController;
|
24
|
+
private _fetcherController;
|
25
|
+
private _trackingController;
|
26
|
+
get vouch(): import("@vouchfor/media-player/dist/src/components/MediaPlayer/types").Vouch | null | undefined;
|
27
|
+
get template(): TemplateInstance | null;
|
28
|
+
get fetching(): boolean;
|
29
|
+
get waiting(): boolean | undefined;
|
30
|
+
get seeking(): boolean | undefined;
|
31
|
+
get paused(): boolean | undefined;
|
32
|
+
get captions(): boolean | undefined;
|
33
|
+
get fullscreen(): boolean | undefined;
|
34
|
+
get duration(): number | undefined;
|
35
|
+
set currentTime(value: number);
|
36
|
+
get currentTime(): number;
|
37
|
+
set playbackRate(value: number);
|
38
|
+
get playbackRate(): number;
|
39
|
+
set volume(value: number);
|
40
|
+
get volume(): number;
|
41
|
+
set muted(value: boolean);
|
42
|
+
get muted(): boolean;
|
43
|
+
get scene(): Scene | null;
|
44
|
+
get scenes(): Scene[];
|
45
|
+
get videoState(): import("@vouchfor/media-player/dist/src/components/MediaPlayer/controllers/scenes").VideoStateMap | undefined;
|
46
|
+
get mediaPlayer(): MediaPlayer | undefined;
|
47
|
+
play(): void;
|
48
|
+
pause(): void;
|
49
|
+
setScene(index: number): void;
|
50
|
+
render(): import("lit-html").TemplateResult<1>;
|
51
|
+
}
|
52
|
+
declare global {
|
53
|
+
interface HTMLElementTagNameMap {
|
54
|
+
'vouch-embed': Embed;
|
55
|
+
}
|
56
|
+
namespace JSX {
|
57
|
+
interface IntrinsicElements {
|
58
|
+
'vouch-embed': Embed;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
export { Embed };
|
63
|
+
export type { EmbedProps };
|