Copied to clipboard

Flag this post as spam?

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


  • Vijay 26 posts 127 karma points
    Mar 10, 2019 @ 17:52
    Vijay
    0

    How to get video url from embedded property?

    Hi there, How can I get embedded video URL in .cshtml page?

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    Mar 10, 2019 @ 17:55
    Søren Gregersen
    0

    Hi,

    Are you talking about en element created with the embed grid editor?

    The URL for that would only be accessible if you go trough the controls in the grid, and do some digging in the source.

  • Vijay 26 posts 127 karma points
    Mar 10, 2019 @ 17:56
    Vijay
    0

    Yes, Do you have any sample code for that?

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    Mar 10, 2019 @ 18:20
    Søren Gregersen
    100

    Not really - at best you will be able to find an HTML-string that would need parsing based on whatever provider you have used. It's based on a format called oembed, that is used to create html-snippets that will embed the requested resource. A youtube video like https://www.youtube.com/watch?v=dQw4w9WgXcQ will end up something like

    <iframe width="480" height="270" src="https://www.youtube.com/embed/dQw4w9WgXcQ?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
    

    If I load url in the "src"-attribute on the iframe, I get the video, but when I click play, it fails - saying the video is not available.

    If you really want to do it, I suggest having a look at how the Bootstrap3.cshtml goes through the elements in the grid.

    Basically it's like this:

    foreach(dynamic row in grid)
      foreach(dynamic section in row)
        foreach(dynamic control in section)
          render(control) 
    
Please Sign in or register to post replies

Write your reply to:

Draft