@vouchfor/embeds 6.0.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vouchfor/embeds",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "license": "MIT",
5
5
  "author": "Aaron Williams",
6
6
  "main": "dist/es/embeds.js",
@@ -19,7 +19,8 @@ const _PlayerEmbed = ({
19
19
  env,
20
20
  apiKey,
21
21
  controls,
22
- aspectRatio
22
+ aspectRatio,
23
+ senderId
23
24
  }: PlayerEmbedArgs) => {
24
25
  return html`
25
26
  <div style="height: 100vh">
@@ -33,6 +34,7 @@ const _PlayerEmbed = ({
33
34
  ?autoplay=${autoplay}
34
35
  preload=${ifDefined(preload)}
35
36
  aspectRatio=${ifDefined(aspectRatio)}
37
+ senderId=${ifDefined(senderId)}
36
38
  @error=${console.log}
37
39
  ></vouch-embed-player>
38
40
  </div>
@@ -15,6 +15,7 @@ type TrackingPayload = {
15
15
  answerId?: string;
16
16
  streamStart?: number;
17
17
  streamEnd?: number;
18
+ senderId?: string;
18
19
  };
19
20
 
20
21
  type BatchEvent = {
@@ -59,6 +60,7 @@ class TrackingController implements ReactiveController {
59
60
  event,
60
61
  payload: {
61
62
  ...payload,
63
+ senderId: this.host.senderId,
62
64
  vouchId,
63
65
  time: new Date().toISOString()
64
66
  }
@@ -127,9 +129,7 @@ class TrackingController implements ReactiveController {
127
129
  private _handlePlay = () => {
128
130
  // Only send the video played event once per session
129
131
  if (!this._hasPlayed) {
130
- this._createTrackingEvent('VIDEO_PLAYED', {
131
- streamStart: this.host.currentTime
132
- });
132
+ this._createTrackingEvent('VIDEO_PLAYED', { streamStart: this.host.currentTime });
133
133
  this._hasPlayed = true;
134
134
  }
135
135
  };
@@ -25,6 +25,7 @@ type PlayerEmbedProps = Pick<MediaPlayerProps, 'aspectRatio' | 'language' | 'pre
25
25
  templateId?: string;
26
26
  // Index of the questions to include starting from 1
27
27
  questions?: number[];
28
+ senderId?: string;
28
29
  };
29
30
 
30
31
  @customElement('vouch-embed-player')
@@ -52,6 +53,7 @@ class PlayerEmbed extends LitElement {
52
53
  @property({ type: Boolean }) autoplay: PlayerEmbedProps['autoplay'] = false;
53
54
  @property({ type: Number }) aspectRatio: PlayerEmbedProps['aspectRatio'] = 0;
54
55
  @property({ type: String }) language?: MediaPlayerProps['language'];
56
+ @property({ type: String }) senderId?: PlayerEmbedProps['senderId'];
55
57
 
56
58
  private eventController = new EventForwardController(this, [
57
59
  'durationchange',