Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/
Share on other sites

<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.

Link to comment
https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-260343
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261127
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261181
Share on other sites

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>";
      }
    }
  }

?>

Link to comment
https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261185
Share on other sites

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!

Link to comment
https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261186
Share on other sites

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 :)

Link to comment
https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261194
Share on other sites

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>

Link to comment
https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261196
Share on other sites

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();
  }

?>

Link to comment
https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261197
Share on other sites

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();
  }

?>

Link to comment
https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261200
Share on other sites

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!

Link to comment
https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261203
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/52728-solved-echo-an-flv/#findComment-261205
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.