accept-range stuff fails on IIS5.1

General discussion about netjukebox
Superlexx
User
Posts: 45
Joined: Thu Feb 10, 2005 8:51 pm

Post by Superlexx »

not bad, this is what I've done of it (some of the code is unused):

Code: Select all

//  +---------------------------------------------------------------------------+ 
//  | Overlib Stream Javascript                                                 | 
//  +---------------------------------------------------------------------------+ 
function OverlibStreamJavascript() 
{ 
global $cfg;
$query       = mysql_query('SELECT stream_id FROM configuration_users WHERE username = "' . mysql_escape_string($cfg['username']) . '"');
$users       = mysql_fetch_array($query);

$array = '';
foreach ($cfg['stream_name'] as $name)
   $array .= '"' . $name . '", ';
$array = substr($array, 0, -2);
$codecs = '"MP3", "OGG Vorbis"';
$bitrates = '"64", "96", "128", "256"';
?>
<script language="JavaScript" type="text/javascript">
   <!--
   function overlibs(url)
   {
   var name = new Array(<?php echo $array; ?>);
   var codecs = new Array(<?php echo $codecs; ?>);
   var bitrates = new Array(<?php echo $bitrates; ?>);
   var list = '';
   list += '<table style="text-align: center;"><tr><th><a href="' + url + '&stream_cfg=-1">direct</a></th>';
   var i = 0;
   var j = 0;
   var k = 0;
   for (i = 0; i < bitrates.length; i++)
   {
		list += '<th>' + bitrates[i] + '</th>';
   }
   list += '</tr>';
   for (i = 0; i < codecs.length; i++)
   {
		list += '<tr><th>' + codecs[i] + '</th>';
		for (j = 0; j < bitrates.length; j++)
		{
			list += '<td>';
			if (k == <?php echo $users['stream_id']; ?>) list += '<strong>'
			list += '<a href="' + url + '&stream_cfg=' + k++ + '"><img class="streamtt" src="bitmap/small_stream.gif" alt="" /></a>';
			if (k == <?php echo $users['stream_id']; ?>) list += '</strong>'
			list += '</td>';
		}
		list += '</tr>';
   }
   list += '</table>';
   
   overlib(list, STICKY, NOCLOSE, WRAP, OFFSETX, 30, OFFSETY, -codecs.length*17, CAPTION, 'Stream:');
   }
   //-->
</script>
<?php
}
and this is what it looks like (added some margins to the images in the tooltip to equalize the column widths):
Image
User avatar
wbartels
netjukebox developer
Posts: 872
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Post by wbartels »

That is looking very cool.
The problem with this approach is that every file format must have the same bitrates.

When adding a short description to config.inc.php

Code: Select all

$cfg['stream_short_name'][] = '128';
Than it is possible to use the file extension for the Y-as, and the short description for the X-as.

The –1 for original file streaming is a very good idea.
Post Reply