Ejemplo n.º 1
0
 function xml_link($sid, $encode = false)
 {
     $f2 = new file2($sid, true);
     if ($f2->ifexists()) {
         $fd = new filedesc($f2->fname);
         if ($fd->found && $fd->m3u) {
             $url = httpstreamheader3($fd->fid, $sid, $f2, UTF8MODE);
             if (strlen($url) > 0) {
                 $id3 = $f2->getid3();
                 $title = '';
                 if (is_numeric($id3['track']) && $id3['track'] > 0) {
                     $title .= lzero($id3['track']) . '. ';
                 }
                 $title .= $f2->gentitle(array('title'));
                 $imgurl = '';
                 $ci = new coverinterface();
                 $ci->setartist($f2->id3['artist'], $f2->id3['album']);
                 $ci->setlocation($f2->drive, $f2->relativepath);
                 if ($ci->coverexists()) {
                     $ci->geturl($imgurl, true, true);
                 }
                 $this->items[] = array($imgurl, $url, $title, $fd->extension, $id3['length']);
             }
         }
     }
 }
Ejemplo n.º 2
0
    function flashhtml_enqueue()
    {
        global $setctl, $phpenv, $u_cookieid, $u_id, $cfg;
        kprintheader('', 0, 0, 'createPlayer();');
        $playlist = $setctl->get('streamurl') . $phpenv['streamlocation'];
        $playlist .= '?templist=' . $u_id . '&c=' . $u_cookieid . '&file=' . lzero(getrand(1, 999999), 6) . '.xml';
        $playlist = urlencode($playlist);
        $width = $cfg['jw_window_x'] - 20;
        $height = $cfg['jw_window_y'] - 20;
        $imgheight = round($height / 2);
        $link = $cfg['jw_urls']['swf'];
        ?>
		<script type="text/javascript" src="<?php 
        echo $cfg['jw_urls']['js'];
        ?>
"></script>
		<script type="text/javascript">
		<!--
	
		var xmlhttp;
		var xmlDoc;

		function loadXMLDoc(theFile) 
		{
			xmlhttp=null;
			if (window.XMLHttpRequest) 
			{
				xmlhttp = new XMLHttpRequest(); 
			} else 
			if (window.ActiveXObject) 
			{ 
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
			}

			if (xmlhttp != null)
			{
				xmlhttp.onreadystatechange = loaded;
				xmlhttp.open("GET",theFile,true);
				xmlhttp.send(null);
			} 
			else 
			{
				alert('Sorry, your browser can\'t handle this script'); 
				return;
			}
		}

		function checkReadyState(obj) 
		{
			if(obj.readyState == 4) 
			{
				if(obj.status == 200) 
				{ 
					return true; 
				} else 
				{ 
					alert("Problem retrieving XML data"); 
				}
			}
		}

		function loaded() 
		{	
			if(checkReadyState(xmlhttp)) 
			{
				xmlDoc=xmlhttp.responseXML.documentElement;
				showTags('track');
			}
		}

		function showTags(theTag) 
		{
			function getTag(tag) 
			{
				var tmp='';
				xx=x[i].getElementsByTagName(tag);
				try 
				{ 
					tmp=xx[0].firstChild.data; 
				}
				catch(er) 
				{ 
					tmp=''; 
				}
				return(tmp);
			}

			var xx; var x; var txt;
			x = xmlDoc.getElementsByTagName(theTag);
			for (i=0; i<x.length; i++) 
			{
				addItem('mpl',{file: decodeURIComponent(getTag("location")), image: decodeURIComponent(getTag("image")), title: getTag("title"), author: getTag("creator")});
			}
		}

		function createPlayer() 
		{
			var s1 = new SWFObject('<?php 
        echo $link;
        ?>
','mpl','<?php 
        echo $width;
        ?>
','<?php 
        echo $height;
        ?>
','8');
			s1.addParam("allowfullscreen", "true");
			s1.addParam('allowscriptaccess','always');			
			s1.addVariable('height',<?php 
        echo $height;
        ?>
);
			s1.addVariable('width',<?php 
        echo $width;
        ?>
);
			s1.addVariable('displayheight',<?php 
        echo $imgheight;
        ?>
);			
			s1.addVariable("enablejs", "true");
			s1.addVariable("javascriptid", "kPlayer");
			s1.addVariable('searchbar','false');
			s1.addVariable('autostart','true');
			s1.addVariable('repeat','list');
			s1.addVariable('shuffle','false');
			s1.addVariable('file','<?php 
        echo $playlist;
        ?>
');
			s1.write('player1');
		}

		function thisMovie(swf) 
		{
			if(navigator.appName.indexOf("Microsoft") != -1)
			{
				return window[swf];
			} 
			else 
			{
				return document[swf];
			}
		}

		function loadFile(swf,obj) 
		{ 
			thisMovie(swf).loadFile(obj); 
		}
			
		function addItem(swf, obj, idx)
		{
			thisMovie(swf).addItem(obj, idx);
		}
		
		-->
		</script>

		<p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</p>

		<?php 
        kprintend();
    }