With the following code, a windows media player starts in an iframe. I couldn't get that work without corrupt the design of my website. I give up. Last night I thought and thought and .. now I have an idea in my head but I can't realize it by code. I'd like that the code opens a new very little window, just with a small media player in it. If then somebody want's to listen music, this window will open and it can minimized.
The player should work with Internet Explorer and Firefox. I tried with player check but in Firefox only the player opens but doesn't start.
Has someone energy to help? Payment could be by amazon (DVD or something like that). Thanks! :)
<?php
echo "<html>";
echo "<head>";
echo "<title>OST-Gallery</title>";
#echo "<link rel='stylesheet' href='themes/default/style.css'>";
echo "</head>";
echo "<body bgcolor='#000000' marginwidth='0' marginleft='0' topmargin='0' leftmargin='0' rightmargin='0' scroll='no'>";
echo "<div align='center'>";
echo "<table width='100%' height='92%' cellspacing='0' cellpading='0'>";
echo "<tr>";
echo "<td>";
echo "<iframe src='index.php' width='100%' height='100%' frameborder='0' scrolling='auto' name='myInlineFrame'>Your browser doesn't seem to support 'frames'</iframe>";
echo "</td>";
echo "</tr>";
echo "</table>";
## PLAYER CHECK
if (eregi('MSIE',$HTTP_USER_AGENT)) {
echo "<object id='mediaPlayer' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' align='center' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject' viewastext width='100%' height='67'>";
echo "<param name='loop' value='true'>";
echo "<param name='FileName' value='$radiostation'>";
echo "<param name='ShowStatusBar' value='true'>";
echo "<param name='animationatStart' value='false'>";
echo "<param name='transparentatStart' value='false'>";
echo "<param name='autoStart' value='true'>";
echo "<param name='showControls' value='true'>";
echo "<param name='volume' value='-200'>";
echo "</object>";
}
else {
echo "<embed type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' width='100%' height='70' enablecontextmenu='0' src='' ShowDisplay='0' showcontrols='1'>";
}
## PLAYER CHECK
#echo "<object classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' id='WMP1' Style='border-style: none; border-width: 0; margin: 0' width='100%' height='60'>";
#echo "<param name='URL' value='$radiostation'>";
#echo "<param name='AutoStart' value=false>";
#echo "<param name='AutoRewind' value=true>";
//<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" width="100%" height="9%" enablecontextmenu="0" src="http://radio.msn.com/asx/generate.aspx?type=genre&id=10002389" ShowDisplay="0" showcontrols="1"></embed>
echo "</div>";
echo "</body>";
echo "</html>";
?>
Sorry about the "messy" code. It's hand made ... I tried, deleted, tried again and at the end that was result. ;)
At the moment you can start the music here: http://www.orst.ch/copper/index.php. By choosing a radio station the player opens and it should the open in a new window ...
Thanks
hama
i can help you
fist add two function to script.js
function popup(url,target)
{
w = screen.width*(3/4);
h = screen.height*(3/4);
l = (screen.width-w)/2;
t = (screen.height-h)/2;
widthHeight = "width="+w+",height="+h+",left="+l+",top="+t+",menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,location=no";
window.open(url,target,widthHeight);
return true
}
function openurl(oForm)
{
s = oForm.url.value;
popup(s,'chatroom');
}
to open popup (just an expample of use):
<form method="POST" onsubmit="return openlink(this)">
<input name="url" type="text" value="link.php">
<input type="submit" class="button" value="Go">
</form>
to open an link.php as a popup window when submit form (link.php), you can modify it for your own use.
hama, you don't need to resort to a popup. I think I've found the problem with the scrollbar issue. Check your PM's :)
rphMedia solved the problem. Thanks! :)
--> http://www.orst.ch/copper/index.php
--> "Done" 8)