Skip to content

Commit 4dc7907

Browse files
authored
Merge pull request #438 from TechnologyEnhancedLearning/RC
Merge Sagitta release to master
2 parents cf5d036 + 0fc75cc commit 4dc7907

File tree

6 files changed

+93
-56
lines changed

6 files changed

+93
-56
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export enum MKPlayerType {
2+
Html5 = "html5",
3+
Native = "native",
4+
WebRtc = "webrtc",
5+
Unknown = "unknown"
6+
}
7+
export enum MKStreamType {
8+
Hls = "hls",
9+
Dash = "dash",
10+
Progressive = "progressive",
11+
Smooth = "smooth",
12+
Whep = "whep",
13+
Unknown = "unknown"
14+
};

AdminUI/LearningHub.Nhs.AdminUI/Scripts/vuesrc/content/cmsPageRow.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
import { contentData } from '../data/content';
7171
import { AzureMediaAssetModel } from '../models/content/videoAssetModel';
7272
import { MKPlayer } from '@mediakind/mkplayer';
73+
import { MKPlayerType, MKStreamType } from '../MKPlayerConfigEnum';
7374
7475
export default Vue.extend({
7576
props: {
@@ -198,7 +199,8 @@
198199
ui: false,
199200
playback: {
200201
muted: false,
201-
autoplay: false
202+
autoplay: false,
203+
preferredTech: [{ player: MKPlayerType.Html5, streaming: MKStreamType.Hls }] // to force the player to use html5 player instead of native on safari
202204
},
203205
theme: "dark",
204206
events: {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export enum MKPlayerType {
2+
Html5 = "html5",
3+
Native = "native",
4+
WebRtc = "webrtc",
5+
Unknown = "unknown"
6+
}
7+
export enum MKStreamType {
8+
Hls = "hls",
9+
Dash = "dash",
10+
Progressive = "progressive",
11+
Smooth = "smooth",
12+
Whep = "whep",
13+
Unknown = "unknown"
14+
};

LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/components/MKIOVideoPlayer.vue

Lines changed: 57 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
import { VideoFileModel } from '../../models/contribute-resource/blocks/videoFileModel';
3434
import { MKPlayer } from '@mediakind/mkplayer';
3535
import { resourceData } from '../../data/resource';
36+
import { MKPlayerType, MKStreamType } from '../../MKPlayerConfigEnum';
37+
//import { MKPlayerType } from '@mediakind/mkplayer/types/enums/MKPlayerType.d';
38+
//import { MKStreamType } from '@mediakind/mkplayer/types/enums/MKStreamType.d';
3639
export default Vue.extend({
3740
props: {
3841
fileId: Number,
@@ -52,7 +55,7 @@
5255
await this.getMKIOPlayerKey();
5356
this.getMediaPlayUrl();
5457
this.load();
55-
},
58+
},
5659
methods: {
5760
onPlayerReady() {
5861
const videoElement = document.getElementById("bitmovinplayer-video-" + this.getPlayerUniqueId) as HTMLVideoElement;
@@ -86,67 +89,68 @@
8689
getMediaPlayUrl() {
8790
this.playBackUrl = this.videoFile.locatorUri;
8891
this.playBackUrl = this.playBackUrl.substring(0, this.playBackUrl.lastIndexOf("manifest")) + "manifest(format=m3u8-cmaf,encryption=cbc)";
89-
// this.playBackUrl = "https://ep-defaultlhdev-mediakind02-dev-by-am-sl.uksouth.streaming.mediakind.com/d01d30e4-461f-4045-bc10-3c88a296f3af/manifest.ism/manifest(format=m3u8-cmaf,encryption=cbc)"
9092
},
9193
load() {
92-
// Grab the video container
93-
this.videoContainer = document.getElementById(this.getPlayerUniqueId);
94+
// Grab the video container
95+
this.videoContainer = document.getElementById(this.getPlayerUniqueId);
9496
95-
if(!this.mkioKey) {
96-
this.getMKIOPlayerKey();
97-
}
9897
99-
// Prepare the player configuration
100-
const playerConfig = {
101-
key: this.mkioKey,
102-
ui: false,
103-
theme: "dark",
104-
playback: {
105-
muted: false,
106-
autoplay: false,
107-
},
108-
events: {
109-
//error: this.onPlayerError,
110-
//timechanged: this.onTimeChanged,
111-
//onpause: this.onpause,
112-
//onplay: this.onplay,
113-
//muted: this.onMuted,
114-
//unmuted: this.onUnmuted,
115-
ready: this.onPlayerReady,
116-
subtitleadded: this.onSubtitleAdded,
98+
if (!this.mkioKey) {
99+
this.getMKIOPlayerKey();
100+
}
117101
118-
//playbackspeed: this.onPlaybackSpeed
119-
}
120-
};
102+
// Prepare the player configuration
103+
const playerConfig = {
104+
key: this.mkioKey,
105+
ui: false,
106+
theme: "dark",
107+
playback: {
108+
muted: false,
109+
autoplay: false,
110+
preferredTech: [{ player: MKPlayerType.Html5, streaming: MKStreamType.Hls }] // to force the player to use html5 player instead of native on safari
111+
},
112+
events: {
113+
//error: this.onPlayerError,
114+
//timechanged: this.onTimeChanged,
115+
//onpause: this.onpause,
116+
//onplay: this.onplay,
117+
//muted: this.onMuted,
118+
//unmuted: this.onUnmuted,
119+
ready: this.onPlayerReady,
120+
subtitleadded: this.onSubtitleAdded,
121121
122-
// Initialize the player with video container and player configuration
123-
this.player = new MKPlayer(this.videoContainer, playerConfig);
122+
//playbackspeed: this.onPlaybackSpeed
123+
}
124+
};
124125
125-
// ClearKey DRM configuration
126-
var clearKeyConfig = {
127-
//LA_URL: "https://ottapp-appgw-amp.prodc.mkio.tv3cloud.com/drm/clear-key?ownerUid=azuki",
128-
LA_URL:"HLS_AES",
129-
headers: {
130-
"Authorization": this.getBearerToken()
131-
}
132-
};
126+
// Initialize the player with video container and player configuration
127+
this.player = new MKPlayer(this.videoContainer, playerConfig);
133128
134-
// Load source
135-
const sourceConfig = {
136-
hls: this.playBackUrl,
137-
drm: {
138-
clearkey: clearKeyConfig
139-
}
140-
};
129+
// ClearKey DRM configuration
130+
var clearKeyConfig = {
131+
//LA_URL: "https://ottapp-appgw-amp.prodc.mkio.tv3cloud.com/drm/clear-key?ownerUid=azuki",
132+
LA_URL: "HLS_AES",
133+
headers: {
134+
"Authorization": this.getBearerToken()
135+
}
136+
};
141137
142-
this.player.load(sourceConfig)
143-
.then(() => {
144-
console.log("Source loaded successfully!");
145-
})
146-
.catch(() => {
147-
console.error("An error occurred while loading the source!");
148-
});
149-
}
138+
// Load source
139+
const sourceConfig = {
140+
hls: this.playBackUrl,
141+
drm: {
142+
clearkey: clearKeyConfig
143+
}
144+
};
145+
146+
this.player.load(sourceConfig)
147+
.then(() => {
148+
console.log("Source loaded successfully!");
149+
})
150+
.catch(() => {
151+
console.error("An error occurred while loading the source!");
152+
});
153+
}
150154
},
151155
computed: {
152156
getPlayerUniqueId(): string {

LearningHub.Nhs.WebUI/Scripts/vuesrc/resource/ResourceContent.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
import { getQueryParam } from './helpers/getQueryParam';
101101
import { setResourceCetificateLink } from './helpers/resourceCertificateHelper';
102102
import { MKPlayer } from '@mediakind/mkplayer';
103+
import { MKPlayerType, MKStreamType } from '../MKPlayerConfigEnum';
103104
104105
Vue.use(Vuelidate as any);
105106
@@ -280,6 +281,7 @@
280281
playback: {
281282
muted: false,
282283
autoplay: false,
284+
preferredTech: [{ player: MKPlayerType.Html5, streaming: MKStreamType.Hls }] // to force the player to use html5 player instead of native on safari
283285
},
284286
events: {
285287
//error: this.onPlayerError,
@@ -301,7 +303,7 @@
301303
// ClearKey DRM configuration
302304
var clearKeyConfig = {
303305
//LA_URL: "https://ottapp-appgw-amp.prodc.mkio.tv3cloud.com/drm/clear-key?ownerUid=azuki",
304-
LA_URL:"HLS_AES",
306+
LA_URL: "HLS_AES",
305307
headers: {
306308
"Authorization": this.getBearerToken()
307309
}

LearningHub.Nhs.WebUI/Views/Home/_CmsVideo.cshtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
theme: "dark",
6464
playback: {
6565
muted: false,
66-
autoplay: false
66+
autoplay: false,
67+
preferredTech: [{ player: 'html5', streaming: 'hls' }]
6768
},
6869
6970
// Subscribe to player events

0 commit comments

Comments
 (0)