@vouchfor/embeds 0.0.0-experiment.2673197 → 0.0.0-experiment.279acaf

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