@saooti/octopus-sdk 39.2.12 → 39.2.13

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": "@saooti/octopus-sdk",
3
- "version": "39.2.12",
3
+ "version": "39.2.13",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -73,7 +73,7 @@ export const playerStitching = defineComponent({
73
73
  async radioIntervalExecute(){
74
74
  //If pause when ad needs to be played then skipped (TO THINK)
75
75
  if("PAUSED"===this.playerStatus){return;}
76
- const vastUrl = await this.getVastUrl(this.playerRadio?.nextAdvertising?.tag ??"5e385e1b51c86");
76
+ const vastUrl = await this.getVastUrl(this.playerRadio?.nextAdvertising?.tag ??"5e385e1b51c86", this.playerRadio?.nextAdvertising?.adCount ?? 1);
77
77
  console.log("vastUrl "+vastUrl);
78
78
  this.onRequestAd(vastUrl);
79
79
  },
@@ -178,10 +178,10 @@ export const playerStitching = defineComponent({
178
178
  },
179
179
 
180
180
  async defineVastUrl(adPosition: AdPosition): Promise<AdPosition>{
181
- adPosition.vastUrl = await this.getVastUrl(adPosition.impressId);
181
+ adPosition.vastUrl = await this.getVastUrl(adPosition.impressId, 1);
182
182
  return adPosition;
183
183
  },
184
- async getVastUrl(tag: string): Promise<string>{
184
+ async getVastUrl(tag: string, adCount: number): Promise<string>{
185
185
  let baseUrl = "https://api.soundcast.io/v1/vast/"+tag;
186
186
  let keywords: Array<string> = [];
187
187
  if(this.playerPodcast?.tags?.length){
@@ -193,7 +193,7 @@ export const playerStitching = defineComponent({
193
193
  }
194
194
  }
195
195
  const parameters = this.getUriSearchParams({
196
- adCount: 1,
196
+ adCount: adCount ?? 1,
197
197
  pageUrl:document.referrer,
198
198
  keywords:keywords
199
199
  });
@@ -24,6 +24,7 @@ export interface MediaRadio {
24
24
  export interface NextAdvertising {
25
25
  startDate?: string;
26
26
  tag?: string;
27
+ adCount?:number;
27
28
  }
28
29
 
29
30
  export interface MetadataRadio {
@@ -67,6 +67,7 @@ export interface PlanningRecurrence extends Recurrence {
67
67
  isAdvertising: boolean;
68
68
  ignoreForStream: boolean;
69
69
  advertisingTag: null | string;
70
+ adCount: number;
70
71
  }
71
72
  export interface Exclusion {
72
73
  exclusionId: number;