Skip to content

Commit

Permalink
PR Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin-Belton-gov committed Nov 8, 2023
1 parent 2e531e6 commit d9b00ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
3 changes: 1 addition & 2 deletions Childrens-Social-Care-CPD/Contentful/Models/VideoResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ public class VideoResource : IContent
public string Id { get; set; }
public Asset Video { get; set; }
public Document Transcript { get; set; }
public string EmbededTitle { get; set; }
public string EmbededSourceUrl { get; set; }
public string EmbeddedSourceUrl { get; set; }
}
14 changes: 4 additions & 10 deletions Childrens-Social-Care-CPD/Views/Shared/_VideoResource.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,19 @@

<div class="govuk-grid-row">
<div class="govuk-grid-column-three-quarters">
@if(!string.IsNullOrEmpty(Model.EmbededTitle) && !string.IsNullOrEmpty(Model.EmbededSourceUrl))
@if(!string.IsNullOrEmpty(Model.EmbeddedSourceUrl))
{
<h2>
@Model.EmbededTitle
</h2>
if (@Model.EmbededSourceUrl.IndexOf("vimeo") > -1)
if (@Model.EmbeddedSourceUrl.IndexOf("vimeo") > -1)
{
<iframe width="560" height="315"
src="@Model.EmbededSourceUrl"
title="@Model.EmbededTitle"
src="@Model.EmbeddedSourceUrl"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>
}
else
{
<video name="media" src="@Model.EmbededSourceUrl">
<track label="English" kind="captions" srclang="en" default>
</video>
<video name="media" src="@Model.EmbeddedSourceUrl" preload="none"></video>
}
}
else
Expand Down

0 comments on commit d9b00ce

Please sign in to comment.