@@ -34,6 +34,7 @@
import { MKPlayer } from '@mediakind/mkplayer';
import { resourceData } from '../../data/resource';
import { MKPlayerType, MKStreamType } from '../../MKPlayerConfigEnum';
+ import { MKPlayerControlbar } from '../../mkioplayer-controlbar';
//import { MKPlayerType } from '@mediakind/mkplayer/types/enums/MKPlayerType.d';
//import { MKStreamType } from '@mediakind/mkplayer/types/enums/MKStreamType.d';
export default Vue.extend({
@@ -49,6 +50,7 @@
mkioKey: '',
playBackUrl: '',
sourceLoaded: true,
+ isIphone: false
};
},
async created() {
@@ -56,26 +58,33 @@
this.getMediaPlayUrl();
this.load();
},
+ mounted() {
+ this.checkIfIphone();
+ },
methods: {
onPlayerReady() {
- const videoElement = document.getElementById("bitmovinplayer-video-" + this.getPlayerUniqueId) as HTMLVideoElement;
- if (videoElement) {
- videoElement.controls = true;
-
- // Add the track element
- var captionsInfo = this.captionsTrackAvailable;
- if (captionsInfo) {
- const trackElement = document.createElement('track');
- var srcPath = this.captionsUrl;
- trackElement.kind = 'captions';
- trackElement.label = 'english';
- trackElement.srclang = 'en';
- trackElement.src = srcPath;
-
- // Append the track to the video element
- videoElement.appendChild(trackElement);
- }
- }
+ MKPlayerControlbar(this.player.videoContainer.id, this.player);
+
+ // [BY] When we set UI to false we need to manually add the controls to the video element
+ //const videoElement = document.getElementById("bitmovinplayer-video-" + this.getPlayerUniqueId) as HTMLVideoElement;
+
+ //if (videoElement) {
+ // videoElement.controls = true;
+
+ // // Add the track element
+ // var captionsInfo = this.captionsTrackAvailable;
+ // if (captionsInfo) {
+ // const trackElement = document.createElement('track');
+ // var srcPath = this.captionsUrl;
+ // trackElement.kind = 'captions';
+ // trackElement.label = 'english';
+ // trackElement.srclang = 'en';
+ // trackElement.src = srcPath;
+
+ // // Append the track to the video element
+ // videoElement.appendChild(trackElement);
+ // }
+ //}
},
onSubtitleAdded() {
@@ -89,12 +98,18 @@
getMediaPlayUrl() {
this.playBackUrl = this.videoFile.locatorUri;
this.playBackUrl = this.playBackUrl.substring(0, this.playBackUrl.lastIndexOf("manifest")) + "manifest(format=m3u8-cmaf,encryption=cbc)";
+ if (this.isIphone) {
+ this.playBackUrl = "/Media/MediaManifest?playBackUrl=" + this.playBackUrl + "&token=" + this.azureMediaServicesToken;
+ }
+ },
+ checkIfIphone() {
+ const userAgent = navigator.userAgent || navigator.vendor;
+ this.isIphone = /iPhone/i.test(userAgent);
},
load() {
// Grab the video container
this.videoContainer = document.getElementById(this.getPlayerUniqueId);
-
if (!this.mkioKey) {
this.getMKIOPlayerKey();
}
@@ -102,7 +117,7 @@
// Prepare the player configuration
const playerConfig = {
key: this.mkioKey,
- ui: false,
+ ui: true,
theme: "dark",
playback: {
muted: false,
@@ -196,4 +211,88 @@
video[id^="bitmovinplayer-video"] {
width: 100%;
}
+
+ .bmpui-ui-controlbar .control-right {
+ float: right;
+ }
+
+
+
diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/components/questions/MatchGameAnswerOption.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/components/questions/MatchGameAnswerOption.vue
index 27e67278e..3d3f18e46 100644
--- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/components/questions/MatchGameAnswerOption.vue
+++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/components/questions/MatchGameAnswerOption.vue
@@ -15,8 +15,9 @@