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
https://forums.phpfreaks.com/topic/242066-embedding-videos-with-php-variables/
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>

 

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>

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.