@vouchfor/embeds 0.0.0-experiment.039a74b → 0.0.0-experiment.08c37fe

Sign up to get free protection for your applications and to get access to all the features.
@@ -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,13 @@
1
+ import type { Embed } from '..';
2
+ import type { ReactiveControllerHost } from 'lit';
3
+ type EmbedHost = ReactiveControllerHost & Embed;
4
+ declare class FetcherController {
5
+ host: EmbedHost;
6
+ private _fetching;
7
+ set fetching(value: boolean);
8
+ get fetching(): boolean;
9
+ private getVouch;
10
+ private getTemplate;
11
+ constructor(host: EmbedHost);
12
+ }
13
+ 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,64 @@
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' | 'aspectRatio' | 'preload' | 'autoplay' | 'controls'> & {
6
+ env: Environment;
7
+ apiKey: string;
8
+ trackingSource?: string;
9
+ vouchId?: string;
10
+ templateId?: string;
11
+ };
12
+ declare class Embed extends LitElement {
13
+ private _mediaPlayerRef;
14
+ data: EmbedProps['data'];
15
+ vouchId: EmbedProps['vouchId'];
16
+ templateId: EmbedProps['templateId'];
17
+ env: EmbedProps['env'];
18
+ apiKey: EmbedProps['apiKey'];
19
+ trackingSource: EmbedProps['trackingSource'];
20
+ controls: EmbedProps['controls'];
21
+ preload: EmbedProps['preload'];
22
+ autoplay: EmbedProps['autoplay'];
23
+ aspectRatio: EmbedProps['aspectRatio'];
24
+ private eventController;
25
+ private _fetcherController;
26
+ private _trackingController;
27
+ vouch: EmbedProps['data'];
28
+ template: TemplateInstance | undefined;
29
+ get fetching(): boolean;
30
+ get waiting(): boolean | undefined;
31
+ get seeking(): boolean | undefined;
32
+ get paused(): boolean | undefined;
33
+ get captions(): boolean | undefined;
34
+ get fullscreen(): boolean | undefined;
35
+ get duration(): number | undefined;
36
+ set currentTime(value: number);
37
+ get currentTime(): number;
38
+ set playbackRate(value: number);
39
+ get playbackRate(): number;
40
+ set volume(value: number);
41
+ get volume(): number;
42
+ set muted(value: boolean);
43
+ get muted(): boolean;
44
+ get scene(): Scene | null;
45
+ get scenes(): Scene[];
46
+ get videoState(): import("@vouchfor/media-player/dist/src/components/MediaPlayer/controllers/scenes").VideoStateMap | undefined;
47
+ get mediaPlayer(): MediaPlayer | undefined;
48
+ play(): void;
49
+ pause(): void;
50
+ setScene(index: number): void;
51
+ render(): import("lit-html").TemplateResult<1>;
52
+ }
53
+ declare global {
54
+ interface HTMLElementTagNameMap {
55
+ 'vouch-embed': Embed;
56
+ }
57
+ namespace JSX {
58
+ interface IntrinsicElements {
59
+ 'vouch-embed': Embed;
60
+ }
61
+ }
62
+ }
63
+ export { Embed };
64
+ export type { EmbedProps };