rejetto forum

Can someone help me with the rawr player?

0 Members and 1 Guest are viewing this topic.

Offline crazyjust

  • Occasional poster
  • *
    • Posts: 37
    • View Profile
Merry Christmas all :) ...Ok so here it is. I made a custom page for e107 cms. I have the player Stationary. When I click preview, the player wont start playing with firefox until I scroll up to where the player is in sight. There are no problems with IE. What I would like to do is make the player pop up in a new fancy window like rawr tpl when I hit the preview button. Anyone that has read any of my posts, knows I am not a coder lol. Any help with this would be great. Here is the music.php(index) and player.php if anyone can help me. Thanks in advance.

Music.php(index)
Code: [Select]
require_once("config.php");
require_once("class2.php");
define("e_PAGETITLE", "Music");
require_once(HEADERF);

if (!USER) {
   $ns->tablerender("Error!", "You must login to view this page");
   require_once(FOOTERF);
   exit;
}

?>
<?php
function mksize($bytes)
{
if ($bytes 1000 1024)
return number_format($bytes 10242) . " kB";
elseif ($bytes 1000 1048576)
return number_format($bytes 10485762) . " MB";
elseif ($bytes 1000 1073741824)
return number_format($bytes 10737418242) . " GB";
else
return number_format($bytes 10995116277762) . " TB";
}

function 
getico($type) {
 switch(
strtolower($type)) {
  case 
"mp3": return "mp3.gif"; break;
  case 
"exe":
  case 
"setup":
  case 
"msi": return "exe.gif"; break;
  case 
"zip": return "zip.gif"; break;
  case 
"rar":
  case 
"bin"
  case 
"tar":
  case 
"bz2":
  case 
"gz":
  case 
"z":
  case 
"7z":
  case 
"s7z": return "rar.gif"; break;
  case 
"mpg":
  case 
"mp4":
  case 
"mpeg": return "mp4.gif"; break;
  case 
"avi": return "avi.gif"; break;
  case 
"iso":
  case 
"img"
  case 
"cue": return "iso.gif"; break;
  case 
"vob": return "vob.gif"; break;
    
  default: return 
"unknown.gif"; break;
  }
}

$filedirxtra= (isset($_GET['dir']) ? htmlspecialchars($_GET['dir'])."/" "");
?>


<!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" xml:lang="en" lang="en">
 <head>
  <title>Downloads</title>
  <meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8" />
  <style type="text/css">
   body {
    font-family: Verdana, Tahoma, Helvetica, Arial;
    font-size: 10pt;
    background-color: #000000;
    color: #FFFFFF;
    margin: 50px;
   }
   table.list tr td {
    border-bottom: 1px solid orange;
   }
   a {
    text-decoration: none;
   }
   a:hover {
    text-decoration: underline;
   }
   #txtsrch {
    background-image: url("icons/srchico.png");
    background-position: left center;
    background-repeat: no-repeat;
    background-color: #cccccc;
    font-weight: bold;
    font-size: 11pt;
    padding-left: 25px;
    height: 20px;
   }
   #srchbtn {
    background: transparent;
    background-image: url("dl-icons/srchbtn.gif");
    background-position: center center;
    background-repeat: no-repeat;
    height: 25px;
    width: 70px;
    border: none;
   }
  </style>
  <script type="text/javascript">
  function preview(file) {
    var f = document.getElementById('fplayer');
    f.src = "player.php?file="+file;
   }
  </script>
 </head>
<body>


</div>
<!--Nav-->
<div style="padding: 5px; margin: 10px; width: auto; height: 30px; border: 1px solid orange;">
 <!-- Table hack required for IE-->
 <table cellpadding="0" cellspacing="0" border="0" width="auto" style="border: none;">
  <tr>
   <td valign="middle" align="left">
    <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
     <?php 
      
if ($filedirxtra != "")
       echo 
"<input type='hidden' name='dir' value='".$filedirxtra."' />";
     
?>

     <input id="txtsrch" type="text" size="25" name="search" />
     <input id="srchbtn" type="submit" value=" " />
    </form>
   
 </table>
</div>

<div style="width: auto; margin: 0px; border: none; text-align: center;">
<iframe id="fplayer" frameborder="0" marginwidth="0" marginheight="0" width="320" height="70" src="player.php"></iframe>
</div>

