Forum Moderators: coopster

Message Too Old, No Replies

embedded youtube videos dont play

when fetched from database

         

naiquevin

8:27 am on Jun 25, 2009 (gmt 0)

10+ Year Member



I have written a script to allow users embed videos in their profiles.
There is an input field where the users paste the embed script of the video.
On submitting the form, the embed script is saved in database as BLOB and at the same time the video is displayed on the page using ajax.

The problem is that, when it is displayed through ajax ie immediately after saving, the video appears and can be played. But when the page is refreshed and the script is taken from the database and 'echo'-ed, it tells me that I dont have a plugin to play the video. When I click 'download plugin', the browser gives a msg

'No plugins found
Unknown plugin (text/html)'

I am facing this problem online only and not on wamp..

Unable to figure out the problem ?
Kindly help

jatar_k

8:18 pm on Jun 25, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



what code are you using to embed them? smells like an error in the html

naiquevin

10:28 am on Jun 26, 2009 (gmt 0)

10+ Year Member



the one that is available on youtube .. just below the video description

jatar_k

1:40 pm on Jun 26, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



so what do you do with that code?
just present it as is?
what plugin might it be talking about? have you used an html validator [validator.w3.org] to validate the page that you have the embedded player on?
what is the difference in the code when it is echo'ed as opposed to when you originally generate it?
What surrounding code has changed?

jdMorgan

2:19 pm on Jun 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Something in the "save/retrieve embedded object from database" process is losing or corrupting the MIME-type of the included object:
'No plugins found
Unknown plugin (text/html)'

It looks like your HTML page is trying to <embed> an HTML document, rather than a .swf or .flv, file.

Jim

naiquevin

9:31 am on Jun 27, 2009 (gmt 0)

10+ Year Member



thanks for the replies

so what do you do with that code?
just present it as is?

yes I am putting the code as it is inside a div...
the same code(ie from youtube) is placed appended to a dummy div by jquery on completion of the ajax request..
This way, there are no issues..

I am unable to figure out any difference between surrounding code inthe two places..

from database, its
<div> <?php echo $row['youtube']; ?> </div>

in ajax, it is
$('#dummy').append('<div>'+youtube+'</div>');

the above code is not as it is, i have skipped the id and class

@jdmorgan .. can anything be done about it? Also, there is no problem offline (wamp) ..