Hi
I still can't get it to work - I've really tried all I know how to do (not a programmer at all...)
Can anyone help me get this player to work? It truly is a better player than the xspf player, IMHO.
Thanks!
John
$cfg['xspf_url'] = 'morrow/xspf_jukebox.swf'; $this->data .= '<track>'.$this->crlf;
$this->data .= '<title>'.$f2->gentitle(array('title')).'</title>'.$this->crlf;
$this->data .= '<creator>'.$f2->id3['artist'].'</creator>'.$this->crlf;
$this->data .= '<location>'.$url.'</location>'.$this->crlf;
$this->data .= '</track>'.$this->crlf;
}
}
}
}
function flashhtml()
{
global $setctl, $phpenv, $u_cookieid, $u_id, $cfg;
// kprintheader('', 0, 0);
$playlist = $setctl->get('streamurl').$phpenv['streamlocation'];
$playlist .= '?templist='.$u_id.'&c='.$u_cookieid.'&file='.lzero(getrand(1,999999),6).'.xml';
$link = $cfg['xspf_url'].'?file='.urlencode($playlist);
?>
<head>
<script type="text/javascript" src="swfobject.js"></script>
</head>
<p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
<script type="text/javascript">
var s1 = new SWFObject('<?php echo $link; ?>','mpl','400','450','7');
s1.addParam('allowscriptaccess','always');
s1.addParam('allowfullscreen','true');
s1.addVariable('height','450');
s1.addVariable('width','400');
s1.addVariable('logo','pic.png');
s1.addVariable('displayheight','300');
s1.addVariable('autostart','true');
s1.addVariable('repeat','list');
s1.addVariable('shuffle','false');
s1.addVariable("backcolor","0x000000");
s1.addVariable("frontcolor","0xCCCCCC");
s1.addVariable("lightcolor","0x996600");
s1.write('player1');
</script>
<?php
kprintend();
$cfg['xspf_url'] = 'mediaplayer.swf';
$cfg['xspf_enable'] = true;
// enable xspf? Make sure the URL above works.
$link = $cfg['xspf_url'].'?file=http://mysite.org/music/Albums/10,000%20Maniacs/MTV%20Unplugged/12%20-%20Because%20The%20Night.mp3';
s1.addVariable('logo','pic.png'); $kpi = new kpimage(false, $f2->drive, $f2->relativepath);
if ($kpi->find())
{
$kpi->resize();
$imgurl = $kpi->geturl(true);
} else $imgurl = '';
$this->data .= '<image>'.$imgurl.'</image>'.$this->crlf;

$this->data .= '<track>'.$this->crlf;
$this->data .= '<title>'.$f2->gentitle(array('title')).'</title>'.$this->crlf;
$this->data .= '<creator>'.$f2->id3['artist'].'</creator>'.$this->crlf;
$this->data .= '<location>'.$url.'</location>'.$this->crlf;
$this->data .= '</track>'.$this->crlf;
}
}
}
}
function flashhtml()
{
global $setctl, $phpenv, $u_cookieid, $u_id, $cfg;
// kprintheader('', 0, 0);
$playlist = $setctl->get('streamurl').$phpenv['streamlocation'];
$playlist .= '?templist='.$u_id.'&c='.$u_cookieid.'&file='.lzero(getrand(1,999999),6).'.xml';
$link = $cfg['xspf_url'].'?file='.urlencode($playlist);
?>
<head>
<script type="text/javascript" src="swfobject.js"></script>
</head>
<p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
<script type="text/javascript">
var s1 = new SWFObject('<?php echo $link; ?>','kplayer','400','400','8');
s1.addParam('allowscriptaccess','always');
s1.addParam('allowfullscreen','true');
s1.addVariable('height','400');
s1.addVariable('width','400');
s1.addVariable('displayheight','175');
s1.addVariable('autostart','true');
s1.addVariable('showstop','true');
s1.addVariable("backcolor","0x000000");
s1.addVariable("frontcolor","0xCCCCCC");
s1.addVariable("lightcolor","0x996600");
s1.addVariable('javascriptid','kplayer');
s1.addVariable('usefullscreen','true');
s1.addVariable('shuffle','false');
s1.write('player1');
</script>
<?php
kprintend();$kpi = new kpimage(false, $f2->drive, $f2->relativepath);
if ($kpi->find())
{
$kpi->resize();
$imgurl = $kpi->geturl(true);
} else $imgurl = '';
$this->data .= '<image>'.$imgurl.'</image>'.$this->crlf;$this->data .= '<creator>'.$f2->id3['artist'].'</creator>'.$this->crlf;class kpxspf
{
// helper tool for flash
function xml_top()
{
$this->crlf = "\r\n";
$this->data = '<?xml version="1.0" encoding="';
if (UTF8MODE) $this->data .= 'UTF-8'; else $this->data .= 'ISO-8859-1';
$this->data .= '"?>'.$this->crlf;
$this->data .= '<playlist version="1" xmlns="http://xspf.org/ns/0/">'.$this->crlf;
$this->data .= '<trackList>'.$this->crlf;
}
function genxmlfile($uid)
{
$this->xml_top();
$result = db_execquery('SELECT sid FROM '.TBL_TEMPLIST.' WHERE uid = '.$uid.' ORDER BY rid ASC');
while ($row = mysql_fetch_row($result)) $this->xml_link($row[0]);
$this->data .= '</trackList>'.$this->crlf.'</playlist>';
header('Content-Disposition: attachment; filename=kp'.lzero(getrand(1,999999),6).'.xml');
header('Content-Type: text/xml');
header('Content-Length: '.strlen($this->data));
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
echo $this->data;
}
function write($sids)
{
global $u_id;
db_execquery('DELETE FROM '.TBL_TEMPLIST.' WHERE uid = '.$u_id);
for($i=0,$c=count($sids);$i<$c;$i++) db_execquery('INSERT INTO '.TBL_TEMPLIST.' SET uid = '.$u_id.', sid = '.$sids[$i]);
}
function xml_link($sid)
{
$f2 = new file2($sid, true);
if ($f2->ifexists())
{
$fd = new filedesc($f2->fname);
if ($fd->found && $fd->m3u)
{
$url = httpstreamheader3($fd->fid, $sid, $f2);
if (!empty($url))
{
$this->data .= '<track>'.$this->crlf;
$this->data .= '<title>'.$f2->gentitle(array('title')).'</title>'.$this->crlf;
$this->data .= '<creator>'.$f2->id3['artist'].'</creator>'.$this->crlf;
$kpi = new kpimage(false, $f2->drive, $f2->relativepath);
if ($kpi->find())
{
$kpi->resize();
$imgurl = $kpi->geturl(true);
} else $imgurl = '';
$this->data .= '<image>'.$imgurl.'</image>'.$this->crlf;
$this->data .= '<location>'.$url.'</location>'.$this->crlf;
$this->data .= '</track>'.$this->crlf;
}
}
}
}
function flashhtml()
{
global $setctl, $phpenv, $u_cookieid, $u_id, $cfg;
kprintheader('', 0, 0);
$playlist = $setctl->get('streamurl').$phpenv['streamlocation'];
$playlist .= '?templist='.$u_id.'&c='.$u_cookieid.'&file='.lzero(getrand(1,999999),6).'.xml';
$link = $cfg['xspf_url'].'?file='.urlencode($playlist);
?>
<head>
<script type="text/javascript" src="swfobject.js"></script>
</head>
<p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
<script type="text/javascript">
var s1 = new SWFObject('<?php echo $link; ?>','mpl','300','500','7');
s1.addParam('allowscriptaccess','always');
s1.addParam('allowfullscreen','true');
s1.addVariable('height','500');
s1.addVariable('width','300');
s1.addVariable('logo','pic.png');
s1.addVariable('displayheight','300');
s1.addVariable('autostart','true');
s1.addVariable('repeat','list');
s1.addVariable('shuffle','false');
s1.addVariable("backcolor","0x9e9e9e");
s1.addVariable("frontcolor","0x333333");
s1.addVariable("lightcolor","0x555555");
s1.write('player1');
</script>
<?php
kprintend();
}
}
zaqarov wrote:Kirax2,
You should add this:
- Code: Select all
$kpi = new kpimage(false, $f2->drive, $f2->relativepath);
if ($kpi->find())
{
$kpi->resize();
$imgurl = $kpi->geturl(true);
} else $imgurl = '';
$this->data .= '<image>'.$imgurl.'</image>'.$this->crlf;
below(line 3 of your last code snippet - apr 9)
- Code: Select all
$this->data .= '<creator>'.$f2->id3['artist'].'</creator>'.$this->crlf;