Copied to clipboard

Flag this post as spam?

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


  • Gavin 15 posts 56 karma points
    Jul 01, 2015 @ 15:18
    Gavin
    0

    Razor output - video Url

    Hi, Is it possible to ouput the selected video URL rather than render in an iFrame?

    Could not see any mention of it in the docs.

    Thanks

    Gav

  • Gavin 15 posts 56 karma points
    Jul 01, 2015 @ 15:28
    Gavin
    1

    Realised after posting that you are accessing the YouTube API so just looked at what it returns - https://developers.google.com/youtube/v3/getting-started

    and then referenced for the video ID so can build the URL from that.

    @typedVideo.Id
    

    If there is a better way let me know.

    Thanks

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Jul 06, 2015 @ 08:06
    Warren Buckley
    0

    Sorry for my very delayed response, but yes you are correct I return the API response from YouTube's own API.

    So you could string concat the video URL quite easily like so

    @{
    var videoId = typedVideo.Id;
    var videoUrl = string.format("https://www.youtube.com/watch?v={0}, videoId);
    }
    
    <a href="@videoUrl">My Video</a>
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies