textbox Posted May 23, 2007 Share Posted May 23, 2007 Hello all, I am currently trying to pump out a list of flv's which are being dynamically populated. My script for this works. However, how do I put the flv object code into an echo?!? <?php $sql = "SELECT * FROM mms_message_element ORDER BY inbound_mms_id ASC"; //get the latest $spacer = " "; $getflash = mysql_query("SELECT * FROM mms_message_element ORDER BY inbound_mms_id ASC"); while ($flv=mysql_fetch_array ($getflash) ) { echo "<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="240" height="180" id="FLVPlayer"> <param name="movie" value="FLVPlayer_Progressive.swf" /> <param name="salign" value="lt" /> <param name="quality" value="high" /> <param name="scale" value="noscale" /> <param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=$flv[flvlocation]&autoPlay=false&autoRewind=false" /> <embed src="FLVPlayer_Progressive.swf" flashvars="&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=$flv[flvlocation]&autoPlay=false&autoRewind=false" quality="high" scale="noscale" width="240" height="180" name="FLVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object>"; If there is another way to do this then please let me know. I wish to display a list of flv's. The file location is stored in my db. Thanks Nick Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/ Share on other sites More sharing options...
textbox Posted May 23, 2007 Author Share Posted May 23, 2007 <body onload="MM_CheckFlashVersion('7,0,0,0','Content on this page requires a newer version of Macromedia Flash Player. Do you want to download it now?');"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="240" height="180" id="FLVPlayer"> <param name="movie" value="FLVPlayer_Progressive.swf" /> <param name="salign" value="lt" /> <param name="quality" value="high" /> <param name="scale" value="noscale" /> <param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=<? echo $flv_location; ?>&autoPlay=false&autoRewind=false" /> <embed src="FLVPlayer_Progressive.swf" flashvars="&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=<? echo $flv_location; ?>&autoPlay=false&autoRewind=false" quality="high" scale="noscale" width="240" height="180" name="FLVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> Meant to include this. This is the standard html output for embedding an flv. Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-260343 Share on other sites More sharing options...
textbox Posted May 24, 2007 Author Share Posted May 24, 2007 Still struggling with this. Does anyone else know of another way to do it?! Thanks Nick Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261123 Share on other sites More sharing options...
corbin Posted May 24, 2007 Share Posted May 24, 2007 So you're trying to display this flash file for every flv row you pull from the DB? The easiest way to do that would be using a function and passing the args into html or using sprintf() (look it up). I would most likely go with the sprintf method, but that's just me. If I misunderstood you, please elucidate your question. Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261127 Share on other sites More sharing options...
textbox Posted May 24, 2007 Author Share Posted May 24, 2007 Thanks Corbin, thats exactly what i wish to do. I want to display as many flash video files are there are, with flv_location being the address of the file. I'll look into the sprint() function. Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261131 Share on other sites More sharing options...
Trium918 Posted May 24, 2007 Share Posted May 24, 2007 What is what field type do you have your images set as? <?php $query="UPDATE images SET imagelocation='$path_big/$rand_name.$file_ext', thumblocation='$path_thumbs/$rand_name.$file_ext' WHERE username = '$username'"; mysql_query($query); ?> Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261148 Share on other sites More sharing options...
textbox Posted May 24, 2007 Author Share Posted May 24, 2007 In the db? Just as a varchar. Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261154 Share on other sites More sharing options...
Trium918 Posted May 24, 2007 Share Posted May 24, 2007 In the db? Just as a varchar. How are you pulling it out? Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261159 Share on other sites More sharing options...
MadTechie Posted May 24, 2007 Share Posted May 24, 2007 read the script (first post) via mysql_fetch_array! Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261162 Share on other sites More sharing options...
Trium918 Posted May 24, 2007 Share Posted May 24, 2007 read the script (first post) via mysql_fetch_array! I understand that much. Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261164 Share on other sites More sharing options...
textbox Posted May 24, 2007 Author Share Posted May 24, 2007 Sorry Trium, i dont mean to be rude, but are you trying to get the code working yourself (like you did the other day with the image upload) or are you looking at ways i can rectify my problem?! Ive looked into the sprintf() functions and to be honest its baffling me!!:S Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261181 Share on other sites More sharing options...
trq Posted May 24, 2007 Share Posted May 24, 2007 Assuming the filed storing the .flv names is called flvfile. <?php $sql = "SELECT * FROM mms_message_element ORDER BY inbound_mms_id ASC"; if ($result = mysql_query("SELECT * FROM mms_message_element ORDER BY inbound_mms_id ASC")) { if (mysql_num_rows($result)) { while ($row = mysql_fetch_array($getflash)) { echo "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"240\" height=\"180\" id=\"FLVPlayer\"> <param name=\"movie\" value=\"{$row['flvfile']}\" /> <param name=\"salign\" value=\"lt\" /> <param name=\"quality\" value=\"high\" /> <param name=\"scale\" value=\"noscale\" /> <param name=\"FlashVars\" value=\"&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName={$row['flvlocation']}&autoPlay=false&autoRewind=false\" /> <embed src=\"{$row['flvfile']}\" flashvars=\"&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName={$row['flvlocation']}&autoPlay=false&autoRewind=false\" quality=\"high\" scale=\"noscale\" width=\"240\" height=\"180\" name=\"FLVPlayer\" salign=\"LT\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /> </object>"; } } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261185 Share on other sites More sharing options...
Trium918 Posted May 24, 2007 Share Posted May 24, 2007 Sorry Trium, i dont mean to be rude, but are you trying to get the code working yourself (like you did the other day with the image upload) or are you looking at ways i can rectify my problem?! Ive looked into the sprintf() functions and to be honest its baffling me!!:S I got it working and I took some of the script that wasn't needed! Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261186 Share on other sites More sharing options...
textbox Posted May 25, 2007 Author Share Posted May 25, 2007 Thanks for that Thorpe. Sadly though it doesnt output anything?! Any ideas? <? include "global/db.php"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <script type="text/javascript"> function MM_CheckFlashVersion(reqVerStr,msg){ with(navigator){ var isIE = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1); var isWin = (appVersion.toLowerCase().indexOf("win") != -1); if (!isIE || !isWin){ var flashVer = -1; if (plugins && plugins.length > 0){ var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : ""; desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc; if (desc == "") flashVer = -1; else{ var descArr = desc.split(" "); var tempArrMajor = descArr[2].split("."); var verMajor = tempArrMajor[0]; var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r"); var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0; flashVer = parseFloat(verMajor + "." + verMinor); } } // WebTV has Flash Player 4 or lower -- too low for video else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0; var verArr = reqVerStr.split(","); var reqVer = parseFloat(verArr[0] + "." + verArr[2]); if (flashVer < reqVer){ if (confirm(msg)) window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"; } } } } </script> </head> <body> <?php if ($result = mysql_query("SELECT * FROM mms_message_element ORDER BY id ASC")) { if (mysql_num_rows($result)) { while ($row = mysql_fetch_array($getflash)) { echo "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"240\" height=\"180\" id=\"FLVPlayer\"> <param name=\"movie\" value=\"FLVPlayer_Progressive.swf\" /> <param name=\"salign\" value=\"lt\" /> <param name=\"quality\" value=\"high\" /> <param name=\"scale\" value=\"noscale\" /> <param name=\"FlashVars\" value=\"&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName={$row['flv_location']}&autoPlay=false&autoRewind=false\" /> <embed src=\"FLVPlayer_Progressive.swf\" flashvars=\"&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName={$row['flv_location']}&autoPlay=false&autoRewind=false\" quality=\"high\" scale=\"noscale\" width=\"240\" height=\"180\" name=\"FLVPlayer\" salign=\"LT\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /> </object>"; } } } ?> </body> </html> Its not outputting anything on the screen. I appreciate the help so far though Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261194 Share on other sites More sharing options...
MadTechie Posted May 25, 2007 Share Posted May 25, 2007 Leaching...! thorpe should of worked try <? include "global/db.php"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <script type="text/javascript"> function MM_CheckFlashVersion(reqVerStr,msg){ with(navigator){ var isIE = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1); var isWin = (appVersion.toLowerCase().indexOf("win") != -1); if (!isIE || !isWin){ var flashVer = -1; if (plugins && plugins.length > 0){ var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : ""; desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc; if (desc == "") flashVer = -1; else{ var descArr = desc.split(" "); var tempArrMajor = descArr[2].split("."); var verMajor = tempArrMajor[0]; var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r"); var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0; flashVer = parseFloat(verMajor + "." + verMinor); } } // WebTV has Flash Player 4 or lower -- too low for video else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0; var verArr = reqVerStr.split(","); var reqVer = parseFloat(verArr[0] + "." + verArr[2]); if (flashVer < reqVer){ if (confirm(msg)) window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"; } } } } </script> </head> <body> <?php if ($result = mysql_query("SELECT * FROM mms_message_element ORDER BY id ASC")) { if (mysql_num_rows($result)) { while ($row = mysql_fetch_array($getflash)) { echo $row['flv_location']." - <br>"; echo "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"240\" height=\"180\" id=\"FLVPlayer\"> <param name=\"movie\" value=\"FLVPlayer_Progressive.swf\" /> <param name=\"salign\" value=\"lt\" /> <param name=\"quality\" value=\"high\" /> <param name=\"scale\" value=\"noscale\" /> <param name=\"FlashVars\" value=\"&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName={$row['flv_location']}&autoPlay=false&autoRewind=false\" /> <embed src=\"FLVPlayer_Progressive.swf\" flashvars=\"&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName={$row['flv_location']}&autoPlay=false&autoRewind=false\" quality=\"high\" scale=\"noscale\" width=\"240\" height=\"180\" name=\"FLVPlayer\" salign=\"LT\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /> </object>"; } } } ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261196 Share on other sites More sharing options...
trq Posted May 25, 2007 Share Posted May 25, 2007 Maybe your query is failing.... try. <?php if ($result = mysql_query("SELECT * FROM mms_message_element ORDER BY id ASC")) { if (mysql_num_rows($result)) { while ($row = mysql_fetch_array($getflash)) { echo "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"240\" height=\"180\" id=\"FLVPlayer\"> <param name=\"movie\" value=\"FLVPlayer_Progressive.swf\" /> <param name=\"salign\" value=\"lt\" /> <param name=\"quality\" value=\"high\" /> <param name=\"scale\" value=\"noscale\" /> <param name=\"FlashVars\" value=\"&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName={$row['flv_location']}&autoPlay=false&autoRewind=false\" /> <embed src=\"FLVPlayer_Progressive.swf\" flashvars=\"&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName={$row['flv_location']}&autoPlay=false&autoRewind=false\" quality=\"high\" scale=\"noscale\" width=\"240\" height=\"180\" name=\"FLVPlayer\" salign=\"LT\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /> </object>"; } } else { echo "no records found"; } } else { echo "Query failed" . mysql_error(); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261197 Share on other sites More sharing options...
textbox Posted May 25, 2007 Author Share Posted May 25, 2007 Oh, and the $ i need to drag out is called $flv_location Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261198 Share on other sites More sharing options...
trq Posted May 25, 2007 Share Posted May 25, 2007 I'll assume you mean that to be the name of the field? <?php if ($result = mysql_query("SELECT * FROM mms_message_element ORDER BY id ASC")) { if (mysql_num_rows($result)) { while ($row = mysql_fetch_array($getflash)) { echo "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"240\" height=\"180\" id=\"FLVPlayer\"> <param name=\"movie\" value=\"{$row['flv_location']}\" /> <param name=\"salign\" value=\"lt\" /> <param name=\"quality\" value=\"high\" /> <param name=\"scale\" value=\"noscale\" /> <param name=\"FlashVars\" value=\"&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName={$row['flv_location']}&autoPlay=false&autoRewind=false\" /> <embed src=\"{$row['flv_location']}\" flashvars=\"&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName={$row['flv_location']}&autoPlay=false&autoRewind=false\" quality=\"high\" scale=\"noscale\" width=\"240\" height=\"180\" name=\"FLVPlayer\" salign=\"LT\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /> </object>"; } } else { echo "no records found"; } } else { echo "Query failed" . mysql_error(); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261200 Share on other sites More sharing options...
textbox Posted May 25, 2007 Author Share Posted May 25, 2007 No output echoed in terms of errors. No output echoed in terms of flash either I wonder if something like a flash video playlist would be an easier way to do it? Driven on XML pulling in the locations in php. I know this can be done. I have however no idea how!!! Great isnt it! Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261203 Share on other sites More sharing options...
MadTechie Posted May 25, 2007 Share Posted May 25, 2007 what about! <?php if ($result = mysql_query("SELECT * FROM mms_message_element ORDER BY id ASC")) { if (mysql_num_rows($result)){ while ($row = mysql_fetch_array($getflash)) { print_r($row); echo "<br>"; } } else { echo "no records found"; } } else { echo "Query failed" . mysql_error(); } ?> thats must return something Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261205 Share on other sites More sharing options...
textbox Posted May 25, 2007 Author Share Posted May 25, 2007 That doesnt return anything?! Which i dont get. The table name is correct and populated. The field name flv_location. Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261221 Share on other sites More sharing options...
trq Posted May 25, 2007 Share Posted May 25, 2007 Ah... I see the error. while ($row = mysql_fetch_array($getflash)) { should be.... while ($row = mysql_fetch_array($result)) { Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261224 Share on other sites More sharing options...
MadTechie Posted May 25, 2007 Share Posted May 25, 2007 i have to ask.. you sure your uploading to the correct place etc add die("END"); at the top if that fails check what you uploading and where! EDIT: Digs a hole and hide.. how did i miss that.. Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261225 Share on other sites More sharing options...
textbox Posted May 25, 2007 Author Share Posted May 25, 2007 Thanks a lot guys, i did notice that earlier and meant to ask where it was coming from, but then forgot! Thanks a lot Thorpe and Techie! Quote Link to comment https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261236 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.