@saooti/octopus-sdk 40.1.3 → 40.1.4
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": "40.1.
|
|
3
|
+
"version": "40.1.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Javascript SDK for using octopus",
|
|
6
6
|
"author": "Saooti",
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"proxy_non_authentifié": "node proxy.ts false",
|
|
13
13
|
"lint": "eslint --fix src",
|
|
14
14
|
"stylelint": "stylelint **/*.{scss,vue} --fix",
|
|
15
|
-
"build_bundle": "vue-cli-service build --target lib --name octopus ./index.js",
|
|
16
15
|
"sonar": "node sonarqube-scanner.js"
|
|
17
16
|
},
|
|
18
17
|
"dependencies": {
|
|
@@ -101,6 +101,9 @@ export const usePlayerLogic = (forceHide: Ref<boolean, boolean>)=>{
|
|
|
101
101
|
audioPlayer.pause();
|
|
102
102
|
} else if ("PLAYING" === playerStore.playerStatus && playerStore.playerRadio) {
|
|
103
103
|
if (playerStore.playerRadio.isInit) {
|
|
104
|
+
if(vastStore.isAdPlaying && !vastStore.resetSessionId){
|
|
105
|
+
playerStore.playerRadio.dateSessionId = dayjs().toISOString();
|
|
106
|
+
}
|
|
104
107
|
playRadio();
|
|
105
108
|
} else {
|
|
106
109
|
playerStore.playerRadio.isInit = true;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { usePlayerStore } from "../../../stores/PlayerStore";
|
|
2
2
|
import { useVastStore } from "../../../stores/VastStore";
|
|
3
3
|
import { loadScript } from "../../../helper/loadScript";
|
|
4
|
-
import {Ref, ref, watch} from 'vue';
|
|
4
|
+
import {nextTick, Ref, ref, watch} from 'vue';
|
|
5
|
+
import dayjs from "dayjs";
|
|
5
6
|
let adsLoader: any;
|
|
6
7
|
let adsManager:any;
|
|
7
8
|
let adDisplayContainer:any;
|
|
@@ -12,6 +13,7 @@ export const usePlayerVast = ()=>{
|
|
|
12
13
|
const audioContainer : Ref<HTMLAudioElement|null>= ref(null);
|
|
13
14
|
const isAdRequested = ref(false);
|
|
14
15
|
const statusPlayerWhenLoaded = ref("");
|
|
16
|
+
const dateForSessionId: Ref<string|undefined> = ref(undefined);
|
|
15
17
|
|
|
16
18
|
const playerStore = usePlayerStore();
|
|
17
19
|
const vastStore = useVastStore();
|
|
@@ -169,10 +171,13 @@ export const usePlayerVast = ()=>{
|
|
|
169
171
|
}
|
|
170
172
|
|
|
171
173
|
function onContentResumeRequested() {
|
|
172
|
-
vastStore.updateIsAdPlaying(false);
|
|
173
174
|
if (!isContentFinished.value) {
|
|
174
175
|
playerStore.playerChangeStatus(false);
|
|
175
176
|
}
|
|
177
|
+
nextTick(() => {
|
|
178
|
+
vastStore.updateIsAdPlaying(false);
|
|
179
|
+
vastStore.updateResetSessionId(false);
|
|
180
|
+
});
|
|
176
181
|
}
|
|
177
182
|
|
|
178
183
|
function contentEndedAdsLoader():void{
|
|
@@ -185,8 +190,12 @@ export const usePlayerVast = ()=>{
|
|
|
185
190
|
if(!adsManager){return;}
|
|
186
191
|
if(vastStore.isAdPaused){
|
|
187
192
|
adsManager.pause();
|
|
193
|
+
dateForSessionId.value = dayjs().toISOString();
|
|
188
194
|
}else{
|
|
189
195
|
adsManager.resume();
|
|
196
|
+
if(!vastStore.resetSessionId &&dayjs().diff(dayjs(dateForSessionId.value), 'm')>1){
|
|
197
|
+
vastStore.updateResetSessionId(true);
|
|
198
|
+
}
|
|
190
199
|
}
|
|
191
200
|
}
|
|
192
201
|
|
|
@@ -24,6 +24,11 @@ export const useFetchRadio = ()=>{
|
|
|
24
24
|
api: 14,
|
|
25
25
|
path: "player/playing/" + canalId,
|
|
26
26
|
});
|
|
27
|
+
/* metadata.nextAdvertising={
|
|
28
|
+
"adCount": 1,
|
|
29
|
+
"startDate": "2025-03-04T13:12:00Z",
|
|
30
|
+
"tag": "5e385e1b51c86"
|
|
31
|
+
}; */
|
|
27
32
|
if(callbackAdvertising){
|
|
28
33
|
callbackAdvertising(metadata.nextAdvertising);
|
|
29
34
|
}
|
package/src/stores/VastStore.ts
CHANGED
|
@@ -11,6 +11,7 @@ interface VastState {
|
|
|
11
11
|
timeTillSkipInSeconds: number;
|
|
12
12
|
currentTimeAd: number;
|
|
13
13
|
currentDurationAd: number;
|
|
14
|
+
resetSessionId: boolean;
|
|
14
15
|
|
|
15
16
|
useVastPlayerPodcast: boolean;
|
|
16
17
|
adPositionIndex: number;
|
|
@@ -28,6 +29,7 @@ function emptyVastState(): VastState {
|
|
|
28
29
|
timeTillSkipInSeconds: 0,
|
|
29
30
|
currentTimeAd: 0,
|
|
30
31
|
currentDurationAd: 0,
|
|
32
|
+
resetSessionId: false,
|
|
31
33
|
|
|
32
34
|
useVastPlayerPodcast: false,
|
|
33
35
|
adPositionIndex: 0,
|
|
@@ -68,6 +70,9 @@ export const useVastStore = defineStore("VastStore", {
|
|
|
68
70
|
updateAdPositionIndex(index: number) {
|
|
69
71
|
this.adPositionIndex = index;
|
|
70
72
|
},
|
|
73
|
+
updateResetSessionId(value: boolean) {
|
|
74
|
+
this.resetSessionId = value;
|
|
75
|
+
},
|
|
71
76
|
updateAdPositionsPodcasts(
|
|
72
77
|
podcastId: number,
|
|
73
78
|
adPositions: Array<AdPosition>,
|