Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Curtis McCaw 9 posts 119 karma points
    Jul 02, 2018 @ 13:40
    Curtis  McCaw
    0

    How can I upload a video to the media gallery and use a media picker to display it on the content page.

    I have been able to use the recommended approach for images (as shown below), but I can't seem to find a suitable method to show a local video. The video cannot be from an online resource i.e. YouTube.

     @{
       var Image= Model.Content.GetPropertyValue<IPublishedContent>("Image");
        if (Image!= null)
        {
           <img src="@Image.Url" class="Image" alt="@Image.GetPropertyValue("alt")" />
         }
       } 
    

    Thanks for any help provided.

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    Jul 02, 2018 @ 15:12
    Søren Gregersen
    100

    Hi Curtis, welcome to the forum :)

    You need to allow the fileformat in the media section, and then you need to build the html to show the video, something like https://www.w3schools.com/html/html5_video.asp

    Keep in mind that video does take alot of bandwith, so the editors need to be carefull not to upload videos that are too big. Some formats can be streamed, others need a full download - it all depends on the codec used.

Please Sign in or register to post replies

Write your reply to:

Draft