From 9001907d5e9c25f3b81a2d6dfeca0f8b33822cb6 Mon Sep 17 00:00:00 2001 From: Martin-Belton-gov Date: Tue, 7 Nov 2023 13:09:46 +0000 Subject: [PATCH 1/7] Added Code to play embedded youtube and vimeo videos --- .../Contentful/Models/VideoResource.cs | 2 + .../Views/Shared/_VideoResource.cshtml | 56 +++++++++++++++---- 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/Childrens-Social-Care-CPD/Contentful/Models/VideoResource.cs b/Childrens-Social-Care-CPD/Contentful/Models/VideoResource.cs index a07fc6cb..08730572 100644 --- a/Childrens-Social-Care-CPD/Contentful/Models/VideoResource.cs +++ b/Childrens-Social-Care-CPD/Contentful/Models/VideoResource.cs @@ -7,4 +7,6 @@ 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; } } diff --git a/Childrens-Social-Care-CPD/Views/Shared/_VideoResource.cshtml b/Childrens-Social-Care-CPD/Views/Shared/_VideoResource.cshtml index 30da1af6..190e5dda 100644 --- a/Childrens-Social-Care-CPD/Views/Shared/_VideoResource.cshtml +++ b/Childrens-Social-Care-CPD/Views/Shared/_VideoResource.cshtml @@ -8,16 +8,50 @@
- -
- View transcript -
- @{ - await Html.RenderPartialAsync("_RichText", Model.Transcript); - } -
-
+ @if(!string.IsNullOrEmpty(Model.EmbededTitle) && !string.IsNullOrEmpty(Model.EmbededSourceUrl)) + { +

+ @Model.EmbededTitle +

+ if (@Model.EmbededSourceUrl.IndexOf("vimeo") > -1) + { + + } + else + { +
\ No newline at end of file From 362b57de31d781ffa12308fc99504a0cf21fd8f5 Mon Sep 17 00:00:00 2001 From: Martin-Belton-gov Date: Tue, 7 Nov 2023 14:28:52 +0000 Subject: [PATCH 2/7] Modified tags --- .../Views/Shared/_VideoResource.cshtml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Childrens-Social-Care-CPD/Views/Shared/_VideoResource.cshtml b/Childrens-Social-Care-CPD/Views/Shared/_VideoResource.cshtml index 190e5dda..34ea282c 100644 --- a/Childrens-Social-Care-CPD/Views/Shared/_VideoResource.cshtml +++ b/Childrens-Social-Care-CPD/Views/Shared/_VideoResource.cshtml @@ -18,13 +18,15 @@ } else { -