<table class="list" width="auto" cellpadding="3" cellspacing="0" border="0" style="margin: 10px; border: 1px solid orange;">
<?php
$kw 
= (isset($_GET['search']) ? trim($_GET['search']) : "");

$dir opendir($filedir.$filedirxtra);
while(
false !== ($file readdir($dir))) 
 {
 if(
$file != "." && $file != "..")
  {
  
$fext explode("."$file);
  if(!
in_array(end($fext), $blockfiles) && is_file($filedir.$filedirxtra.$file)) {
   if((
$kw != "" preg_match("/$kw/i"$file)) || $kw == "")
    print(
"<tr><td><img src='".$icondir.getico(end($fext))."' title='".end($fext)."' alt='".end($fext)."' border='0'/></td><td width='99%'>".htmlspecialchars($file)."</td><td><span style='white-space: nowrap;'> ".mksize(filesize($filedir.$filedirxtra.$file))."</span></td><td><a href=\"".htmlspecialchars($filedir.$filedirxtra.$file)."\"><img src='".$icondir."download.gif' border='0' alt='DL' title='Download File: ".htmlspecialchars($file)."' /></a></td><td>".(in_array(end($fext), $prvfiles) ? "<a href=\"javascript:void(0);\" onclick=\"preview('".htmlspecialchars(addslashes($filedir.$filedirxtra.$file))."');\"><img src='".$icondir."preview.gif' border='0' alt='Preview' title='Preview File: ".htmlspecialchars($file)."' /></a>" "&nbsp;")."</td></tr>");
   }
  elseif(
is_dir($filedir.$filedirxtra.$file))
    echo 
"<tr><td><img src='".$icondir."directory.gif' alt='directory' border='0' /></td><td colspan='4'><a href='?dir=".$filedirxtra.$file."'>$file</a></td>";
  }
 }
closedir($dir);


?>

</table>

<?php
require_once(FOOTERF);
exit;
?>

Player.php
Code: [Select]
<!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" xml:lang="en" lang="en">
 <head>
  <title>Player</title>
  <meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8"
 />
  <style type="text/css">
  body { background-color: ; }
  </style>
 </head>
<body>
<?php
$toplay 
stripslashes($_GET['file']);
?>

<object type="application/x-shockwave-flash" data="rawr_player.swf" width="320" height="50">
<param name="movie" value="http://rawr-designs.com/rawr_data/players/rawr_player.swf"/>
<param name="bgcolor" value="#741e1f"/>
<param name="wmode" value="transparent"/>
<param id="flashvars" name="flashvars" value="autoplay=on&colorset=rawr_red&context=off<?php echo "&file=$toplay"?>" />
</object>
</body>
</html>


Offline TSG

  • Moderator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
I hope someone can help you, cause I am not confident enough with php yet to really help out, I think i know what the problem is, but I STILL don't have the time to sit and play with it. My life is crazy at the moment. If Richard can find the time he can probably help, if he cant be bothered then i'm sure someone else will help with it.

Try creating the same scenario as the list generated from HFS, and the value given for %sequential%, that is what differentiates each playlist item. It will use a value like Box1, Box2 or something like that for the id's so the javascript can read it. You will also need to fire a function with javascript to generate a playlist from these values into an array of sorts... which will then be used to access and open the box for the required player. This was not an easy thing to make, and it took a long time for Richard and I to understand. I think even we struggle with it sometimes and we made and refined it lol.

Scratch that, I think all you need to do is set a z-index for the preview box? I dunno its hard to explain how the preview box works to a person that isn't a confident coder.

I will have probably a week after new years, then, hopefully my graduation package should arrive and I can begin looking for work in my new area, i'll try to fix all the bugs that have been brought up and improve the RAWR-Player if I can. I really would like to add this letterbox feature that youtube and the likes have employed (as well as other things i have mentioned) so people can view their videos without stupid variables for wide etc.

« Last Edit: December 26, 2008, 05:03:26 PM by That_Stevens_Guy »


Offline crazyjust

  • Occasional poster
  • *
    • Posts: 37
    • View Profile
Thank you for the reply tsg. I had a guy look at your rawr tpl, and he was really impressed. He said the player actually comes up in a new window but it is styled with a hell of alot of js to make it look like that. He didnt know where to begin lol. It is really nice work.


Offline crazyjust

  • Occasional poster
  • *
    • Posts: 37
    • View Profile
Does anyone know about php and js that can help me with this here? I have searched, tried several things, and failed lol