in reply to Displaying Youtube Video (Resolved)

Can you post an example of what you have stored in $vidlect? If it's simply the URL to a youtube video you won't be able to view it on the page. To embed a youtube video you need the 'embed' code, which includes the flash player etc:

<object width="425" height="344"> <param name="movie" value="http://www.youtube.com/v/GwQMnpUsj8I&hl=en& +fs=1"> </param><param name="allowFullScreen" value="true"> </param><param name="allowscriptaccess" value="always"> </param><embed src=http://www.youtube.com/v/GwQMnpUsj8I&hl=en&fs=1 type="application/x-shockwave-flash" allowscriptaccess="always" allowf +ullscreen="true" width="425" height="344"> </embed></object>

You're restricting this to 140 characters in your text field.

Update: confised size and maxlength. OP has updated their post

Replies are listed 'Best First'.
Re^2: Displaying Youtube Video
by Tsalagi_4 (Initiate) on Jun 11, 2010 at 12:23 UTC

    I updated my original post first. Getting to know Perl Monks forum. Anyway here is the you tube link.

    <object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/Pij6J0HsYFA&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Pij6J0HsYFA&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>

    Thanks for replying

      Don't worry about it, welcome to the Monastery. Could you post what the result of <div>$vidlect</div> displays?

        Here is what is getting stored and output

        <div><object width=&quot;480&quot; height=&quot;385&quot;><param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/Pij6J0HsYFA&hl=en_US&fs=1&&quot;></param><param name=&quot;allowFullScreen&quot; value=&quot;true&quot;></param><param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;></param><embed src=&quot;http://www.youtube.com/v/Pij6J0HsYFA&hl=en_US&fs=1&&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;480&quot; height=&quot;385&quot;></embed></object></div>

        I don't think it posted my reply correctly. I can't see it. Here it is the output again.

        <div><object width=&quot;480&quot; height=&quot;385&quot;><param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/Pij6J0HsYFA&hl=en_US&fs=1&&quot;></param><param name=&quot;allowFullScreen&quot; value=&quot;true&quot;></param><param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;></param><embed src=&quot;http://www.youtube.com/v/Pij6J0HsYFA&hl=en_US&fs=1&&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;480&quot; height=&quot;385&quot;></embed></object></div>

        I have used both the <c> and <code> code wrappers.

        I don't think the forum likes me posting the code that is returned because it looks like a link to a youtube video. What are my other options please?

Re^2: Displaying Youtube Video
by StommePoes (Scribe) on Jun 13, 2010 at 10:26 UTC

    To embed a youtube video you need the 'embed' code, which includes the flash player etc

    Nah, that's just Nutscrape proprietary code that people use to placate teh Evil One.

    But you can still keep code valid: Bye Bye Embed.