@saooti/octopus-sdk 40.2.19 → 41.0.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 +2 -1
- package/package.json +4 -3
- package/src/App.vue +71 -95
- package/src/components/composable/player/usePlayerLive.ts +13 -4
- package/src/components/composable/player/usePlayerLogic.ts +6 -6
- package/src/components/composable/player/usePlayerVast.ts +7 -7
- package/src/components/composable/podcasts/usePodcastView.ts +3 -3
- package/src/components/composable/route/useAdvancedParamInit.ts +1 -1
- package/src/components/composable/route/useRouteUpdateParams.ts +4 -4
- package/src/components/composable/route/useSimplePageParam.ts +15 -8
- package/src/components/composable/useInit.ts +2 -2
- package/src/components/composable/useMetaTitleWatch.ts +2 -2
- package/src/components/display/accessibility/AccessibilityModal.vue +56 -68
- package/src/components/display/categories/CategoryChooser.vue +144 -145
- package/src/components/display/categories/CategoryFilter.vue +172 -198
- package/src/components/display/categories/CategoryList.vue +122 -147
- package/src/components/display/comments/CommentInput.vue +100 -122
- package/src/components/display/comments/CommentList.vue +169 -191
- package/src/components/display/comments/CommentName.vue +35 -45
- package/src/components/display/comments/CommentParentInfo.vue +28 -34
- package/src/components/display/comments/CommentPlayer.vue +38 -50
- package/src/components/display/comments/CommentSection.vue +85 -103
- package/src/components/display/comments/item/CommentBasicView.vue +48 -61
- package/src/components/display/comments/item/CommentItem.vue +104 -115
- package/src/components/display/comments/item/CommentMoreActions.vue +174 -189
- package/src/components/display/comments/item/CommentMoreActionsAdmin.vue +1 -3
- package/src/components/display/comments/like/LikeButton.vue +36 -41
- package/src/components/display/comments/like/LikeSection.vue +128 -136
- package/src/components/display/comments/modal/CheckIdentityModal.vue +35 -40
- package/src/components/display/comments/modal/EditCommentModal.vue +72 -78
- package/src/components/display/comments/modal/RecaptchaModal.vue +58 -63
- package/src/components/display/comments/modal/ReportAbuseModal.vue +59 -66
- package/src/components/display/edit/EditBox.vue +9 -8
- package/src/components/display/edit/EditBoxRadio.vue +1 -5
- package/src/components/display/emission/EmissionInlineList.vue +82 -97
- package/src/components/display/emission/EmissionItem.vue +57 -69
- package/src/components/display/emission/EmissionList.vue +189 -218
- package/src/components/display/emission/EmissionPlayerItem.vue +47 -64
- package/src/components/display/emission/EmissionPresentationItem.vue +44 -54
- package/src/components/display/emission/EmissionPresentationList.vue +51 -61
- package/src/components/display/filter/AdvancedSearch.vue +151 -176
- package/src/components/display/filter/CategorySearchFilter.vue +43 -46
- package/src/components/display/filter/DateFilter.vue +76 -91
- package/src/components/display/filter/MonetizableFilter.vue +27 -30
- package/src/components/display/filter/ProductorSearch.vue +87 -90
- package/src/components/display/filter/RubriqueChoice.vue +58 -63
- package/src/components/display/filter/RubriqueFilter.vue +154 -169
- package/src/components/display/filter/SearchOrder.vue +35 -35
- package/src/components/display/list/ListPaginate.vue +72 -93
- package/src/components/display/list/PaginateParams.vue +36 -40
- package/src/components/display/list/PaginateSection.vue +113 -124
- package/src/components/display/list/SwiperList.vue +97 -109
- package/src/components/display/live/CountDown.vue +15 -9
- package/src/components/display/live/CountdownOctopus.vue +16 -10
- package/src/components/display/live/LiveHorizontalList.vue +95 -103
- package/src/components/display/live/LiveItem.vue +64 -73
- package/src/components/display/live/LiveList.vue +125 -137
- package/src/components/display/live/RadioCurrently.vue +66 -73
- package/src/components/display/live/RadioImage.vue +39 -50
- package/src/components/display/live/RadioItem.vue +9 -14
- package/src/components/display/live/RadioList.vue +39 -53
- package/src/components/display/live/RadioPlanning.vue +210 -222
- package/src/components/display/organisation/OrganisationChooser.vue +116 -122
- package/src/components/display/organisation/OrganisationChooserLight.vue +44 -52
- package/src/components/display/participant/ParticipantInlineList.vue +42 -58
- package/src/components/display/participant/ParticipantItem.vue +66 -74
- package/src/components/display/participant/ParticipantList.vue +116 -141
- package/src/components/display/playlist/PlaylistItem.vue +33 -46
- package/src/components/display/playlist/PlaylistList.vue +115 -144
- package/src/components/display/playlist/PodcastList.vue +90 -103
- package/src/components/display/playlist/PodcastPlaylistInlineList.vue +58 -70
- package/src/components/display/podcastmaker/PodcastmakerHeader.vue +21 -22
- package/src/components/display/podcasts/AnimatorsItem.vue +15 -16
- package/src/components/display/podcasts/DownloadPodcastButton.vue +21 -29
- package/src/components/display/podcasts/ParticipantDescription.vue +22 -24
- package/src/components/display/podcasts/PodcastFilterList.vue +62 -56
- package/src/components/display/podcasts/PodcastImage.vue +96 -99
- package/src/components/display/podcasts/PodcastInlineList.vue +30 -28
- package/src/components/display/podcasts/PodcastInlineListTemplate.vue +107 -114
- package/src/components/display/podcasts/PodcastIsPlaying.vue +4 -12
- package/src/components/display/podcasts/PodcastItem.vue +48 -63
- package/src/components/display/podcasts/PodcastItemInfo.vue +19 -35
- package/src/components/display/podcasts/PodcastList.vue +182 -206
- package/src/components/display/podcasts/PodcastModuleBox.vue +100 -137
- package/src/components/display/podcasts/PodcastPlannedSpinner.vue +4 -6
- package/src/components/display/podcasts/PodcastPlayBar.vue +50 -61
- package/src/components/display/podcasts/PodcastPlayBasicButton.vue +38 -41
- package/src/components/display/podcasts/PodcastPlayButton.vue +164 -175
- package/src/components/display/podcasts/PodcastRawTranscript.vue +69 -80
- package/src/components/display/podcasts/PodcastRubriqueList.vue +35 -38
- package/src/components/display/podcasts/PodcastSwiperList.vue +100 -110
- package/src/components/display/podcasts/TagList.vue +48 -50
- package/src/components/display/podcasts/VideoModuleBox.vue +13 -24
- package/src/components/display/rubriques/RubriqueChooser.vue +135 -140
- package/src/components/display/rubriques/RubriqueList.vue +140 -160
- package/src/components/display/sharing/ChooseEpisodesNumber.vue +34 -33
- package/src/components/display/sharing/FormatSwitch.vue +16 -11
- package/src/components/display/sharing/PlayerAnonymousModal.vue +24 -27
- package/src/components/display/sharing/PlayerCommonParameters.vue +20 -13
- package/src/components/display/sharing/PlayerParameters.vue +69 -71
- package/src/components/display/sharing/QrCode.vue +55 -67
- package/src/components/display/sharing/ShareAnonymous.vue +160 -178
- package/src/components/display/sharing/ShareDistribution.vue +103 -117
- package/src/components/display/sharing/ShareNewsletter.vue +154 -161
- package/src/components/display/sharing/SharePlayer.vue +273 -295
- package/src/components/display/sharing/SharePlayerColors.vue +25 -16
- package/src/components/display/sharing/SharePlayerRadio.vue +61 -69
- package/src/components/display/sharing/SharePlayerTypes.vue +176 -176
- package/src/components/display/sharing/ShareSocialsButtons.vue +63 -75
- package/src/components/display/sharing/SubscribeButtons.vue +184 -207
- package/src/components/display/studio/RecordingItemButton.vue +1 -4
- package/src/components/form/ClassicCheckbox.vue +26 -30
- package/src/components/form/ClassicContentEditable.vue +37 -33
- package/src/components/form/ClassicCopyButton.vue +40 -44
- package/src/components/form/ClassicDatePicker.vue +114 -114
- package/src/components/form/ClassicEmojiPicker.vue +20 -28
- package/src/components/form/ClassicInputText.vue +116 -120
- package/src/components/form/ClassicLoading.vue +7 -12
- package/src/components/form/ClassicMultiselect.vue +115 -117
- package/src/components/form/ClassicRadio.vue +21 -16
- package/src/components/form/ClassicRadioLabel.vue +23 -22
- package/src/components/form/ClassicSearch.vue +24 -19
- package/src/components/form/ClassicSelect.vue +47 -38
- package/src/components/form/ClassicWysiwyg.vue +116 -123
- package/src/components/icons/AmazonMusicIcon.vue +7 -10
- package/src/components/icons/ApplePodcastIcon.vue +7 -11
- package/src/components/icons/BlueSkyIcon.vue +8 -11
- package/src/components/icons/DeezerIcon.vue +8 -11
- package/src/components/icons/EditFtpIcon.vue +8 -11
- package/src/components/icons/IHeartIcon.vue +8 -11
- package/src/components/icons/PlayVideoIcon.vue +7 -10
- package/src/components/icons/PlayerFmIcon.vue +7 -10
- package/src/components/icons/PocketCastIcon.vue +8 -11
- package/src/components/icons/PodcastAddictIcon.vue +7 -10
- package/src/components/icons/RadiolineIcon.vue +8 -11
- package/src/components/icons/TuninIcon.vue +8 -11
- package/src/components/icons/XIcon.vue +7 -10
- package/src/components/misc/AcpmImage.vue +6 -7
- package/src/components/misc/ClassicAccordion.vue +26 -31
- package/src/components/misc/ClassicLazy.vue +86 -90
- package/src/components/misc/ClassicNav.vue +16 -20
- package/src/components/misc/ClassicPopover.vue +271 -282
- package/src/components/misc/ClassicSpinner.vue +5 -27
- package/src/components/misc/ErrorMessage.vue +11 -12
- package/src/components/misc/FooterGarSection.vue +33 -41
- package/src/components/misc/FooterSection.vue +94 -131
- package/src/components/misc/HomeDropdown.vue +83 -105
- package/src/components/misc/MobileMenu.vue +101 -111
- package/src/components/misc/ProgressBar.vue +53 -62
- package/src/components/misc/TopBar.vue +98 -120
- package/src/components/misc/TopBarMainContent.vue +114 -133
- package/src/components/misc/modal/ClassicModal.vue +40 -33
- package/src/components/misc/modal/ClassicModalInBody.vue +34 -28
- package/src/components/misc/modal/ClipboardModal.vue +27 -30
- package/src/components/misc/modal/ContractPreviewModal.vue +64 -62
- package/src/components/misc/modal/MessageModal.vue +50 -47
- package/src/components/misc/modal/NewsletterModal.vue +30 -31
- package/src/components/misc/modal/QrCodeModal.vue +21 -21
- package/src/components/misc/modal/ShareModalPlayer.vue +43 -52
- package/src/components/misc/player/PlayerCompact.vue +6 -4
- package/src/components/misc/player/PlayerComponent.vue +8 -9
- package/src/components/misc/player/PlayerLarge.vue +9 -8
- package/src/components/misc/player/ads/AdsProgressBar.vue +8 -11
- package/src/components/misc/player/ads/AdsSkipButton.vue +24 -30
- package/src/components/misc/player/chaptering/ChapteringModal.vue +44 -54
- package/src/components/misc/player/chaptering/PlayerChaptering.vue +50 -62
- package/src/components/misc/player/elements/PlayerImage.vue +51 -57
- package/src/components/misc/player/elements/PlayerPlayButton.vue +81 -92
- package/src/components/misc/player/elements/PlayerSpeedButton.vue +23 -27
- package/src/components/misc/player/elements/PlayerTitle.vue +85 -111
- package/src/components/misc/player/progressbar/PlayerProgressBar.vue +18 -29
- package/src/components/misc/player/progressbar/PodcastProgressBar.vue +45 -56
- package/src/components/misc/player/radio/RadioHistory.vue +80 -99
- package/src/components/misc/player/radio/RadioProgressBar.vue +43 -54
- package/src/components/misc/player/video/PlayerVideo.vue +27 -40
- package/src/components/misc/player/video/PlayerVideoDigiteka.vue +32 -37
- package/src/components/misc/player/video/PlayerVideoHls.vue +199 -198
- package/src/components/misc/player/video/PlayerYoutubeEmbed.vue +10 -12
- package/src/components/pages/CategoryPage.vue +28 -33
- package/src/components/pages/EmissionPage.vue +113 -132
- package/src/components/pages/EmissionsPage.vue +2 -0
- package/src/components/pages/Error403Page.vue +21 -20
- package/src/components/pages/HomePage.vue +91 -100
- package/src/components/pages/LivesPage.vue +35 -37
- package/src/components/pages/MapPage.vue +209 -241
- package/src/components/pages/PageLogout.vue +8 -11
- package/src/components/pages/PageNotFound.vue +9 -5
- package/src/components/pages/ParticipantPage.vue +96 -110
- package/src/components/pages/ParticipantsPage.vue +3 -0
- package/src/components/pages/PlaylistPage.vue +112 -117
- package/src/components/pages/PlaylistsPage.vue +9 -2
- package/src/components/pages/PodcastPage.vue +224 -238
- package/src/components/pages/PodcastsPage.vue +9 -2
- package/src/components/pages/RadioPage.vue +56 -70
- package/src/components/pages/RubriquePage.vue +7 -3
- package/src/components/pages/SearchPage.vue +31 -36
- package/src/components/pages/TagPage.vue +11 -9
- package/src/components/pages/VideoPage.vue +14 -11
- package/src/helper/displayHelper.ts +1 -1
- package/src/helper/loadScript.ts +4 -4
- package/src/i18n.ts +2 -2
- package/src/main.ts +1 -1
- package/src/router/router.ts +17 -4
- package/src/stores/AuthStore.ts +12 -12
- package/src/stores/FilterStore.ts +1 -1
- package/src/stores/VastStore.ts +2 -2
- package/src/stores/class/general/player.ts +1 -0
- package/public/css/fonts/icomoon.eot +0 -0
- package/public/css/fonts/icomoon.svg +0 -113
- package/public/css/fonts/icomoon.ttf +0 -0
- package/public/css/fonts/icomoon.woff +0 -0
- package/public/css/fonts/icomoon.woff2 +0 -0
- package/public/css/fonts/style.css +0 -352
- package/sonarqube-scanner.js +0 -10
|
@@ -13,216 +13,217 @@
|
|
|
13
13
|
></video>
|
|
14
14
|
</div>
|
|
15
15
|
</template>
|
|
16
|
-
<script lang="ts">
|
|
16
|
+
<script setup lang="ts">
|
|
17
17
|
import { usePlayerStore } from "../../../../stores/PlayerStore";
|
|
18
|
-
import { mapActions, mapState } from "pinia";
|
|
19
18
|
import {usePlayerLogicProgress} from "../../../composable/player/usePlayerLogicProgress";
|
|
20
19
|
import videojs, { VideoJsPlayer } from "video.js";
|
|
21
20
|
import qualitySelectorHls from "videojs-quality-selector-hls";
|
|
22
21
|
if (undefined === videojs.getPlugin("qualitySelectorHls")) {
|
|
23
22
|
videojs.registerPlugin("qualitySelectorHls", qualitySelectorHls);
|
|
24
23
|
}
|
|
25
|
-
import {
|
|
24
|
+
import { computed, onMounted, onUnmounted, Ref, ref, useTemplateRef } from "vue";
|
|
26
25
|
import { useAuthStore } from "../../../../stores/AuthStore";
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
26
|
+
import { useI18n } from "vue-i18n";
|
|
27
|
+
|
|
28
|
+
//Props
|
|
29
|
+
const props = defineProps({
|
|
30
|
+
hlsUrl: { default: "", type: String },
|
|
31
|
+
responsive: { default: false, type: Boolean },
|
|
32
|
+
isSecured: { default: true, type: Boolean },
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
//Data
|
|
36
|
+
const errorPlay = ref("");
|
|
37
|
+
const useVideoSrc = ref(false);
|
|
38
|
+
const player: Ref<VideoJsPlayer | undefined> = ref(false);
|
|
39
|
+
const playing = ref(false);
|
|
40
|
+
const isPaused = ref(false);
|
|
41
|
+
const stalledTimout: Ref<ReturnType<typeof setTimeout> | undefined> = ref(undefined);
|
|
42
|
+
const videoElementRef = useTemplateRef('videoelement');
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
//Composables
|
|
46
|
+
const { t } = useI18n();
|
|
47
|
+
const { downloadId, initLiveDownloadId, onTimeUpdateProgress, endListeningProgress} = usePlayerLogicProgress();
|
|
48
|
+
const authStore = useAuthStore();
|
|
49
|
+
const playerStore = usePlayerStore();
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
//Computed
|
|
54
|
+
const videoElement = computed(() => {
|
|
55
|
+
return videoElementRef?.value as HTMLVideoElement;
|
|
56
|
+
});
|
|
57
|
+
const videoOptions = computed(() => {
|
|
58
|
+
return {
|
|
59
|
+
autoplay: true,
|
|
60
|
+
controls: true,
|
|
61
|
+
liveui: true,
|
|
62
|
+
sources: [
|
|
63
|
+
{
|
|
64
|
+
src: props.hlsUrl,
|
|
65
|
+
type: "application/x-mpegURL",
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
html5: {
|
|
69
|
+
vhs: {
|
|
70
|
+
overrideNative: !videojs.browser.IS_SAFARI,
|
|
71
|
+
},
|
|
72
|
+
nativeAudioTracks: false,
|
|
73
|
+
nativeVideoTracks: false,
|
|
75
74
|
},
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
onMounted(()=>{
|
|
80
|
+
playerStore.playerUpdatePlayerHlsUrl(props.hlsUrl);
|
|
81
|
+
useVideoSrc.value =
|
|
82
|
+
"" !== videoElement.value.canPlayType("application/vnd.apple.mpegurl") &&
|
|
83
|
+
!navigator.userAgent.includes("Android");
|
|
84
|
+
playLive();
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
onUnmounted(()=>{
|
|
88
|
+
if (playing.value) {
|
|
89
|
+
stopLive();
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
//Methods
|
|
95
|
+
function definedStalledTimeout() {
|
|
96
|
+
isPaused.value = false;
|
|
97
|
+
stalledTimout.value = setTimeout(() => {
|
|
98
|
+
if (isPaused.value) {
|
|
99
|
+
return;
|
|
88
100
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
this.definedStalledTimeout();
|
|
106
|
-
await this.initLiveDownloadId();
|
|
107
|
-
if (this.useVideoSrc) {
|
|
108
|
-
this.playLiveIos();
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
if (this.isSecured && this.authParam.accessToken) {
|
|
112
|
-
const globalXhrRequestHook = (options: any) => {
|
|
113
|
-
options.beforeSend = (xhr: XMLHttpRequest) => {
|
|
114
|
-
xhr.setRequestHeader("Authorization", "Bearer "+this.authParam.accessToken);
|
|
115
|
-
};
|
|
116
|
-
return options;
|
|
117
|
-
};
|
|
118
|
-
videojs.Vhs.xhr.onRequest(globalXhrRequestHook);
|
|
119
|
-
}
|
|
120
|
-
this.player = videojs(
|
|
121
|
-
document.getElementById("video-element-hls") as Element,
|
|
122
|
-
this.videoOptions,
|
|
123
|
-
() => {
|
|
124
|
-
this.player.qualitySelectorHls({ displayCurrentQuality: true });
|
|
125
|
-
this.errorPlay = "";
|
|
126
|
-
this.playing = true;
|
|
127
|
-
},
|
|
128
|
-
);
|
|
129
|
-
this.player.on("error", (error) => {
|
|
130
|
-
this.stopLive();
|
|
131
|
-
if (error.description?.includes("403")) {
|
|
132
|
-
this.errorPlay = this.$t("Video is unavailable");
|
|
133
|
-
} else {
|
|
134
|
-
this.errorPlay = this.$t("Podcast play error");
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
this.player.on("seeking", () => {
|
|
138
|
-
this.playerUpdateSeekTime(this.player?.currentTime() ?? 0);
|
|
139
|
-
});
|
|
140
|
-
this.player.on("pause", () => {
|
|
141
|
-
this.isPaused = true;
|
|
142
|
-
});
|
|
143
|
-
this.player.on("timeupdate", () => {
|
|
144
|
-
clearTimeout(this.stalledTimout);
|
|
145
|
-
this.definedStalledTimeout();
|
|
146
|
-
this.onTimeUpdateVideo();
|
|
147
|
-
});
|
|
148
|
-
this.player.on("seeking", () => {
|
|
149
|
-
this.playerUpdateSeekTime(this.player?.currentTime() ?? 0);
|
|
150
|
-
});
|
|
151
|
-
},
|
|
152
|
-
async playLiveIos(): Promise<void> {
|
|
153
|
-
this.videoElement.onloadedmetadata = () => {
|
|
154
|
-
const playPromise = this.videoElement.play();
|
|
155
|
-
if (playPromise !== undefined) {
|
|
156
|
-
playPromise
|
|
157
|
-
.then(() => {
|
|
158
|
-
this.errorPlay = "";
|
|
159
|
-
this.playing = true;
|
|
160
|
-
})
|
|
161
|
-
.catch(() => {
|
|
162
|
-
this.playing = false;
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
this.videoElement.onerror = async () => {
|
|
167
|
-
this.stopLive();
|
|
168
|
-
this.errorPlay = this.$t("Podcast play error");
|
|
169
|
-
};
|
|
170
|
-
this.videoElement.ontimeupdate = async () => {
|
|
171
|
-
clearTimeout(this.stalledTimout);
|
|
172
|
-
this.definedStalledTimeout();
|
|
173
|
-
this.onTimeUpdateVideo();
|
|
174
|
-
};
|
|
175
|
-
this.videoElement.onpause = async () => {
|
|
176
|
-
this.isPaused = true;
|
|
177
|
-
};
|
|
178
|
-
this.videoElement.onseeking = async () => {
|
|
179
|
-
this.playerUpdateSeekTime(this.videoElement.currentTime);
|
|
101
|
+
videoClean();
|
|
102
|
+
playLive();
|
|
103
|
+
}, 15000);
|
|
104
|
+
}
|
|
105
|
+
async function playLive(): Promise<void> {
|
|
106
|
+
clearTimeout(stalledTimout.value);
|
|
107
|
+
definedStalledTimeout();
|
|
108
|
+
await initLiveDownloadId();
|
|
109
|
+
if (useVideoSrc.value) {
|
|
110
|
+
playLiveIos();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (props.isSecured && authStore.authParam.accessToken) {
|
|
114
|
+
const globalXhrRequestHook = (options: any) => {
|
|
115
|
+
options.beforeSend = (xhr: XMLHttpRequest) => {
|
|
116
|
+
xhr.setRequestHeader("Authorization", "Bearer "+authStore.authParam.accessToken);
|
|
180
117
|
};
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
this.videoElement.load();
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
if (this.player) {
|
|
196
|
-
this.player.dispose();
|
|
197
|
-
//Redraw
|
|
198
|
-
const video_parent = document.getElementById("player-video-hls");
|
|
199
|
-
if (video_parent) {
|
|
200
|
-
const video = document.createElement("video");
|
|
201
|
-
video.id = "video-element-hls";
|
|
202
|
-
video.className = "video-js";
|
|
203
|
-
video.preload = "auto";
|
|
204
|
-
video.setAttribute("playsinline", "true");
|
|
205
|
-
video_parent.appendChild(video);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
stopLive(): void {
|
|
210
|
-
clearTimeout(this.stalledTimout);
|
|
211
|
-
this.errorPlay = "";
|
|
212
|
-
this.videoClean();
|
|
213
|
-
this.playing = false;
|
|
214
|
-
this.endListeningProgress();
|
|
215
|
-
},
|
|
216
|
-
onTimeUpdateVideo(): void {
|
|
217
|
-
if (!this.downloadId) {
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
const currentTime =
|
|
221
|
-
this.player?.currentTime() ?? this.videoElement.currentTime;
|
|
222
|
-
this.onTimeUpdateProgress(currentTime);
|
|
118
|
+
return options;
|
|
119
|
+
};
|
|
120
|
+
videojs.Vhs.xhr.onRequest(globalXhrRequestHook);
|
|
121
|
+
}
|
|
122
|
+
player.value = videojs(
|
|
123
|
+
document.getElementById("video-element-hls") as Element,
|
|
124
|
+
videoOptions.value,
|
|
125
|
+
() => {
|
|
126
|
+
player.value.qualitySelectorHls({ displayCurrentQuality: true });
|
|
127
|
+
errorPlay.value = "";
|
|
128
|
+
playing.value = true;
|
|
223
129
|
},
|
|
224
|
-
|
|
225
|
-
|
|
130
|
+
);
|
|
131
|
+
player.value.on("error", (error: any) => {
|
|
132
|
+
stopLive();
|
|
133
|
+
if (error.description?.includes("403")) {
|
|
134
|
+
errorPlay.value = t("Video is unavailable");
|
|
135
|
+
} else {
|
|
136
|
+
errorPlay.value = t("Podcast play error");
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
player.value.on("seeking", () => {
|
|
140
|
+
playerStore.playerUpdateSeekTime(player.value?.currentTime() ?? 0);
|
|
141
|
+
});
|
|
142
|
+
player.value.on("pause", () => {
|
|
143
|
+
isPaused.value = true;
|
|
144
|
+
});
|
|
145
|
+
player.value.on("timeupdate", () => {
|
|
146
|
+
clearTimeout(stalledTimout.value);
|
|
147
|
+
definedStalledTimeout();
|
|
148
|
+
onTimeUpdateVideo();
|
|
149
|
+
});
|
|
150
|
+
player.value.on("seeking", () => {
|
|
151
|
+
playerStore.playerUpdateSeekTime(player.value?.currentTime() ?? 0);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
async function playLiveIos(): Promise<void> {
|
|
156
|
+
videoElement.value.onloadedmetadata = () => {
|
|
157
|
+
const playPromise = videoElement.value.play();
|
|
158
|
+
if (playPromise !== undefined) {
|
|
159
|
+
playPromise
|
|
160
|
+
.then(() => {
|
|
161
|
+
errorPlay.value = "";
|
|
162
|
+
playing.value = true;
|
|
163
|
+
})
|
|
164
|
+
.catch(() => {
|
|
165
|
+
playing.value = false;
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
videoElement.value.onerror = async () => {
|
|
170
|
+
stopLive();
|
|
171
|
+
errorPlay.value = t("Podcast play error");
|
|
172
|
+
};
|
|
173
|
+
videoElement.value.ontimeupdate = async () => {
|
|
174
|
+
clearTimeout(stalledTimout.value);
|
|
175
|
+
definedStalledTimeout();
|
|
176
|
+
onTimeUpdateVideo();
|
|
177
|
+
};
|
|
178
|
+
videoElement.value.onpause = async () => {
|
|
179
|
+
isPaused.value = true;
|
|
180
|
+
};
|
|
181
|
+
videoElement.value.onseeking = async () => {
|
|
182
|
+
playerStore.playerUpdateSeekTime(videoElement.value.currentTime);
|
|
183
|
+
};
|
|
184
|
+
if (props.isSecured && authStore.authParam.accessToken) {
|
|
185
|
+
videoElement.value.src = props.hlsUrl + "access_token="+authStore.authParam.accessToken;
|
|
186
|
+
}else{
|
|
187
|
+
videoElement.value.src = props.hlsUrl;
|
|
188
|
+
}
|
|
189
|
+
videoElement.value.src = props.hlsUrl;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function videoClean(): void {
|
|
193
|
+
if (useVideoSrc.value) {
|
|
194
|
+
videoElement.value.pause();
|
|
195
|
+
videoElement.value.removeAttribute("src");
|
|
196
|
+
videoElement.value.load();
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (player.value) {
|
|
200
|
+
player.value.dispose();
|
|
201
|
+
//Redraw
|
|
202
|
+
const video_parent = document.getElementById("player-video-hls");
|
|
203
|
+
if (video_parent) {
|
|
204
|
+
const video = document.createElement("video");
|
|
205
|
+
video.id = "video-element-hls";
|
|
206
|
+
video.className = "video-js";
|
|
207
|
+
video.preload = "auto";
|
|
208
|
+
video.setAttribute("playsinline", "true");
|
|
209
|
+
video_parent.appendChild(video);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
function stopLive(): void {
|
|
214
|
+
clearTimeout(stalledTimout.value);
|
|
215
|
+
errorPlay.value = "";
|
|
216
|
+
videoClean();
|
|
217
|
+
playing.value = false;
|
|
218
|
+
endListeningProgress();
|
|
219
|
+
}
|
|
220
|
+
function onTimeUpdateVideo(): void {
|
|
221
|
+
if (!downloadId.value) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
const currentTime =player.value?.currentTime() ?? videoElement.value.currentTime;
|
|
225
|
+
onTimeUpdateProgress(currentTime);
|
|
226
|
+
}
|
|
226
227
|
</script>
|
|
227
228
|
|
|
228
229
|
<style lang="scss">
|
|
@@ -2,27 +2,25 @@
|
|
|
2
2
|
<iframe
|
|
3
3
|
width="500"
|
|
4
4
|
height="281"
|
|
5
|
-
:title="
|
|
5
|
+
:title="t('Video')"
|
|
6
6
|
class="youtube-iframe"
|
|
7
7
|
:src="'https://www.youtube.com/embed/'+youtubeId"
|
|
8
|
-
frameborder="0"
|
|
9
8
|
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
|
10
9
|
referrerpolicy="strict-origin-when-cross-origin"
|
|
11
10
|
allowfullscreen>
|
|
12
11
|
</iframe>
|
|
13
12
|
</template>
|
|
14
13
|
|
|
15
|
-
<script lang="ts">
|
|
16
|
-
import {
|
|
17
|
-
export default defineComponent({
|
|
18
|
-
name: "PlayerYoutubeEmbed",
|
|
19
|
-
components: {
|
|
20
|
-
},
|
|
21
|
-
props: {
|
|
22
|
-
youtubeId: { default: undefined, type: String },
|
|
23
|
-
},
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import { useI18n } from "vue-i18n";
|
|
24
16
|
|
|
25
|
-
|
|
17
|
+
//Props
|
|
18
|
+
defineProps({
|
|
19
|
+
youtubeId: { default: undefined, type: String },
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
//Composables
|
|
23
|
+
const { t } = useI18n();
|
|
26
24
|
</script>
|
|
27
25
|
<style lang="scss">
|
|
28
26
|
@use "../../../../style/videoPlayer";
|
|
@@ -10,42 +10,37 @@
|
|
|
10
10
|
</section>
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
|
-
<script lang="ts">
|
|
13
|
+
<script setup lang="ts">
|
|
14
14
|
import PodcastList from "../display/podcasts/PodcastList.vue";
|
|
15
15
|
import { useFilterStore } from "../../stores/FilterStore";
|
|
16
16
|
import { useGeneralStore } from "../../stores/GeneralStore";
|
|
17
|
-
import {
|
|
18
|
-
import { defineComponent } from "vue";
|
|
17
|
+
import { computed, watch } from "vue";
|
|
19
18
|
import { Category } from "@/stores/class/general/category";
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return matchCategories[0]["name"];
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
watch:{
|
|
43
|
-
title: {
|
|
44
|
-
immediate: true,
|
|
45
|
-
async handler() {
|
|
46
|
-
document.title = this.title + ' - ' + this.metaTitle;
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
//Props
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
iabId: { default: undefined, type: Number },
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
//Composables
|
|
27
|
+
const generalStore = useGeneralStore();
|
|
28
|
+
const filterStore = useFilterStore();
|
|
29
|
+
|
|
30
|
+
//Computed
|
|
31
|
+
const orgaArray = computed(() => filterStore.filterOrgaId ? [filterStore.filterOrgaId] : []);
|
|
32
|
+
const title = computed(() => {
|
|
33
|
+
const matchCategories = generalStore.storedCategories.filter(
|
|
34
|
+
(c: Category) => c.id === props.iabId,
|
|
35
|
+
);
|
|
36
|
+
if (1 !== matchCategories.length) return "";
|
|
37
|
+
return matchCategories[0]["name"];
|
|
50
38
|
});
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
//Watch
|
|
42
|
+
watch(title, () => {
|
|
43
|
+
document.title = title.value + ' - ' + generalStore.metaTitle
|
|
44
|
+
}, {immediate: true});
|
|
45
|
+
|
|
51
46
|
</script>
|