php_begins Posted July 15, 2011 Share Posted July 15, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/242066-embedding-videos-with-php-variables/ Share on other sites More sharing options...
AyKay47 Posted July 15, 2011 Share Posted July 15, 2011 1. What browser are you using to view the object? 2. What does a "view source" in the browser show as the object value and source? Quote Link to comment https://forums.phpfreaks.com/topic/242066-embedding-videos-with-php-variables/#findComment-1243116 Share on other sites More sharing options...
php_begins Posted July 15, 2011 Author Share Posted July 15, 2011 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> Quote Link to comment https://forums.phpfreaks.com/topic/242066-embedding-videos-with-php-variables/#findComment-1243119 Share on other sites More sharing options...
AyKay47 Posted July 15, 2011 Share Posted July 15, 2011 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> Quote Link to comment https://forums.phpfreaks.com/topic/242066-embedding-videos-with-php-variables/#findComment-1243125 Share on other sites More sharing options...
php_begins Posted July 15, 2011 Author Share Posted July 15, 2011 tat didnt work either :-( Quote Link to comment https://forums.phpfreaks.com/topic/242066-embedding-videos-with-php-variables/#findComment-1243132 Share on other sites More sharing options...
AyKay47 Posted July 15, 2011 Share Posted July 15, 2011 should work..try <iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube. com/embed/ID> </iframe> //replace link Quote Link to comment https://forums.phpfreaks.com/topic/242066-embedding-videos-with-php-variables/#findComment-1243141 Share on other sites More sharing options...
php_begins Posted July 15, 2011 Author Share Posted July 15, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/242066-embedding-videos-with-php-variables/#findComment-1243148 Share on other sites More sharing options...
djlee Posted July 15, 2011 Share Posted July 15, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/242066-embedding-videos-with-php-variables/#findComment-1243149 Share on other sites More sharing options...
AyKay47 Posted July 15, 2011 Share Posted July 15, 2011 should work..try <iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube. com/embed/ID"> </iframe> //replace link Edit: didn't mean to re-post this Quote Link to comment https://forums.phpfreaks.com/topic/242066-embedding-videos-with-php-variables/#findComment-1243150 Share on other sites More sharing options...
php_begins Posted July 15, 2011 Author Share Posted July 15, 2011 sorry..i updated it but still without any luck.. <iframe class="youtube-player" type="text/html" width="100" height="100" src="<?php echo $ShowVideo; ?>"></iframe> Quote Link to comment https://forums.phpfreaks.com/topic/242066-embedding-videos-with-php-variables/#findComment-1243152 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.