@vouchfor/embeds 0.0.0-experiment.2ab669a → 0.0.0-experiment.2d4da6c
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/es/browser-8b4ecf1d.js +433 -0
- package/dist/es/browser-8b4ecf1d.js.map +1 -0
- package/dist/es/embeds.js +7 -1217
- package/dist/es/embeds.js.map +1 -1
- package/dist/es/index-4c628d0f.js +9948 -0
- package/dist/es/index-4c628d0f.js.map +1 -0
- package/dist/es/{components → src/components}/Embed/controllers/fetcher.d.ts +1 -0
- package/dist/es/{components → src/components}/Embed/controllers/tracking.d.ts +7 -2
- package/dist/es/{components → src/components}/Embed/index.d.ts +10 -2
- package/dist/es/src/utils/env.d.ts +12 -0
- package/dist/iife/embeds.iife.js +433 -297
- package/dist/iife/embeds.iife.js.map +1 -1
- package/package.json +4 -4
- package/src/components/Embed/Embed.stories.ts +17 -4
- package/src/components/Embed/controllers/fetcher.ts +79 -15
- package/src/components/Embed/controllers/tracking.ts +99 -65
- package/src/components/Embed/index.ts +25 -5
- package/src/utils/env.ts +15 -29
- package/dist/es/components/Embed/controllers/event-forwarder.d.ts +0 -14
- package/dist/es/utils/env.d.ts +0 -18
- /package/dist/es/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/es/{utils → src/utils}/events.d.ts +0 -0
@@ -9,19 +9,24 @@ declare class TrackingController implements ReactiveController {
|
|
9
9
|
private _hasPlayed;
|
10
10
|
private _hasLoaded;
|
11
11
|
private _answersViewed;
|
12
|
-
private
|
13
|
-
private
|
12
|
+
private _streamStartTime;
|
13
|
+
private _streamLatestTime;
|
14
|
+
private _currentlyPlayingVideo;
|
14
15
|
constructor(host: EmbedHost);
|
15
16
|
private _findVouchId;
|
16
17
|
private _createVisitor;
|
17
18
|
private _getUids;
|
18
19
|
private _getReportingMetadata;
|
19
20
|
private _sendTrackingEvent;
|
21
|
+
private _streamEnded;
|
20
22
|
private _handleVouchLoaded;
|
21
23
|
private _handlePlay;
|
22
24
|
private _handleVideoPlay;
|
23
25
|
private _handleVideoTimeUpdate;
|
24
26
|
private _handleVideoPause;
|
27
|
+
private _pageUnloading;
|
28
|
+
private _handleVisibilityChange;
|
29
|
+
private _handlePageHide;
|
25
30
|
hostConnected(): void;
|
26
31
|
hostDisconnected(): void;
|
27
32
|
}
|
@@ -1,20 +1,27 @@
|
|
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'> & {
|
6
6
|
env: Environment;
|
7
7
|
apiKey: string;
|
8
|
+
disableTracking?: boolean;
|
9
|
+
trackingSource?: string;
|
8
10
|
vouchId?: string;
|
9
11
|
templateId?: string;
|
12
|
+
questions?: number[];
|
10
13
|
};
|
11
14
|
declare class Embed extends LitElement {
|
15
|
+
static styles: import("lit").CSSResult[];
|
12
16
|
private _mediaPlayerRef;
|
13
17
|
data: EmbedProps['data'];
|
14
18
|
vouchId: EmbedProps['vouchId'];
|
15
19
|
templateId: EmbedProps['templateId'];
|
20
|
+
questions: EmbedProps['questions'];
|
16
21
|
env: EmbedProps['env'];
|
17
22
|
apiKey: EmbedProps['apiKey'];
|
23
|
+
disableTracking: EmbedProps['disableTracking'];
|
24
|
+
trackingSource: EmbedProps['trackingSource'];
|
18
25
|
controls: EmbedProps['controls'];
|
19
26
|
preload: EmbedProps['preload'];
|
20
27
|
autoplay: EmbedProps['autoplay'];
|
@@ -41,12 +48,13 @@ declare class Embed extends LitElement {
|
|
41
48
|
get muted(): boolean;
|
42
49
|
get scene(): Scene | null;
|
43
50
|
get scenes(): Scene[];
|
51
|
+
get sceneConfig(): Scenes | null;
|
44
52
|
get videoState(): import("@vouchfor/media-player/dist/src/components/MediaPlayer/controllers/scenes").VideoStateMap | undefined;
|
45
53
|
get mediaPlayer(): MediaPlayer | undefined;
|
46
54
|
play(): void;
|
47
55
|
pause(): void;
|
48
56
|
setScene(index: number): void;
|
49
|
-
render(): import("lit
|
57
|
+
render(): import("lit").TemplateResult<1>;
|
50
58
|
}
|
51
59
|
declare global {
|
52
60
|
interface HTMLElementTagNameMap {
|
@@ -0,0 +1,12 @@
|
|
1
|
+
type Environment = 'local' | 'dev' | 'staging' | 'prod';
|
2
|
+
type GetEnvUrlsReturn = {
|
3
|
+
videoUrl: string;
|
4
|
+
publicApiUrl: string;
|
5
|
+
embedApiUrl: string;
|
6
|
+
};
|
7
|
+
declare const devEmbedApiUrl = "https://embed-dev.vouchfor.com/v2";
|
8
|
+
declare const stagingEmbedApiUrl = "https://embed-staging.vouchfor.com/v2";
|
9
|
+
declare const prodEmbedApiUrl = "https://embed.vouchfor.com/v2";
|
10
|
+
declare function getEnvUrls(env: Environment): GetEnvUrlsReturn;
|
11
|
+
export { devEmbedApiUrl, stagingEmbedApiUrl, prodEmbedApiUrl, getEnvUrls };
|
12
|
+
export type { Environment };
|