Copied to clipboard

Flag this post as spam?

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


  • Aditya.A 77 posts 96 karma points
    Jul 29, 2013 @ 08:45
    Aditya.A
    0

    Youtube video through macro

    Hello guys...

     

    I have to insert a youtube video through a macro..The utube id(11 digited) will be provided as a textstring by the user. any help will do a lot

  • Moran 285 posts 934 karma points
    Jul 29, 2013 @ 10:55
    Moran
    0

    Let's say that the property name of the textstring is "videoId" so you can do something like this:

    @if (item.HasProperty("videoId"))
    {
                        <div class="scale_vid">
    <iframe width="220" height="150" src="http://www.youtube.com/embed/@item.GetPropertyValue("videoId")" frameborder="0" allowfullscreen></iframe>
                        </div>
    }
  • Aditya.A 77 posts 96 karma points
    Jul 29, 2013 @ 12:40
    Aditya.A
    0

    Error occured

    c:\Websites\Veet2013Q1\Source\Veet.Web\macroScripts\635106768182547052_review_video.cshtml(17): error CS0117: 'umbraco.item' does not contain a definition for 'HasProperty'

     

    any other suggestions

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jul 29, 2013 @ 13:09
    Dennis Aaen
    0

    Hi Adity.A,

    You could try this one, and see if you have more luck with this code.

    @if(@Model.HasProperty("videoId")){
    <div class="scale_vid">
    <iframe width="220" height="150" src="http://www.youtube.com/embed/@Model.GetPropertyValue("videoId")" frameborder="0" allowfullscreen></iframe>
    </
    div>
    }

    /Dennis

  • Aditya.A 77 posts 96 karma points
    Jul 29, 2013 @ 13:33
    Aditya.A
    0

    PERFECTTTTTTTTTTTTTTTT that worked like a magic.....

     

    also can u tell me how to get the lightbox effect when we we paly the video with a resolution of 400 X 200

  • Moran 285 posts 934 karma points
    Jul 29, 2013 @ 13:44
    Moran
    0

    Sorry I should have changed "item" to "@Model"

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jul 29, 2013 @ 13:51
    Dennis Aaen
    0

    I don´t think at lightbox can contain youtube videos.

    But I found an alternative to the lightbox, Fancybox http://fancyapps.com/fancybox/#examples. Fancybox should be able to contain youtube video. I haven´t used fancybox myself on any projects jet.

    /Dennis

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jul 29, 2013 @ 13:55
    Dennis Aaen
    0

    And Adity.A remember to mark the post as solved so others can go straight to the solution if they come across the same problem.

    /Dennis

  • Aditya.A 77 posts 96 karma points
    Jul 29, 2013 @ 14:22
    Aditya.A
    0

    Hello dennis thank you..very much for your quick and accurare suggestion..It helped me a lot.

    im sorry may be i have asked the questtion wrong. The youtube video is now in the size 121X73 pix.

    now when ever someone play the video i want the video to be played in an enlarged size like 730 X 325. so it it possible if so

    thank u in advace for letting me know

Please Sign in or register to post replies

Write your reply to:

Draft