php - Video working in Chrome but not Firefox -


i can videos play in chrome embed tags towards bottom of page, have them commented out. anyway, doesn't work firefox , can't find way display , play video database.

within div tag, myelement, if type location of video on computer, it'll load right up, i'm wanting video off db $url , every time try, says 'a plugin needed display content or no video found.'

i've tried using <video>, didn't seem work either.

<!doctype html> <html lang="en"> <head> <meta content="text/html; charset=utf-8" http-equiv="content-type" />  <title>watch</title> <script src="http://jwpsrv.com/library/6qvxzpkveeskjwp+lcgdiw.js"></script> <script src="jwplayer/jwplayer.js" ></script> <script>jwplayer.key="7sydcohxpeaicfiaz4rxdkkgf+fcssszrydb2q==";</script> </head>  <body>  <div id="myelement">loading player...</div> <script type="text/javascript"> jwplayer("myelement").setup({     file : "<?php  ?>",     //image: "",     width: 640,     height: 360 }); </script>  <?php  if(isset($_get['id'])) { $id = $_get['id']; $query = mysql_query("select * `videos` id='$id'"); while($row = mysql_fetch_assoc($query)) {     $name = $row['name'];     $url = $row['url']; }  echo "your watching ".$name."<br />"; //echo "<embed src='$url' width='560' height='315'></embed>";  } else {     echo "error!"; }  ?>  </body> </html> 

solution

instead of :

echo "<embed src='$url' width='560' height='315'></embed>"; 

use :

echo "<video controls src='$url' width='560' height='315'></video>"; 

(source: http://www.w3schools.com/html/html5_video.asp)

the video you're testing might format that's supported chrome not firefox. wind needing provide sources multiple formats safe (example w3c link above):

<video width="320" height="240" controls>   <source src="movie.mp4" type="video/mp4">   <source src="movie.ogg" type="video/ogg"> browser not support video tag. </video> 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -