Jump to content

embedding videos with php variables


php_begins

Recommended Posts

Hello,

I was trying to embed a video in a website. The url source is getting generated from a PHP variable. But the thumbnail does not get generated for some reason. When i echo the url, it displays the correct URL. Here is my code below: 

 

 

<object width="425" height="344">

    <param name="movie"

      value="<? echo $ShowVideo; ?>"></param>

    <param name="allowFullScreen" value="true"></param>

    <embed src="<? echo $ShowVideo; ?>"

      type="application/x-shockwave-flash" width="100" height="100">

    </embed>

</object>

 

Kindly help me with this.

Link to comment
Share on other sites

it does not display in any of the browsers.

I get this in the view source:

 

 

<object width="425" height="344">

 

    <param name="movie"

 

      value="

 

    <param name="allowFullScreen" value="true"></param>

 

    <embed src="

 

      type="application/x-shockwave-flash" width="100" height="100">

 

    </embed>

 

</object>

 

Link to comment
Share on other sites

From what I have heard, youtube videos have trouble with the param tag, try an iframe player instead

 

<iframe id="test" class="test" width="640" height="480" style="margin-bottom: 15px"
   src="http://www.youtube.com/watch?v=UrQ3U7NFWog&feature=related"></iframe>

Link to comment
Share on other sites

I am sorry..i am not sure what i am supposed to do.

Here's the 2 things i tried which didnt work:

 

<iframe class="youtube-player" type="text/html" width="100 height="100" src="<?php echo $ShowVideo; ?>"</iframe>

And

<iframe class="youtube-player" type="text/html"

width="640" height="385" src="http://www.youtube.

com/embed/<?php echo $ShowVideo; ?>">

</iframe>

 

Could u help me with the correct synatx.

Link to comment
Share on other sites

Your quotes are all over the place, that could be breaking it. the first one should be the one you want. but you have no quote ending the width attribute and the quote that ends the src attribute is in the wrong place. Fix that and try again.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.