generated from DFE-Digital/govuk-dotnet-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added support for playing videos on resource page.
Added support for Video file resource
- Loading branch information
Showing
11 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
Childrens-Social-Care-CPD/Contentful/Models/VideoResource.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Contentful.Core.Models; | ||
|
||
namespace Childrens_Social_Care_CPD.Contentful.Models; | ||
|
||
public class VideoResource : IContent | ||
{ | ||
public string Id { get; set; } | ||
public Asset Video { get; set; } | ||
public Document Transcript { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
Childrens-Social-Care-CPD/Views/Shared/_VideoResource.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@using Childrens_Social_Care_CPD.Contentful.Models; | ||
|
||
@model VideoResource | ||
|
||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-three-quarters"> | ||
<iframe id="player" title="video" type="text/html" class="iframe-border-width" width="640" height="390" allowfullscreen src="@Model.Video.File.Url"></iframe> | ||
<details class="govuk-details govuk-!-margin-top-3" data-module="govuk-details"> | ||
<summary class="govuk-details__summary"> <span class="govuk-details__summary-text">View transcript </span></summary> | ||
<div class="govuk-details__text"> | ||
@{ | ||
await Html.RenderPartialAsync("_RichText", Model.Transcript); | ||
} | ||
</div> | ||
</details> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,8 @@ | |
|
||
.image-card h2 { | ||
@extend .govuk-heading-m | ||
} | ||
|
||
.iframe-border-width { | ||
border-width: 0px; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.