Copied to clipboard

Flag this post as spam?

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


  • Steve 472 posts 1216 karma points
    Sep 03, 2015 @ 14:31
    Steve
    1

    Razor for HTML Video

    Hi,

    I thought I had this syntax correct, but I am not seing the .mp4 file load into the player on the page. What do I need to change?

    Right now it outputs this HTML:

    src="umbraco.MacroEngines.DynamicMedia" type="video/mp4"

    @inherits umbraco.MacroEngines.DynamicNodeContext
    
    
    @{  
    
        if(!String.IsNullOrEmpty(Parameter.source)) {
    
        var videoWidth = Parameter.width;
        var videoHeight = Parameter.height;
        var videoSource = Library.MediaById(Parameter.source);
    
    <video width="@videoWidth" height="@videoHeight" controls>
      <source src="@videoSource" type="video/mp4">
    Your browser does not support the video tag.
    </video>
        }
    }
    
  • Steve 472 posts 1216 karma points
    Sep 03, 2015 @ 15:02
    Steve
    1

    Figured it out myself.

    Should be:

    <source src="@videoSource.UmbracoFile" type="video/mp4">
    

    Would like to know how to add an easy fallback for flash though. Any help would be appreciated.

  • Rune Hem Strand 147 posts 911 karma points hq c-trib
    Sep 03, 2015 @ 16:29
    Rune Hem Strand
    0

    For flash fallback look here http://camendesign.com/code/videoforeverybody


    All the best

    Rune

Please Sign in or register to post replies

Write your reply to:

Draft