@saooti/octopus-sdk 37.0.16 → 37.0.17
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 +3 -1
- package/src/components/display/list/SwiperList.vue +1 -1
- package/src/components/display/podcasts/PodcastImage.vue +2 -2
- package/src/components/misc/player/PlayerComponent.vue +2 -8
- package/src/components/misc/player/PlayerVideo.vue +37 -52
- package/src/components/misc/player/PlayerVideoDigiteka.vue +62 -0
- package/src/components/misc/player/PlayerVideoHls.vue +176 -0
- package/src/locale/de.ts +1 -0
- package/src/locale/en.ts +1 -0
- package/src/locale/es.ts +1 -0
- package/src/locale/fr.ts +1 -0
- package/src/locale/it.ts +1 -0
- package/src/locale/sl.ts +1 -0
- package/src/stores/PlayerStore.ts +1 -1
- package/src/stores/class/conference/conference.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saooti/octopus-sdk",
|
|
3
|
-
"version": "37.0.
|
|
3
|
+
"version": "37.0.17",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Javascript SDK for using octopus",
|
|
6
6
|
"author": "Saooti",
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"test": "jest --coverage"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
+
"@clappr/core": "0.4.27",
|
|
18
|
+
"@clappr/hlsjs-playback": "^1.1.0",
|
|
17
19
|
"@popperjs/core": "^2.11.8",
|
|
18
20
|
"@saooti/octopus-api": "^0.34.3",
|
|
19
21
|
"@tiptap/extension-link": "^2.0.4",
|
|
@@ -110,7 +110,7 @@ export default defineComponent({
|
|
|
110
110
|
"playerVideo"
|
|
111
111
|
]),
|
|
112
112
|
isVideoPodcast(): boolean{
|
|
113
|
-
return undefined!==this.podcast.video?.videoId;
|
|
113
|
+
return this.fetchConference?.videoProfile?.includes('video_') || undefined!==this.podcast.video?.videoId;
|
|
114
114
|
},
|
|
115
115
|
playingPodcast() {
|
|
116
116
|
return (
|
|
@@ -271,7 +271,7 @@ export default defineComponent({
|
|
|
271
271
|
this.playerPlay({
|
|
272
272
|
...this.podcast,
|
|
273
273
|
...{ conferenceId: this.fetchConference?.conferenceId },
|
|
274
|
-
});
|
|
274
|
+
}, isVideo);
|
|
275
275
|
}
|
|
276
276
|
if (this.clickPlayGoPage) {
|
|
277
277
|
this.$router.push("/main/pub/podcast/" + this.podcast.podcastId);
|
|
@@ -6,10 +6,7 @@
|
|
|
6
6
|
@transitionend="onHidden"
|
|
7
7
|
>
|
|
8
8
|
<template v-if="display">
|
|
9
|
-
<PlayerVideo
|
|
10
|
-
v-if="playerVideo"
|
|
11
|
-
@close="closePlayer"
|
|
12
|
-
/>
|
|
9
|
+
<PlayerVideo v-if="playerVideo"/>
|
|
13
10
|
<template v-else>
|
|
14
11
|
<audio
|
|
15
12
|
id="audio-player"
|
|
@@ -62,7 +59,7 @@ import { usePlayerStore } from "@/stores/PlayerStore";
|
|
|
62
59
|
import { mapState, mapActions } from "pinia";
|
|
63
60
|
import { defineComponent, defineAsyncComponent } from "vue";
|
|
64
61
|
const PlayerVideo = defineAsyncComponent(
|
|
65
|
-
() => import("
|
|
62
|
+
() => import("./PlayerVideo.vue"),
|
|
66
63
|
);
|
|
67
64
|
export default defineComponent({
|
|
68
65
|
name: "PlayerComponent",
|
|
@@ -121,9 +118,6 @@ export default defineComponent({
|
|
|
121
118
|
this.forceHide = false;
|
|
122
119
|
}
|
|
123
120
|
},
|
|
124
|
-
closePlayer(){
|
|
125
|
-
this.playerPlay();
|
|
126
|
-
},
|
|
127
121
|
onPause() {
|
|
128
122
|
if ("PLAYING" === this.playerStatus) {
|
|
129
123
|
this.playerChangeStatus(true);
|
|
@@ -3,74 +3,60 @@
|
|
|
3
3
|
<template v-if="playerVideo">
|
|
4
4
|
<button
|
|
5
5
|
class="btn btn-transparent video-close saooti-remove"
|
|
6
|
-
@click="
|
|
6
|
+
@click="closePlayer"
|
|
7
7
|
/>
|
|
8
8
|
<div class="video-wrapper">
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
allow="autoplay"
|
|
17
|
-
referrerpolicy="no-referrer-when-downgrade"
|
|
18
|
-
></iframe>
|
|
9
|
+
<PlayerVideoDigiteka
|
|
10
|
+
v-if="!playerLive"
|
|
11
|
+
/>
|
|
12
|
+
<PlayerVideoHls
|
|
13
|
+
v-else
|
|
14
|
+
:hls-url="hlsUrl"
|
|
15
|
+
/>
|
|
19
16
|
</div>
|
|
20
17
|
</template>
|
|
21
18
|
</teleport>
|
|
22
19
|
</template>
|
|
23
|
-
|
|
24
20
|
<script lang="ts">
|
|
21
|
+
import { state } from "../../../stores/ParamSdkStore";
|
|
25
22
|
import { usePlayerStore } from "@/stores/PlayerStore";
|
|
26
|
-
import { mapState } from "pinia";
|
|
27
|
-
import { defineComponent } from "vue";
|
|
23
|
+
import { mapState, mapActions } from "pinia";
|
|
24
|
+
import { defineComponent, defineAsyncComponent } from "vue";
|
|
25
|
+
const PlayerVideoDigiteka = defineAsyncComponent(
|
|
26
|
+
() => import("./PlayerVideoDigiteka.vue"),
|
|
27
|
+
);
|
|
28
|
+
const PlayerVideoHls = defineAsyncComponent(
|
|
29
|
+
() => import("./PlayerVideoHls.vue"),
|
|
30
|
+
);
|
|
28
31
|
export default defineComponent({
|
|
29
32
|
name: "PlayerVideo",
|
|
33
|
+
|
|
30
34
|
components: {
|
|
35
|
+
PlayerVideoDigiteka,
|
|
36
|
+
PlayerVideoHls
|
|
31
37
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
return "";
|
|
38
|
+
data() {
|
|
39
|
+
return {
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
computed: {
|
|
43
|
+
...mapState(usePlayerStore, ["playerVideo", "playerLive"]),
|
|
44
|
+
hlsUrl(): string{
|
|
45
|
+
if(!this.playerLive){return "";}
|
|
46
|
+
return `${state.podcastPage.hlsUri}live/video_dev.${this.playerLive.conferenceId}/index.m3u8`;
|
|
47
|
+
//return "https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8";
|
|
44
48
|
}
|
|
45
49
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
|
|
51
|
+
methods: {
|
|
52
|
+
...mapActions(usePlayerStore, ["playerPlay",]),
|
|
53
|
+
closePlayer(){
|
|
54
|
+
this.playerPlay();
|
|
49
55
|
},
|
|
50
56
|
},
|
|
51
|
-
mounted(){
|
|
52
|
-
this.goFullScreen();
|
|
53
|
-
},
|
|
54
|
-
methods:{
|
|
55
|
-
goFullScreen(){
|
|
56
|
-
if(""===this.srcVideo){return;}
|
|
57
|
-
switch (screen.orientation.type) {
|
|
58
|
-
case "landscape-primary":
|
|
59
|
-
case "landscape-secondary":
|
|
60
|
-
(this.$refs.iframeVideo as Element).requestFullscreen();
|
|
61
|
-
break;
|
|
62
|
-
case "portrait-secondary":
|
|
63
|
-
case "portrait-primary":
|
|
64
|
-
console.log("Portrait mode");
|
|
65
|
-
break;
|
|
66
|
-
default:
|
|
67
|
-
console.log("The orientation API isn't supported in this browser :(");
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
57
|
});
|
|
73
58
|
</script>
|
|
59
|
+
|
|
74
60
|
<style lang="scss">
|
|
75
61
|
.octopus-app {
|
|
76
62
|
.video-wrapper{
|
|
@@ -85,7 +71,6 @@ export default defineComponent({
|
|
|
85
71
|
position: fixed;
|
|
86
72
|
bottom: 16.5rem;
|
|
87
73
|
right: 1rem;
|
|
88
|
-
|
|
89
74
|
}
|
|
90
75
|
@media (max-width: 500px) {
|
|
91
76
|
.video-wrapper{
|
|
@@ -103,4 +88,4 @@ export default defineComponent({
|
|
|
103
88
|
}
|
|
104
89
|
}
|
|
105
90
|
}
|
|
106
|
-
</style>
|
|
91
|
+
</style>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<iframe
|
|
3
|
+
ref="iframeVideo"
|
|
4
|
+
:src="srcVideo"
|
|
5
|
+
width="500"
|
|
6
|
+
height="281"
|
|
7
|
+
style="z-index:1;"
|
|
8
|
+
allowfullscreen="true"
|
|
9
|
+
allow="autoplay"
|
|
10
|
+
referrerpolicy="no-referrer-when-downgrade"
|
|
11
|
+
></iframe>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
import { usePlayerStore } from "@/stores/PlayerStore";
|
|
16
|
+
import { mapState } from "pinia";
|
|
17
|
+
import { defineComponent } from "vue";
|
|
18
|
+
export default defineComponent({
|
|
19
|
+
name: "PlayerVideo",
|
|
20
|
+
components: {
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
computed:{
|
|
24
|
+
...mapState(usePlayerStore, [
|
|
25
|
+
"playerPodcast",
|
|
26
|
+
"playerVideo"
|
|
27
|
+
]),
|
|
28
|
+
srcVideo(): string{
|
|
29
|
+
if(this.playerVideo){
|
|
30
|
+
return "//www.ultimedia.com/deliver/generic/iframe/mdtk/01009833/zone/1/showtitle/1/src/"+ this.playerPodcast?.video?.videoId+"/autoplay/1";
|
|
31
|
+
}
|
|
32
|
+
return "";
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
watch:{
|
|
36
|
+
srcVideo() {
|
|
37
|
+
this.goFullScreen();
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
mounted(){
|
|
41
|
+
this.goFullScreen();
|
|
42
|
+
},
|
|
43
|
+
methods:{
|
|
44
|
+
goFullScreen(){
|
|
45
|
+
if(""===this.srcVideo){return;}
|
|
46
|
+
switch (screen.orientation.type) {
|
|
47
|
+
case "landscape-primary":
|
|
48
|
+
case "landscape-secondary":
|
|
49
|
+
(this.$refs.iframeVideo as Element).requestFullscreen();
|
|
50
|
+
break;
|
|
51
|
+
case "portrait-secondary":
|
|
52
|
+
case "portrait-primary":
|
|
53
|
+
console.log("Portrait mode");
|
|
54
|
+
break;
|
|
55
|
+
default:
|
|
56
|
+
console.log("The orientation API isn't supported in this browser :(");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
});
|
|
62
|
+
</script>
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="video-player">
|
|
3
|
+
<div v-if="errorPlay.length" class="video-live-error">{{errorPlay}}</div>
|
|
4
|
+
<video
|
|
5
|
+
v-show="useVideoSrc"
|
|
6
|
+
ref="videoelement"
|
|
7
|
+
playsinline
|
|
8
|
+
/>
|
|
9
|
+
<div
|
|
10
|
+
ref="videocontainer"
|
|
11
|
+
class="video-container"
|
|
12
|
+
/>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
<script lang="ts">
|
|
16
|
+
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
import Clappr from '@clappr/core';
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
import HlsjsPlayback from '@clappr/hlsjs-playback';
|
|
21
|
+
import { defineComponent } from 'vue';
|
|
22
|
+
export default defineComponent({
|
|
23
|
+
name: "PlayerVideoHls",
|
|
24
|
+
|
|
25
|
+
props: {
|
|
26
|
+
hlsUrl: { default: "", type: String },
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
emits:['changeValid'],
|
|
30
|
+
data() {
|
|
31
|
+
return {
|
|
32
|
+
errorPlay: "" as string,
|
|
33
|
+
useVideoSrc: false as boolean,
|
|
34
|
+
player: undefined as Clappr.Player,
|
|
35
|
+
playing: false as boolean,
|
|
36
|
+
stalledTimout: undefined as ReturnType<typeof setTimeout>|undefined,
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
computed:{
|
|
40
|
+
videoContainer(): HTMLElement{
|
|
41
|
+
return (this.$refs.videocontainer as HTMLElement);
|
|
42
|
+
},
|
|
43
|
+
videoElement(): HTMLVideoElement{
|
|
44
|
+
return (this.$refs.videoelement as HTMLVideoElement);
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
mounted(){
|
|
48
|
+
this.playLive();
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
beforeUnmount() {
|
|
52
|
+
if(this.playing){
|
|
53
|
+
this.stopLive();
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
methods: {
|
|
58
|
+
definedStalledTimeout(){
|
|
59
|
+
this.stalledTimout =setTimeout(()=>{
|
|
60
|
+
this.videoClean();
|
|
61
|
+
this.playLive();
|
|
62
|
+
}, 5000);
|
|
63
|
+
},
|
|
64
|
+
async playLive(): Promise<void> {
|
|
65
|
+
clearTimeout(this.stalledTimout);
|
|
66
|
+
this.definedStalledTimeout();
|
|
67
|
+
if (this.videoElement.canPlayType('application/vnd.apple.mpegurl') && !navigator.userAgent.includes('Android')) {
|
|
68
|
+
this.useVideoSrc = true;
|
|
69
|
+
this.playLiveIos();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
this.player = new Clappr.Player({
|
|
73
|
+
source: this.hlsUrl,
|
|
74
|
+
autoPlay: false,
|
|
75
|
+
height: '100%',
|
|
76
|
+
width: '100%',
|
|
77
|
+
plugins: {
|
|
78
|
+
playback: [HlsjsPlayback],
|
|
79
|
+
},
|
|
80
|
+
playback: {
|
|
81
|
+
controls: true,
|
|
82
|
+
playInline: true,
|
|
83
|
+
hlsjsConfig: {
|
|
84
|
+
enableWorker: false,
|
|
85
|
+
debug:true,
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
events: {
|
|
89
|
+
onError: async(error: Clappr.error) =>{
|
|
90
|
+
this.stopLive();
|
|
91
|
+
if (error.description && error.description.includes('403')) {
|
|
92
|
+
this.errorPlay = this.$t('Video is unavailable');
|
|
93
|
+
}else{
|
|
94
|
+
this.errorPlay = this.$t('Podcast play error');
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
onPlay:()=>{
|
|
98
|
+
this.errorPlay = "";
|
|
99
|
+
this.playing = true;
|
|
100
|
+
},
|
|
101
|
+
onTimeUpdate:()=>{
|
|
102
|
+
clearTimeout(this.stalledTimout);
|
|
103
|
+
this.definedStalledTimeout();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
this.playing = true;
|
|
108
|
+
this.player.attachTo(this.videoContainer);
|
|
109
|
+
if(0!==this.videoContainer.getElementsByTagName("video").length){
|
|
110
|
+
this.videoContainer.getElementsByTagName("video")[0].play();
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
async playLiveIos(): Promise<void>{
|
|
114
|
+
this.videoElement.onloadedmetadata = ()=>{
|
|
115
|
+
const playPromise = this.videoElement.play();
|
|
116
|
+
if (playPromise !== undefined) {
|
|
117
|
+
playPromise.then(() => {
|
|
118
|
+
this.errorPlay = "";
|
|
119
|
+
this.playing = true;
|
|
120
|
+
})
|
|
121
|
+
.catch(() => {
|
|
122
|
+
this.playing = false;
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
this.videoElement.onerror = async()=>{
|
|
127
|
+
this.stopLive();
|
|
128
|
+
this.errorPlay = this.$t('Podcast play error');
|
|
129
|
+
};
|
|
130
|
+
this.videoElement.ontimeupdate = async()=>{
|
|
131
|
+
clearTimeout(this.stalledTimout);
|
|
132
|
+
this.definedStalledTimeout();
|
|
133
|
+
};
|
|
134
|
+
this.videoElement.src = this.hlsUrl;
|
|
135
|
+
},
|
|
136
|
+
videoClean(): void{
|
|
137
|
+
if(this.useVideoSrc){
|
|
138
|
+
this.videoElement.pause();
|
|
139
|
+
this.videoElement.removeAttribute('src');
|
|
140
|
+
this.videoElement.load();
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
this.player.destroy();
|
|
144
|
+
},
|
|
145
|
+
stopLive(): void{
|
|
146
|
+
clearTimeout(this.stalledTimout);
|
|
147
|
+
this.errorPlay = "";
|
|
148
|
+
this.videoClean();
|
|
149
|
+
this.playing = false;
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
});
|
|
154
|
+
</script>
|
|
155
|
+
|
|
156
|
+
<style lang="scss">
|
|
157
|
+
@import "@scss/_variables.scss";
|
|
158
|
+
.octopus-app{
|
|
159
|
+
.video-live-error{
|
|
160
|
+
text-align: center;
|
|
161
|
+
width: 100%;
|
|
162
|
+
font-size: 1rem;
|
|
163
|
+
font-weight: bold;
|
|
164
|
+
padding: 0.2rem 0;
|
|
165
|
+
color: white;
|
|
166
|
+
position: absolute;
|
|
167
|
+
top: 0;
|
|
168
|
+
background: $danger;
|
|
169
|
+
z-index: 1;
|
|
170
|
+
}
|
|
171
|
+
.video-container{
|
|
172
|
+
width: 500px;
|
|
173
|
+
height: 281px;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
</style>
|
package/src/locale/de.ts
CHANGED
package/src/locale/en.ts
CHANGED
package/src/locale/es.ts
CHANGED
package/src/locale/fr.ts
CHANGED
package/src/locale/it.ts
CHANGED
package/src/locale/sl.ts
CHANGED
|
@@ -106,7 +106,7 @@ export const usePlayerStore = defineStore("PlayerStore", {
|
|
|
106
106
|
(this.playerPodcast &&
|
|
107
107
|
this.playerPodcast.podcastId === param.podcastId && isVideo === this.playerVideo) ||
|
|
108
108
|
(this.playerMedia && this.playerMedia.mediaId === param.mediaId) ||
|
|
109
|
-
(this.playerLive && this.playerLive.conferenceId === param.conferenceId)
|
|
109
|
+
(this.playerLive && this.playerLive.conferenceId === param.conferenceId && isVideo === this.playerVideo)
|
|
110
110
|
) {
|
|
111
111
|
//Do nothing
|
|
112
112
|
return;
|