Copied to clipboard

Flag this post as spam?

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


  • Ramprasad 15 posts 116 karma points
    Aug 08, 2016 @ 07:51
    Ramprasad
    0

    How to render a Video using Media Picker?

    Thanks in advance.

  • Alex Skrypnyk 6133 posts 23952 karma points MVP 7x admin c-trib
    Aug 08, 2016 @ 08:05
    Alex Skrypnyk
    2

    Hi Ramprasad,

    Do you want to store video in media library? I would recommend you to store videos in Youutube or Vomeo and use third party player. Because handling videos isn't so easy. You have to store it ike file, and render video file as usual file, look at this helper:

    public static string GetImageUrlById(string id, UmbracoHelper Umbraco)
        {
            var imageUrl = "";
            if(!string.IsNullOrEmpty(id))
            {
                var image = Umbraco.Media(id);
                imageUrl = image.url;
            }
            return imageUrl;
        }
    

    But you need to add some html of video player, for example:

    <video width="320" height="240" controls>
      <source src="movie.mp4" type="video/mp4">
      <source src="movie.ogg" type="video/ogg">
    Your browser does not support the video tag.
    </video>
    

    http://www.w3schools.com/html/html5_video.asp

    Thanks,

    Alex

  • Alex Skrypnyk 6133 posts 23952 karma points MVP 7x admin c-trib
    Aug 11, 2016 @ 12:03
    Alex Skrypnyk
    0

    Hi Ramprasad,

    Did you render Video?

    Can you answer how did you make it?

    Thanks

  • Ramprasad 15 posts 116 karma points
    Aug 14, 2016 @ 17:36
    Ramprasad
    101

    Thanks Alex for the reply...

    Busy with my work and didn't replied.

    I just done it with this.

    IPublishedContent variable= helper.TypedMedia(propname.ToString());

       <video controls >
    <source src= "@pagename.propname" type="video/mp4" />
    </video>
    
  • Alex Skrypnyk 6133 posts 23952 karma points MVP 7x admin c-trib
    Aug 15, 2016 @ 07:22
    Alex Skrypnyk
    2

    Ramprasad, glad that you solved your issue!

Please Sign in or register to post replies

Write your reply to:

Draft