Ejemplo n.º 1
0
/**
 * Actually displays this embedded player
 * 
 * @author Ross Carlson
 * @version 3/03/05
 * @since 3/03/05
 * @param $list an array containing the tracks to be played
 */
function SERVICE_DISPLAY_PLAYER_xspf($width, $height)
{
    global $root_dir, $this_site, $css;
    ?>

		 <?php 
    if (!isset($_SERVER['HTTP_REFERER']) || false === strpos($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME']) && false === strpos($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_ADDR'])) {
        // the popup is not resizable.
        $d = new jzDisplay();
        $d->displayJavascript();
        ?>
		       <script type="text/javascript">
			 win=openMediaPlayer(window.location, 300, 150);
		       if (win) {
			 //self.close();

		       } else {
			 // popup fail
			 this.href=window.location;
			 document.write('<a href="#" <?php 
        echo SERVICE_RETURN_PLAYER_HREF_xspf();
        ?>
>Click here to open media player.</a>');
		       }
			 </script>
		       <?php 
        exit;
    }
    ?>
		<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT"><!--\
		   if (window.name == 'embeddedPlayer' && window.innerWidth != <?php 
    echo $width;
    ?>
) {
		  window.resizeTo(<?php 
    echo $width;
    ?>
,<?php 
    echo $height;
    ?>
)
		}
		
		-->
		</SCRIPT>




		<?php 
    // Let's setup the page
    echo '<title>Jinzora XSPF Media Player</title>';
    echo '<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" bgcolor="#000000">';
    $playlist = $this_site . $root_dir . "/temp/playlist.xspf?" . time();
    $height = $height - 45;
    ?>
		<object 
			classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 
			codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" 
			width="440" 
			height="<?php 
    echo $height;
    ?>
" 
			id="xspf_player" 
			align="middle">
			<param name="allowScriptAccess" value="sameDomain" />
			<param name="movie" value="<?php 
    echo $this_site . $root_dir;
    ?>
/services/services/players/xspf_player.swf?autoplay=true&autoload=true&playlist_url=<?php 
    echo $this_site . $root_dir;
    ?>
/temp/playlist.xspf" />
			<param name="quality" value="high" />
			<param name="bgcolor" value="#e6e6e6" />
			<embed src="<?php 
    echo $this_site . $root_dir;
    ?>
/services/services/players/xspf_player.swf?autoplay=true&autoload=true&playlist_url=<?php 
    echo $this_site . $root_dir;
    ?>
/temp/playlist.xspf" 
				quality="high" 
				bgcolor="#e6e6e6" 
				width="440" 
				height="<?php 
    echo $height;
    ?>
" 
				name="xspf_player" 
				align="middle" 
				allowScriptAccess="sameDomain" 
				type="application/x-shockwave-flash" 
				pluginspage="http://www.macromedia.com/go/getflashplayer" />
		</object>

		<?php 
    exit;
}