@vouchfor/embeds 0.0.0-experiment.93ea548 → 0.0.0-experiment.9821b79

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,6 +4,7 @@ type EmbedHost = ReactiveControllerHost & Embed;
4
4
  declare class FetcherController {
5
5
  host: EmbedHost;
6
6
  private _fetching;
7
+ private _vouch;
7
8
  set fetching(value: boolean);
8
9
  get fetching(): boolean;
9
10
  private getVouch;
@@ -1,30 +1,36 @@
1
- import type { Embed } from '..';
1
+ import type { Embed } from '../..';
2
2
  import type { ReactiveController, ReactiveControllerHost } from 'lit';
3
3
  type EmbedHost = ReactiveControllerHost & Embed;
4
+ type TrackingEvent = 'VOUCH_LOADED' | 'VOUCH_RESPONSE_VIEWED' | 'VIDEO_PLAYED' | 'VIDEO_STREAMED';
5
+ type TrackingPayload = {
6
+ vouchId?: string;
7
+ answerId?: string;
8
+ streamStart?: number;
9
+ streamEnd?: number;
10
+ };
4
11
  declare class TrackingController implements ReactiveController {
5
12
  host: EmbedHost;
6
- private _tabId;
7
- private _clientId;
8
- private _visitorId;
13
+ private _batchedEvents;
9
14
  private _hasPlayed;
10
15
  private _hasLoaded;
11
16
  private _answersViewed;
12
- private _streamedTime;
17
+ private _streamStartTime;
13
18
  private _streamLatestTime;
14
- private _streamedPrevTimestamp;
19
+ private _currentlyPlayingVideo;
15
20
  constructor(host: EmbedHost);
16
- private _findVouchId;
17
- private _createVisitor;
18
- private _getUids;
19
- private _getReportingMetadata;
21
+ private _createTrackingEvent;
20
22
  private _sendTrackingEvent;
23
+ private _streamEnded;
21
24
  private _handleVouchLoaded;
22
25
  private _handlePlay;
23
26
  private _handleVideoPlay;
24
- private _handleVideoSeeking;
25
27
  private _handleVideoTimeUpdate;
26
28
  private _handleVideoPause;
29
+ private _pageUnloading;
30
+ private _handleVisibilityChange;
31
+ private _handlePageHide;
27
32
  hostConnected(): void;
28
33
  hostDisconnected(): void;
29
34
  }
30
35
  export { TrackingController };
36
+ export type { TrackingEvent, TrackingPayload };
@@ -0,0 +1,17 @@
1
+ import type { TrackingPayload } from '.';
2
+ import type { Vouch } from '@vouchfor/media-player';
3
+ import type { Environment } from '../../../../utils/env';
4
+ declare function getUids(env: Environment): {
5
+ client: null;
6
+ tab: null;
7
+ request: string;
8
+ visitor?: undefined;
9
+ } | {
10
+ client: string;
11
+ tab: string;
12
+ request: string;
13
+ visitor: string;
14
+ };
15
+ declare function findVouchId(payload?: TrackingPayload, vouch?: Vouch): string | null | undefined;
16
+ declare function getReportingMetadata(source?: string): any;
17
+ export { getUids, findVouchId, getReportingMetadata };
@@ -1,5 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
- import type { Scene, TemplateInstance } from '@vouchfor/canvas-video';
2
+ import type { Scene, Scenes, TemplateInstance } from '@vouchfor/canvas-video';
3
3
  import type { MediaPlayer, MediaPlayerProps } from '@vouchfor/media-player';
4
4
  import type { Environment } from '../../utils/env';
5
5
  type EmbedProps = Pick<MediaPlayerProps, 'data' | 'aspectRatio' | 'preload' | 'autoplay' | 'controls'> & {
@@ -9,12 +9,15 @@ type EmbedProps = Pick<MediaPlayerProps, 'data' | 'aspectRatio' | 'preload' | 'a
9
9
  trackingSource?: string;
10
10
  vouchId?: string;
11
11
  templateId?: string;
12
+ questions?: number[];
12
13
  };
13
14
  declare class Embed extends LitElement {
15
+ static styles: import("lit").CSSResult[];
14
16
  private _mediaPlayerRef;
15
17
  data: EmbedProps['data'];
16
18
  vouchId: EmbedProps['vouchId'];
17
19
  templateId: EmbedProps['templateId'];
20
+ questions: EmbedProps['questions'];
18
21
  env: EmbedProps['env'];
19
22
  apiKey: EmbedProps['apiKey'];
20
23
  disableTracking: EmbedProps['disableTracking'];
@@ -45,11 +48,13 @@ declare class Embed extends LitElement {
45
48
  get muted(): boolean;
46
49
  get scene(): Scene | null;
47
50
  get scenes(): Scene[];
51
+ get sceneConfig(): Scenes | null;
48
52
  get videoState(): import("@vouchfor/media-player/dist/src/components/MediaPlayer/controllers/scenes").VideoStateMap | undefined;
49
53
  get mediaPlayer(): MediaPlayer | undefined;
50
54
  play(): void;
51
55
  pause(): void;
52
56
  setScene(index: number): void;
57
+ private _renderStyles;
53
58
  render(): import("lit").TemplateResult<1>;
54
59
  }
55
60
  declare global {
@@ -0,0 +1,3 @@
1
+ import type { Vouch } from '@vouchfor/media-player';
2
+ declare const data: Vouch;
3
+ export { data };