Llevo unos días trasteando varios códigos para poner un reproductor de youtube en mi web. En la BD tengo una de los campos que es la url (tipo varchar, longitud de 500 chars).
El problema esta en que ninguno de los siguientes códigos muestra el reproductor. Solo muestran un recuadro negro o blanco... He comprobado con el "inspeccionar elemento" de Chrome y sale la url correctamente pero no va...
Alguna idea? Aquí os dejo los códigos que he probado...
Código:
<table style="width:1024px; margin-top:30px;"> <tr> <?php $consulta = "SELECT * FROM videos ORDER BY fecha desc LIMIT 3"; $result = mysql_query($consulta,$con); while($row = mysql_fetch_array($result)){ echo "<td style='float:left'><iframe width='420' height='315' src='".$row['url']."'></iframe></td>"; } ?> </tr> </table>
Código:
<table style="width:1024px; margin-top:30px;"> <tr> <?php $consulta = "SELECT * FROM videos ORDER BY fecha desc LIMIT 3"; $result = mysql_query($consulta,$con); while($row = mysql_fetch_array($result)){ echo "<td style='float:left'> <object width="420" height="315" data='".$row['url']."'> </object></td>"; } ?> </tr> </table>
Código:
También probé añadiendo esto (type="application/x-shockwave-flash") en el último código, quedando así:<table style="width:1024px; margin-top:30px;"> <tr> <?php $consulta = "SELECT * FROM videos ORDER BY fecha desc LIMIT 3"; $result = mysql_query($consulta,$con); while($row = mysql_fetch_array($result)){ echo "<td style='float:left'> <embed width="420" height="315" src='".$row['url']."'></td>"; } ?> </tr> </table>
Código:
Ojala podáis echarme un cable o algo... porque he buscado alternativas pero solo encuentro estas 4...<table style="width:1024px; margin-top:30px;"> <tr> <?php $consulta = "SELECT * FROM videos ORDER BY fecha desc LIMIT 3"; $result = mysql_query($consulta,$con); while($row = mysql_fetch_array($result)){ echo "<td style='float:left'> <embed width="420" height="315" src='".$row['url']."' type="application/x-shockwave-flash"></td>"; } ?> </tr> </table>
Muchas gracias :)