@saooti/octopus-sdk 40.0.3 → 40.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/index.ts +31 -31
- package/package.json +1 -1
- package/plateform.conf +1 -1
- package/src/App.vue +9 -3
- package/src/api/classicApi.ts +1 -1
- package/src/components/composable/player/usePlayerDisplayTime.ts +33 -0
- package/src/components/composable/player/usePlayerLive.ts +150 -0
- package/src/components/composable/player/usePlayerLogic.ts +265 -0
- package/src/components/composable/player/usePlayerLogicProgress.ts +135 -0
- package/src/components/composable/player/usePlayerStitching.ts +213 -0
- package/src/components/composable/player/usePlayerTranscript.ts +120 -0
- package/src/components/composable/player/usePlayerVast.ts +207 -0
- package/src/components/composable/podcasts/useCountdown.ts +53 -0
- package/src/components/composable/podcasts/usePodcastView.ts +85 -0
- package/src/components/composable/radio/usefetchRadioData.ts +75 -0
- package/src/components/composable/route/useAdvancedParamInit.ts +165 -0
- package/src/components/composable/route/useRouteUpdateParams.ts +48 -0
- package/src/components/composable/route/useRubriquesFilterComputed.ts +24 -0
- package/src/components/composable/route/useRubriquesFilterParam.ts +32 -0
- package/src/components/composable/route/useSeoTitleUrl.ts +30 -0
- package/src/components/composable/route/useSimplePageParam.ts +50 -0
- package/src/components/composable/useErrorHandler.ts +25 -0
- package/src/components/composable/useImageProxy.ts +28 -0
- package/src/components/composable/useInit.ts +38 -0
- package/src/components/composable/useMetaTitle.ts +19 -0
- package/src/components/composable/useMetaTitleWatch.ts +14 -0
- package/src/components/composable/useOrgaComputed.ts +23 -0
- package/src/components/composable/useOrganisationFilter.ts +65 -0
- package/src/components/composable/useResizePhone.ts +27 -0
- package/src/components/composable/useSelenium.ts +10 -0
- package/src/components/composable/useTagOf.ts +21 -0
- package/src/components/display/accessibility/AccessibilityModal.vue +136 -0
- package/src/components/display/aggregator/RssSection.vue +1 -4
- package/src/components/display/categories/CategoryChooser.vue +1 -1
- package/src/components/display/categories/CategoryFilter.vue +7 -3
- package/src/components/display/categories/CategoryList.vue +5 -2
- package/src/components/display/comments/CommentInput.vue +0 -3
- package/src/components/display/comments/CommentList.vue +6 -2
- package/src/components/display/comments/CommentPlayer.vue +5 -2
- package/src/components/display/comments/CommentSection.vue +0 -2
- package/src/components/display/comments/item/CommentBasicView.vue +4 -4
- package/src/components/display/comments/item/CommentItem.vue +0 -4
- package/src/components/display/comments/item/CommentMoreActions.vue +6 -2
- package/src/components/display/emission/EmissionInlineList.vue +6 -6
- package/src/components/display/emission/EmissionItem.vue +13 -6
- package/src/components/display/emission/EmissionList.vue +5 -2
- package/src/components/display/emission/EmissionPlayerItem.vue +8 -5
- package/src/components/display/emission/EmissionPresentationItem.vue +16 -7
- package/src/components/display/emission/EmissionPresentationList.vue +10 -7
- package/src/components/display/filter/AdvancedSearch.vue +9 -6
- package/src/components/display/filter/CategorySearchFilter.vue +0 -2
- package/src/components/display/filter/ProductorSearch.vue +8 -3
- package/src/components/display/filter/RubriqueFilter.vue +6 -2
- package/src/components/display/list/ListPaginate.vue +9 -6
- package/src/components/display/list/SwiperList.vue +6 -5
- package/src/components/display/live/CountDown.vue +7 -15
- package/src/components/display/live/CountdownOctopus.vue +10 -30
- package/src/components/display/live/LiveItem.vue +0 -2
- package/src/components/display/live/LiveList.vue +9 -4
- package/src/components/display/live/RadioCurrently.vue +9 -5
- package/src/components/display/live/RadioImage.vue +6 -4
- package/src/components/display/live/RadioItem.vue +1 -2
- package/src/components/display/live/RadioList.vue +5 -3
- package/src/components/display/live/RadioPlanning.vue +10 -7
- package/src/components/display/organisation/OrganisationChooser.vue +8 -4
- package/src/components/display/participant/ParticipantInlineList.vue +5 -5
- package/src/components/display/participant/ParticipantItem.vue +13 -5
- package/src/components/display/participant/ParticipantList.vue +6 -3
- package/src/components/display/playlist/PlaylistItem.vue +12 -5
- package/src/components/display/playlist/PlaylistList.vue +6 -3
- package/src/components/display/playlist/PodcastList.vue +8 -4
- package/src/components/display/podcastmaker/PodcastmakerHeader.vue +6 -3
- package/src/components/display/podcasts/DownloadPodcastButton.vue +2 -4
- package/src/components/display/podcasts/PodcastImage.vue +6 -3
- package/src/components/display/podcasts/PodcastInlineListTemplate.vue +7 -4
- package/src/components/display/podcasts/PodcastItem.vue +1 -1
- package/src/components/display/podcasts/PodcastItemInfo.vue +6 -3
- package/src/components/display/podcasts/PodcastList.vue +6 -3
- package/src/components/display/podcasts/PodcastModuleBox.vue +22 -9
- package/src/components/display/podcasts/PodcastPlayBar.vue +1 -3
- package/src/components/display/podcasts/PodcastPlayButton.vue +1 -3
- package/src/components/display/podcasts/PodcastRawTranscript.vue +79 -10
- package/src/components/display/podcasts/PodcastRubriqueList.vue +4 -3
- package/src/components/display/podcasts/TagList.vue +5 -2
- package/src/components/display/podcasts/VideoModuleBox.vue +6 -3
- package/src/components/display/rubriques/RubriqueChooser.vue +0 -2
- package/src/components/display/rubriques/RubriqueList.vue +7 -5
- package/src/components/display/sharing/ShareButtons.vue +4 -2
- package/src/components/display/sharing/ShareDistribution.vue +4 -2
- package/src/components/form/ClassicEmojiPicker.vue +5 -3
- package/src/components/misc/ClassicLazy.vue +2 -2
- package/src/components/misc/FooterGarSection.vue +2 -3
- package/src/components/misc/FooterSection.vue +9 -5
- package/src/components/misc/MobileMenu.vue +5 -3
- package/src/components/misc/TopBar.vue +8 -6
- package/src/components/misc/TopBarMainContent.vue +8 -4
- package/src/components/misc/modal/ClassicModalInBody.vue +2 -3
- package/src/components/misc/modal/ClipboardModal.vue +4 -3
- package/src/components/misc/modal/NewsletterModal.vue +4 -3
- package/src/components/misc/modal/ShareModalPlayer.vue +4 -2
- package/src/components/misc/player/PlayerCompact.vue +30 -41
- package/src/components/misc/player/PlayerComponent.vue +69 -84
- package/src/components/misc/player/PlayerLarge.vue +43 -58
- package/src/components/misc/player/elements/PlayerImage.vue +6 -3
- package/src/components/misc/player/elements/PlayerTitle.vue +6 -2
- package/src/components/misc/player/radio/RadioHistory.vue +2 -4
- package/src/components/misc/player/video/PlayerVideoHls.vue +6 -7
- package/src/components/pages/EmissionPage.vue +19 -7
- package/src/components/pages/EmissionsPage.vue +31 -23
- package/src/components/pages/HomePage.vue +5 -2
- package/src/components/pages/PageLogout.vue +0 -2
- package/src/components/pages/PageNotFound.vue +11 -15
- package/src/components/pages/ParticipantPage.vue +18 -7
- package/src/components/pages/ParticipantsPage.vue +16 -21
- package/src/components/pages/PlaylistPage.vue +18 -7
- package/src/components/pages/PlaylistsPage.vue +20 -29
- package/src/components/pages/PodcastPage.vue +12 -6
- package/src/components/pages/PodcastsPage.vue +46 -48
- package/src/components/pages/RadioPage.vue +9 -6
- package/src/components/pages/RubriquePage.vue +41 -52
- package/src/components/pages/VideoPage.vue +152 -166
- package/src/helper/cookiesHelper.ts +20 -0
- package/src/helper/displayHelper.ts +15 -0
- package/src/helper/downloadHelper.ts +30 -0
- package/src/helper/{fetch.ts → fetchHelper.ts} +0 -1
- package/src/helper/loadScript.ts +22 -0
- package/src/helper/radio/radioHelper.ts +15 -0
- package/src/helper/{string.ts → stringHelper.ts} +5 -0
- package/src/locale/de.ts +4 -0
- package/src/locale/en.ts +4 -0
- package/src/locale/es.ts +4 -0
- package/src/locale/fr.ts +4 -0
- package/src/locale/it.ts +4 -0
- package/src/locale/sl.ts +4 -0
- package/src/stores/AuthStore.ts +1 -2
- package/src/stores/CommentStore.ts +8 -8
- package/src/stores/PlayerStore.ts +1 -1
- package/src/style/general.scss +15 -1
- package/src/components/mixins/cookies.ts +0 -22
- package/src/components/mixins/displayMethods.ts +0 -17
- package/src/components/mixins/download.ts +0 -33
- package/src/components/mixins/fetchParameters.ts +0 -16
- package/src/components/mixins/handle403.ts +0 -22
- package/src/components/mixins/imageProxy.ts +0 -28
- package/src/components/mixins/init.ts +0 -34
- package/src/components/mixins/loadScript.ts +0 -25
- package/src/components/mixins/metaTitle.ts +0 -15
- package/src/components/mixins/metaTitleWatch.ts +0 -26
- package/src/components/mixins/orgaComputed.ts +0 -23
- package/src/components/mixins/organisationFilter.ts +0 -56
- package/src/components/mixins/player/playerDisplayTime.ts +0 -35
- package/src/components/mixins/player/playerLive.ts +0 -144
- package/src/components/mixins/player/playerLogic.ts +0 -275
- package/src/components/mixins/player/playerLogicProgress.ts +0 -135
- package/src/components/mixins/player/playerStitching.ts +0 -202
- package/src/components/mixins/player/playerTranscript.ts +0 -113
- package/src/components/mixins/player/playerVast.ts +0 -198
- package/src/components/mixins/podcast/countdown.ts +0 -45
- package/src/components/mixins/podcast/podcastView.ts +0 -63
- package/src/components/mixins/radio/fetchRadioData.ts +0 -77
- package/src/components/mixins/resizePhone.ts +0 -26
- package/src/components/mixins/routeParam/advancedParamInit.ts +0 -202
- package/src/components/mixins/routeParam/paginateParamInit.ts +0 -43
- package/src/components/mixins/routeParam/routeParams.ts +0 -33
- package/src/components/mixins/routeParam/rubriquesFilterComputed.ts +0 -22
- package/src/components/mixins/routeParam/rubriquesFilterParam.ts +0 -29
- package/src/components/mixins/selenium.ts +0 -7
- package/src/components/mixins/seoTitleUrl.ts +0 -26
- package/src/components/mixins/tagOfMixins.ts +0 -19
- package/src/helper/uuidGenerator.ts +0 -7
- /package/src/{helper → components/composable}/useEventListener.ts +0 -0
- /package/src/{components/mixins/debounce.ts → helper/debounceHelper.ts} +0 -0
- /package/src/helper/{dom.ts → domHelper.ts} +0 -0
- /package/src/helper/{duration.ts → durationHelper.ts} +0 -0
|
@@ -4,13 +4,13 @@ import relativeTime from "dayjs/plugin/relativeTime";
|
|
|
4
4
|
dayjs.extend(relativeTime);
|
|
5
5
|
|
|
6
6
|
import { defineStore } from "pinia";
|
|
7
|
-
import StringHelper from "../helper/
|
|
8
|
-
import
|
|
7
|
+
import StringHelper from "../helper/stringHelper";
|
|
8
|
+
import cookiesHelper from "../helper/cookiesHelper";
|
|
9
9
|
import WebSocketEngine from "../websocket/commentWebsocket";
|
|
10
10
|
import { CommentPodcast } from "./class/general/comment";
|
|
11
11
|
import { useAuthStore } from "./AuthStore";
|
|
12
12
|
import { useApiStore } from "./ApiStore";
|
|
13
|
-
import
|
|
13
|
+
import stringHelper from "../helper/stringHelper";
|
|
14
14
|
import { CommentMessage, CommentsConfig } from "./class/config/commentsConfig";
|
|
15
15
|
import classicApi from "../api/classicApi";
|
|
16
16
|
import { Podcast } from "./class/general/podcast";
|
|
@@ -120,14 +120,14 @@ export const useCommentStore = defineStore("CommentStore", {
|
|
|
120
120
|
};
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
|
-
let uuid =
|
|
123
|
+
let uuid = cookiesHelper.getCookie("comment-octopus-uuid");
|
|
124
124
|
if (null === uuid) {
|
|
125
|
-
uuid =
|
|
126
|
-
|
|
125
|
+
uuid = stringHelper.uuidv4();
|
|
126
|
+
cookiesHelper.setCookie("comment-octopus-uuid", uuid);
|
|
127
127
|
}
|
|
128
128
|
const hash = await this.digest(uuid);
|
|
129
129
|
this.commentUser = {
|
|
130
|
-
name:
|
|
130
|
+
name: cookiesHelper.getCookie("comment-octopus-name"),
|
|
131
131
|
uuid: uuid,
|
|
132
132
|
uuidHash: hash,
|
|
133
133
|
};
|
|
@@ -140,7 +140,7 @@ export const useCommentStore = defineStore("CommentStore", {
|
|
|
140
140
|
if (authStore.authProfile || !this.commentUser) {
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
|
-
|
|
143
|
+
cookiesHelper.setCookie("comment-octopus-name", name);
|
|
144
144
|
this.commentUser.name = name;
|
|
145
145
|
},
|
|
146
146
|
async getCommentsConfig(podcast: Podcast): Promise<CommentsConfig> {
|
package/src/style/general.scss
CHANGED
|
@@ -4,6 +4,11 @@ html{
|
|
|
4
4
|
font-size: 20px;
|
|
5
5
|
height: 100%;
|
|
6
6
|
scrollbar-gutter: stable;
|
|
7
|
+
/* scroll-snap-type: y proximity;
|
|
8
|
+
scroll-padding-top: 5rem;
|
|
9
|
+
@media (width <= 650px) {
|
|
10
|
+
scroll-padding-top: 3.5rem;
|
|
11
|
+
} */
|
|
7
12
|
}
|
|
8
13
|
|
|
9
14
|
body{
|
|
@@ -13,7 +18,7 @@ body{
|
|
|
13
18
|
font-size: 0.8rem;
|
|
14
19
|
overflow-x: hidden;
|
|
15
20
|
background: var(--octopus-secondary-lighter);
|
|
16
|
-
min-height:
|
|
21
|
+
min-height: 100vh;
|
|
17
22
|
overscroll-behavior-y: contain;
|
|
18
23
|
display: flex;
|
|
19
24
|
flex-direction: column;
|
|
@@ -25,6 +30,15 @@ main, #app{
|
|
|
25
30
|
flex-grow: 1;
|
|
26
31
|
}
|
|
27
32
|
|
|
33
|
+
/* header, section:not(.page-box), .podcast-inline-container {
|
|
34
|
+
scroll-snap-align: start;
|
|
35
|
+
}
|
|
36
|
+
.page-element > section:first-child {
|
|
37
|
+
scroll-snap-align: none;
|
|
38
|
+
}
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
|
|
28
42
|
/** Octopus style */
|
|
29
43
|
|
|
30
44
|
.octopus-app{
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
methods: {
|
|
3
|
-
setCookie(name: string, value: string, domain = ""): void {
|
|
4
|
-
const date = new Date();
|
|
5
|
-
date.setTime(date.getTime() + 24 * 60 * 60 * 1000);
|
|
6
|
-
const expires = "; expires=" + date.toUTCString();
|
|
7
|
-
document.cookie =
|
|
8
|
-
name + "=" + (value || "") + expires + domain + "; path=/";
|
|
9
|
-
},
|
|
10
|
-
getCookie(name: string): string | null {
|
|
11
|
-
const nameEQ = name + "=";
|
|
12
|
-
const ca = document.cookie.split(";");
|
|
13
|
-
for (const cookieValue of ca) {
|
|
14
|
-
let c = cookieValue;
|
|
15
|
-
while (c.startsWith(" ")) c = c.substring(1, c.length);
|
|
16
|
-
if (0 === c.indexOf(nameEQ))
|
|
17
|
-
return c.substring(nameEQ.length, c.length);
|
|
18
|
-
}
|
|
19
|
-
return null;
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
methods: {
|
|
3
|
-
urlify(text: string): string {
|
|
4
|
-
const urlRegex = /[^">](https?:\/\/[^\s<]+)/g;
|
|
5
|
-
if (!text) return "";
|
|
6
|
-
return text.replace(urlRegex, (url: string) => {
|
|
7
|
-
return (
|
|
8
|
-
'<a href="' + url + '" target="_blank" rel="noreferrer noopener" :title="$t(\'New window\', {text: '+url+'})">' + url + "</a>"
|
|
9
|
-
);
|
|
10
|
-
});
|
|
11
|
-
},
|
|
12
|
-
async onCopyCode(link: string, callback: () => void): Promise<void> {
|
|
13
|
-
await navigator.clipboard.writeText(link);
|
|
14
|
-
return callback();
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import fetchHelper from "../../helper/fetch";
|
|
2
|
-
import { defineComponent } from "vue";
|
|
3
|
-
export default defineComponent({
|
|
4
|
-
methods: {
|
|
5
|
-
async onDownload(
|
|
6
|
-
urlToDownload: string,
|
|
7
|
-
nameOfDownload: string,
|
|
8
|
-
auth = true,
|
|
9
|
-
): Promise<void> {
|
|
10
|
-
const xhr = new XMLHttpRequest();
|
|
11
|
-
xhr.open("GET", urlToDownload, true);
|
|
12
|
-
if (auth) {
|
|
13
|
-
const header = await fetchHelper.createAuthenticatedFetchHeader();
|
|
14
|
-
if (header) {
|
|
15
|
-
xhr.setRequestHeader("Authorization", header.Authorization);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
xhr.responseType = "blob";
|
|
19
|
-
xhr.onload = function () {
|
|
20
|
-
const urlCreator = window.URL || window.webkitURL;
|
|
21
|
-
const imageUrl = urlCreator.createObjectURL(this.response);
|
|
22
|
-
const tag = document.createElement("a");
|
|
23
|
-
tag.href = imageUrl;
|
|
24
|
-
tag.target = "_blank";
|
|
25
|
-
tag.download = nameOfDownload.replace(/ /g, "_");
|
|
26
|
-
document.body.appendChild(tag);
|
|
27
|
-
tag.click();
|
|
28
|
-
document.body.removeChild(tag);
|
|
29
|
-
};
|
|
30
|
-
xhr.send();
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { FetchParam } from "@/stores/class/general/fetchParam";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
methods: {
|
|
5
|
-
getUriSearchParams(parameters: FetchParam): URLSearchParams {
|
|
6
|
-
const _return = new URLSearchParams();
|
|
7
|
-
for (const [key, value] of Object.entries(parameters)) {
|
|
8
|
-
// remove empty array for stats #12323
|
|
9
|
-
if (undefined !== value && '' !== value && (!Array.isArray(value) || (Array.isArray(value) && value.length) )) {
|
|
10
|
-
_return.append(key, value.toString());
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return _return;
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AxiosError } from "axios";
|
|
2
|
-
import { defineComponent } from "vue";
|
|
3
|
-
import { useAuthStore } from "../../stores/AuthStore";
|
|
4
|
-
import { mapState } from "pinia";
|
|
5
|
-
export const handle403 = defineComponent({
|
|
6
|
-
computed: {
|
|
7
|
-
...mapState(useAuthStore, ["authOrgaId"]),
|
|
8
|
-
},
|
|
9
|
-
methods: {
|
|
10
|
-
handle403(error: AxiosError): void {
|
|
11
|
-
if (403 === error.response?.status) {
|
|
12
|
-
if (undefined === this.authOrgaId) {
|
|
13
|
-
window.location.href = window.location.origin + "/sso/login";
|
|
14
|
-
} else {
|
|
15
|
-
this.$router.push({
|
|
16
|
-
path: "/main/pub/error",
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { mapState } from "pinia";
|
|
2
|
-
import { useApiStore } from "../../stores/ApiStore";
|
|
3
|
-
import { defineComponent } from "vue";
|
|
4
|
-
export default defineComponent({
|
|
5
|
-
computed: {
|
|
6
|
-
...mapState(useApiStore, ["imageUrl"]),
|
|
7
|
-
},
|
|
8
|
-
methods: {
|
|
9
|
-
proxyImageUrl(url: string|undefined, width: string, height?: string): string {
|
|
10
|
-
if (!url) {
|
|
11
|
-
return "";
|
|
12
|
-
}
|
|
13
|
-
if (this.imageUrl && url.includes("http")) {
|
|
14
|
-
const size = height ? "height=" + height : "width=" + width;
|
|
15
|
-
const encode = btoa(url).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
|
|
16
|
-
return (
|
|
17
|
-
this.imageUrl +
|
|
18
|
-
"image/" +
|
|
19
|
-
encode +
|
|
20
|
-
"?" +
|
|
21
|
-
size +
|
|
22
|
-
"&useWebp=true"
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
return url;
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Category } from "@/stores/class/general/category";
|
|
2
|
-
import orgaFilter from "../mixins/organisationFilter";
|
|
3
|
-
import classicApi from "../../api/classicApi";
|
|
4
|
-
import { useAuthStore } from "../../stores/AuthStore";
|
|
5
|
-
import { useGeneralStore } from "../../stores/GeneralStore";
|
|
6
|
-
import { mapActions, mapState } from "pinia";
|
|
7
|
-
import { defineComponent } from "vue";
|
|
8
|
-
export default defineComponent({
|
|
9
|
-
mixins: [orgaFilter],
|
|
10
|
-
computed: {
|
|
11
|
-
...mapState(useAuthStore, ["authOrgaId"]),
|
|
12
|
-
},
|
|
13
|
-
methods: {
|
|
14
|
-
...mapActions(useGeneralStore, ["storedUpdateCategories"]),
|
|
15
|
-
async initSdk() {
|
|
16
|
-
classicApi.fetchData<Array<Category>>({
|
|
17
|
-
api: 0,
|
|
18
|
-
path:`iab/list${this.authOrgaId ? "/" + this.authOrgaId : ""}`,
|
|
19
|
-
parameters:{ lang: this.$i18n.locale },
|
|
20
|
-
})
|
|
21
|
-
.then((data: Array<Category>) => {
|
|
22
|
-
if(data.length){
|
|
23
|
-
this.storedUpdateCategories(data);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
const captcha = document.getElementsByClassName(
|
|
27
|
-
"grecaptcha-badge",
|
|
28
|
-
)[0] as HTMLElement;
|
|
29
|
-
if (captcha) {
|
|
30
|
-
captcha.style.display = "none";
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
});
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { defineComponent } from "vue";
|
|
2
|
-
export const loadScript = defineComponent({
|
|
3
|
-
methods: {
|
|
4
|
-
loadScript(src: string, async:boolean, callback: any) {
|
|
5
|
-
const firstElement = document.getElementsByTagName('head')[0] || document.documentElement,
|
|
6
|
-
scriptElement = document.createElement('script');
|
|
7
|
-
scriptElement.type = 'text/javascript';
|
|
8
|
-
scriptElement.src = src;
|
|
9
|
-
scriptElement.async = async;
|
|
10
|
-
scriptElement.addEventListener('load', function() {
|
|
11
|
-
if(callback && typeof callback === 'function') {
|
|
12
|
-
callback(true, window);
|
|
13
|
-
}
|
|
14
|
-
}, false);
|
|
15
|
-
scriptElement.addEventListener('error', function(error) {
|
|
16
|
-
firstElement.removeChild(scriptElement);
|
|
17
|
-
if(callback && typeof callback === 'function') {
|
|
18
|
-
callback(false, error);
|
|
19
|
-
}
|
|
20
|
-
}, false);
|
|
21
|
-
firstElement.insertBefore(scriptElement, firstElement.firstChild);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { mapState } from "pinia";
|
|
2
|
-
import { defineComponent } from "vue";
|
|
3
|
-
import { useGeneralStore } from "../../stores/GeneralStore";
|
|
4
|
-
export default defineComponent({
|
|
5
|
-
computed: {
|
|
6
|
-
...mapState(useGeneralStore, ["metaTitle"]),
|
|
7
|
-
},
|
|
8
|
-
methods: {
|
|
9
|
-
updateMetaTitle(){
|
|
10
|
-
if(""!==this.$route.meta.title){
|
|
11
|
-
document.title = this.$route.meta.title ? this.$t(this.$route.meta.title) +' - '+ this.metaTitle: this.metaTitle;
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { mapState } from "pinia";
|
|
2
|
-
import { defineComponent } from "vue";
|
|
3
|
-
import { useGeneralStore } from "../../stores/GeneralStore";
|
|
4
|
-
export default defineComponent({
|
|
5
|
-
computed: {
|
|
6
|
-
...mapState(useGeneralStore, ["metaTitle"]),
|
|
7
|
-
},
|
|
8
|
-
watch: {
|
|
9
|
-
$route: {
|
|
10
|
-
immediate: true,
|
|
11
|
-
async handler() {
|
|
12
|
-
this.updateMetaTitle();
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"$i18n.locale"() {
|
|
16
|
-
this.updateMetaTitle();
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
methods:{
|
|
20
|
-
updateMetaTitle(){
|
|
21
|
-
if(""!==this.$route.meta.title){
|
|
22
|
-
document.title = this.$route.meta.title ? this.$t(this.$route.meta.title) +' - '+ this.metaTitle: this.metaTitle;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { state } from "../../stores/ParamSdkStore";
|
|
2
|
-
import { useFilterStore } from "../../stores/FilterStore";
|
|
3
|
-
import { useAuthStore } from "../../stores/AuthStore";
|
|
4
|
-
import { mapState } from "pinia";
|
|
5
|
-
import { defineComponent } from "vue";
|
|
6
|
-
export const orgaComputed = defineComponent({
|
|
7
|
-
computed: {
|
|
8
|
-
...mapState(useFilterStore, ["filterOrgaId"]),
|
|
9
|
-
...mapState(useAuthStore, ["isRoleAdmin", "authOrgaId"]),
|
|
10
|
-
isPodcastmaker(): boolean {
|
|
11
|
-
return state.generalParameters.podcastmaker as boolean;
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
methods:{
|
|
15
|
-
isEditRights(orgaId?: string, condition = true){
|
|
16
|
-
return (
|
|
17
|
-
(condition && undefined!==this.authOrgaId&&
|
|
18
|
-
this.authOrgaId === orgaId) ||
|
|
19
|
-
this.isRoleAdmin
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
});
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { handle403 } from "../mixins/handle403";
|
|
2
|
-
import { Rubriquage } from "@/stores/class/rubrique/rubriquage";
|
|
3
|
-
import classicApi from "../../api/classicApi";
|
|
4
|
-
import { useFilterStore } from "../../stores/FilterStore";
|
|
5
|
-
import { mapActions } from "pinia";
|
|
6
|
-
import { defineComponent } from "vue";
|
|
7
|
-
import { AxiosError } from "axios";
|
|
8
|
-
import { state } from "../../stores/ParamSdkStore";
|
|
9
|
-
import { useSaveFetchStore } from "../../stores/SaveFetchStore";
|
|
10
|
-
export default defineComponent({
|
|
11
|
-
mixins: [handle403],
|
|
12
|
-
methods: {
|
|
13
|
-
...mapActions(useSaveFetchStore, ["getOrgaLiveEnabled", "getOrgaData"]),
|
|
14
|
-
...mapActions(useFilterStore, ["filterUpdateOrga"]),
|
|
15
|
-
async selectOrganisation(organisationId: string): Promise<void> {
|
|
16
|
-
try {
|
|
17
|
-
const response = await this.getOrgaData(organisationId);
|
|
18
|
-
const data = await classicApi.fetchData<Array<Rubriquage>>({
|
|
19
|
-
api: 0,
|
|
20
|
-
path:"rubriquage/find/" + organisationId,
|
|
21
|
-
parameters:{
|
|
22
|
-
sort: "HOMEPAGEORDER",
|
|
23
|
-
homePageOrder: true,
|
|
24
|
-
},
|
|
25
|
-
specialTreatement:true
|
|
26
|
-
});
|
|
27
|
-
const isLive = await this.getOrgaLiveEnabled(organisationId);
|
|
28
|
-
this.filterUpdateOrga({
|
|
29
|
-
orgaId: organisationId,
|
|
30
|
-
imgUrl: response.imageUrl,
|
|
31
|
-
name: response.name,
|
|
32
|
-
rubriquageArray: data.filter((element: Rubriquage) => {
|
|
33
|
-
return element.rubriques.length;
|
|
34
|
-
}),
|
|
35
|
-
isLive: isLive,
|
|
36
|
-
});
|
|
37
|
-
if(!state.generalParameters.podcastmaker){
|
|
38
|
-
const queries = this.$route.query;
|
|
39
|
-
this.$router.push({
|
|
40
|
-
query: { ...queries, ...{ productor: organisationId, o:undefined } },
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
} catch (error) {
|
|
44
|
-
this.handle403(error as AxiosError);
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
removeSelectedOrga(): void {
|
|
48
|
-
if (this.$route.query.productor) {
|
|
49
|
-
this.$router.push({
|
|
50
|
-
query: { ...this.$route.query, ...{ productor: undefined } },
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
this.filterUpdateOrga({ orgaId: undefined });
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineComponent } from "vue";
|
|
3
|
-
import DurationHelper from "../../../helper/duration";
|
|
4
|
-
import { usePlayerStore } from "../../../stores/PlayerStore";
|
|
5
|
-
import { useVastStore } from "../../../stores/VastStore";
|
|
6
|
-
import { mapState } from "pinia";
|
|
7
|
-
export const playerDisplayTime = defineComponent({
|
|
8
|
-
|
|
9
|
-
computed: {
|
|
10
|
-
...mapState(usePlayerStore, [
|
|
11
|
-
"playedTime",
|
|
12
|
-
"totalTime",
|
|
13
|
-
"transcriptText",
|
|
14
|
-
"radioUrl",
|
|
15
|
-
]),
|
|
16
|
-
...mapState(useVastStore, ["isAdPlaying", "currentAd","currentTimeAd", "currentDurationAd", "isAdPaused", "titleAdvertising"]),
|
|
17
|
-
displayPlayTime():string{
|
|
18
|
-
if(this.isAdPlaying){
|
|
19
|
-
return DurationHelper.formatDuration(Math.round(this.currentTimeAd));
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
return this.playedTime;
|
|
23
|
-
},
|
|
24
|
-
displayTotalTime():string{
|
|
25
|
-
if(this.isAdPlaying){
|
|
26
|
-
return DurationHelper.formatDuration(Math.round(this.currentDurationAd));
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
return this.totalTime;
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import uuidGenerator from "../../../helper/uuidGenerator";
|
|
2
|
-
import dayjs from "dayjs";
|
|
3
|
-
import { playerLogicProgress} from "./playerLogicProgress";
|
|
4
|
-
import { usePlayerStore } from "../../../stores/PlayerStore";
|
|
5
|
-
import { useApiStore } from "../../../stores/ApiStore";
|
|
6
|
-
import { useAuthStore } from "../../../stores/AuthStore";
|
|
7
|
-
import { mapState, mapActions } from "pinia";
|
|
8
|
-
/* eslint-disable */
|
|
9
|
-
let Hls:any = null;
|
|
10
|
-
/* eslint-enable */
|
|
11
|
-
const maxMinutesSessionId = 1;
|
|
12
|
-
import { defineComponent } from "vue";
|
|
13
|
-
export const playerLive = defineComponent({
|
|
14
|
-
mixins: [playerLogicProgress],
|
|
15
|
-
data() {
|
|
16
|
-
return {
|
|
17
|
-
listenTime: 0 as number,
|
|
18
|
-
notListenTime: 0 as number,
|
|
19
|
-
lastSend: 0 as number,
|
|
20
|
-
hlsReady: false as boolean,
|
|
21
|
-
downloadId: null as string | null,
|
|
22
|
-
audioElement: null as HTMLAudioElement | null,
|
|
23
|
-
hls: null as any,
|
|
24
|
-
hlsRetryTimeout: undefined as ReturnType<typeof setTimeout> | undefined,
|
|
25
|
-
playPromise: undefined as any,
|
|
26
|
-
errorHls: false as boolean,
|
|
27
|
-
};
|
|
28
|
-
},
|
|
29
|
-
computed: {
|
|
30
|
-
...mapState(usePlayerStore, ["playerLive", "playerRadio", "playerVideo", "playerStatus"]),
|
|
31
|
-
...mapState(useAuthStore, ["authOrgaId"]),
|
|
32
|
-
...mapState(useApiStore, ["hlsUrl"]),
|
|
33
|
-
},
|
|
34
|
-
methods: {
|
|
35
|
-
...mapActions(usePlayerStore, ["playerChangeStatus"]),
|
|
36
|
-
onPlay(): void {
|
|
37
|
-
this.playerChangeStatus("PAUSED"===this.playerStatus);
|
|
38
|
-
},
|
|
39
|
-
playRadio() {
|
|
40
|
-
if (!this.playerRadio) return;
|
|
41
|
-
this.handleSessionIdRadio();
|
|
42
|
-
this.playHls(this.playerRadio.url+"?origin=octopus&sessionId="+this.playerRadio.sessionId);
|
|
43
|
-
},
|
|
44
|
-
handleSessionIdRadio(){
|
|
45
|
-
if(!this.playerRadio) return;
|
|
46
|
-
if(this.playerRadio.sessionId && dayjs().diff(dayjs(this.playerRadio.dateSessionId), 'm')<maxMinutesSessionId){
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
this.playerRadio.sessionId = uuidGenerator.uuidv4();
|
|
50
|
-
},
|
|
51
|
-
playLive() {
|
|
52
|
-
if (!this.playerLive) return;
|
|
53
|
-
const hlsStreamUrl = `${this.hlsUrl}live/dev.${this.playerLive.conferenceId}/index.m3u8`;
|
|
54
|
-
this.playHls(hlsStreamUrl);
|
|
55
|
-
},
|
|
56
|
-
async playHls(hlsStreamUrl: string): Promise<void> {
|
|
57
|
-
try {
|
|
58
|
-
if(null===this.audioElement){
|
|
59
|
-
this.audioElement = document.getElementById(
|
|
60
|
-
"audio-player",
|
|
61
|
-
) as HTMLAudioElement;
|
|
62
|
-
}
|
|
63
|
-
if (null === this.audioElement) {
|
|
64
|
-
setTimeout(() => {
|
|
65
|
-
this.playHls(hlsStreamUrl);
|
|
66
|
-
}, 1000);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
const ua = navigator.userAgent.toLowerCase();
|
|
70
|
-
const isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile");
|
|
71
|
-
if (
|
|
72
|
-
this.audioElement.canPlayType("application/vnd.apple.mpegurl") &&
|
|
73
|
-
!isAndroid
|
|
74
|
-
) {
|
|
75
|
-
this.audioElement.src = hlsStreamUrl;
|
|
76
|
-
await this.initLiveDownloadId();
|
|
77
|
-
this.hlsReady = true;
|
|
78
|
-
await this.audioElement.play();
|
|
79
|
-
this.onPlay();
|
|
80
|
-
} else {
|
|
81
|
-
await this.initHls(hlsStreamUrl);
|
|
82
|
-
}
|
|
83
|
-
} catch {
|
|
84
|
-
this.onHlsError(hlsStreamUrl);
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
onHlsError(hlsStreamUrl:string){
|
|
88
|
-
if("STOPPED"!==this.playerStatus && undefined===this.hlsRetryTimeout){
|
|
89
|
-
this.hlsRetryTimeout = setTimeout(() => {
|
|
90
|
-
this.errorHls = false;
|
|
91
|
-
this.playHls(hlsStreamUrl);
|
|
92
|
-
this.hlsRetryTimeout = undefined;
|
|
93
|
-
}, 5000);
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
async initHls(hlsStreamUrl: string) {
|
|
97
|
-
if (null === Hls) {
|
|
98
|
-
await import("hls.js").then((hlsLibrary) => {
|
|
99
|
-
Hls = hlsLibrary.default;
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
if (!Hls.isSupported()) {
|
|
103
|
-
throw new Error("Hls is not supported ! ");
|
|
104
|
-
}
|
|
105
|
-
this.hls = new Hls();
|
|
106
|
-
this.hls.on(Hls.Events.MANIFEST_PARSED, async () => {
|
|
107
|
-
await this.initLiveDownloadId();
|
|
108
|
-
this.hlsReady = true;
|
|
109
|
-
if(true===this.errorHls){
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
this.playPromise = (this.audioElement as HTMLAudioElement).play();
|
|
113
|
-
this.playPromise.then(() =>{
|
|
114
|
-
this.playPromise = undefined;
|
|
115
|
-
this.onPlay();
|
|
116
|
-
}).catch(()=>{
|
|
117
|
-
this.onHlsError(hlsStreamUrl);
|
|
118
|
-
this.playPromise = undefined;
|
|
119
|
-
})
|
|
120
|
-
});
|
|
121
|
-
this.hls.on(Hls.Events.ERROR, async (e, data:any) => {
|
|
122
|
-
this.errorHls = true;
|
|
123
|
-
if(undefined===this.playPromise && data.fatal){
|
|
124
|
-
this.onHlsError(hlsStreamUrl);
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
this.hls.loadSource(hlsStreamUrl);
|
|
128
|
-
this.hls.attachMedia(this.audioElement as HTMLAudioElement);
|
|
129
|
-
},
|
|
130
|
-
async endingLive(): Promise<void> {
|
|
131
|
-
clearTimeout(this.hlsRetryTimeout);
|
|
132
|
-
this.hlsRetryTimeout = undefined;
|
|
133
|
-
this.audioElement = null;
|
|
134
|
-
const audio: HTMLElement | null = document.getElementById("audio-player");
|
|
135
|
-
if (audio && this.hls) {
|
|
136
|
-
this.hls.destroy();
|
|
137
|
-
this.hls = null;
|
|
138
|
-
}else{
|
|
139
|
-
(audio as HTMLAudioElement).pause();
|
|
140
|
-
}
|
|
141
|
-
(audio as HTMLAudioElement).src = "";
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
});
|