Skip to content

Commit 5852223

Browse files
committed
Fixed video rendering issue on Iphone on landing page
1 parent c9b2311 commit 5852223

File tree

3 files changed

+38
-14
lines changed

3 files changed

+38
-14
lines changed

LearningHub.Nhs.WebUI/Controllers/MediaController.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ public MediaController(IWebHostEnvironment hostingEnvironment, ILogger<MediaCont
3838
/// </summary>
3939
/// <param name="playBackUrl">The playBackUrl.</param>
4040
/// <param name="token">The token.</param>
41+
/// <param name="origin">The orgin node.</param>
4142
/// <returns>The <see cref="IActionResult"/>.</returns>
4243
[Route("Media/MediaManifest")]
43-
public IActionResult MediaManifest(string playBackUrl, string token)
44+
public IActionResult MediaManifest(string playBackUrl, string token, string origin = "*")
4445
{
4546
try
4647
{
@@ -58,7 +59,8 @@ public IActionResult MediaManifest(string playBackUrl, string token)
5859
Content = modifiedTopLeveLManifest,
5960
ContentType = @"application/vnd.apple.mpegurl",
6061
};
61-
this.Response.Headers.Append("Access-Control-Allow-Origin", "*");
62+
63+
this.Response.Headers.Append("Access-Control-Allow-Origin", origin);
6264
this.Response.Headers.Append("X-Content-Type-Options", "nosniff");
6365

6466
return response;

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

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<link href="~/css/mkplayer-ui.css" rel="stylesheet" asp-append-version="true" />
1+
<link href="~/css/mkplayer-ui.css" rel="stylesheet" asp-append-version="true" />
22
<template>
33
<div>
44
<div :id="getPlayerUniqueId" class="video-container"></div>
@@ -223,38 +223,60 @@
223223
width: 100%;
224224
margin: auto;
225225
position: relative;
226-
--min-width: 0px; /* default value */
226+
min-width: var(--min-width, 0px); /* Default fallback value */
227227
}
228228
229229
/* Media queries to set different min-width values */
230+
@media (min-width: 225px) { /* Non standard for graceful */
231+
.video-container {
232+
--min-width: 200px;
233+
}
234+
}
235+
@media (min-width: 375px) { /* Non standard for graceful */
236+
.video-container {
237+
--min-width: 300px;
238+
}
239+
}
240+
@media (min-width: 450px) { /* Non standard for graceful */
241+
.video-container {
242+
--min-width: 400px;
243+
}
244+
}
230245
@media (min-width: 576px) {
231246
.video-container {
232-
--min-width: 576px;
247+
--min-width: 500px;
248+
}
249+
}
250+
@media (min-width: 650px) { /* Non standard for graceful */
251+
.video-container {
252+
--min-width: 600px;
233253
}
234254
}
235-
236255
@media (min-width: 768px) {
237256
.video-container {
238-
--min-width: 768px;
257+
--min-width: 700px;
239258
}
240259
}
241-
242-
@media (min-width: 992px) {
260+
@media (min-width: 850px) { /* Non standard for graceful */
243261
.video-container {
244-
--min-width: 992px;
262+
--min-width: 800px;
245263
}
246264
}
247-
265+
@media (min-width: 992px) {
266+
.video-container {
267+
--min-width: 900px;
268+
}
269+
}
248270
@media (min-width: 1024px) {
249271
.video-container {
250272
--min-width: 1024px;
251273
}
252274
}
253275
254276
/* Applying min-width to the video container using the CSS variable */
255-
/*.video-container {
277+
.video-container {
256278
min-width: var(--min-width) !important;
257-
}*/
279+
}
258280
259281
/* Targeting specific div with dynamic ID pattern */
260282
[id^="videoContainer_"] {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
109109
if (checkIfIphone()) {
110110
var token = model.videoAsset.azureMediaAsset.authenticationToken;
111-
url = '@requestURL'+ "Media/MediaManifest?playBackUrl=" + url + "&token=" + token;
111+
url = '@requestURL' + "Media/MediaManifest?playBackUrl=" + url + "&token=" + token + "&origin=" + '@requestURL';
112112
}
113113
var subtitleTrack = null;
114114
if (model.videoAsset.azureMediaAsset && model.videoAsset.closedCaptionsFile) {

0 commit comments

Comments
 (0)