Hoi daar allemaal, Hier een vraagje voor de echte Crossbrowser JS designers. Ik heb een script gevonden die Mediaplayer met eigen buttons laat werken. Wat leuk is, Maar ik heb 3 vragen hierover.
1) Ik wil mijn eigen buttons kunnen gebruiken, Plaatjes dus.
2) Hoe kan deze Crossbrowser worden. (IE 6, NS 6, Opera 6.)
3) Is er ook een Forward & Rewind? Nu heb ik alleen nog maar Play, Pause & Stop.
Alle 3 de gevallen hebben mij problemen op geleverd en daarom kon ik nog geen StarFire Radio maken op mijn website. Wel jammer, want ik heb geen zin in zo'n over maats lelijk RealPlayer of mediaplayer script.
Script is hieronder.
Alvast Thanx...
===========================================================
<OBJECT ID="MediaPlayer1" width=0 height=0
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase=
"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft® Windows® Media Player components..."
type="application/x-oleobject">
<PARAM NAME="FileName" VALUE="http://mymusic.starvoice.com/stream1/DistantSoundz-TimeAfterTime.m3u">
<PARAM NAME="ShowControls" VALUE="0">
<EMBED type="application/x-mplayer2"
pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/"
SRC="http://mymusic.starvoice.com/stream1/DistantSoundz-TimeAfterTime.m3u"
name="MediaPlayer1"
width=0
height=0
ShowControls=0>
</EMBED>
</OBJECT>
<center>
[img]"http://www.starvoice.com/intro/pics/jamielynnsiglercover.jpg"><br> <FORM[/img]
<INPUT NAME="btnPlay" TYPE="Button" VALUE="Play" onclick="document.MediaPlayer1.Play();">
<INPUT NAME="btnPause" TYPE="Button" VALUE="Pause" onclick="document.MediaPlayer1.Pause();">
<INPUT NAME="btnStop" TYPE="Button" VALUE="Stop" onclick="document.MediaPlayer1.Stop();">
</FORM>
<SCRIPT LANGUAGE="JavaScript">
// Browser sniff -- the following code does a very simple browser check and rates the
// browser as either Internet Explorer on a Win32 platform or not, so that we
// know to use the ActiveX model, or the plug-in Model.
var sBrowser = navigator.userAgent;
if ((sBrowser.indexOf("IE") > -1) && (navigator.platform == "Win32"))
{
sBrowser = "IE";
} else {
sBrowser = "nonIE";
}
// end browser sniff
function showClick() // This function is called by the btnShowControls button.
// It sets the ShowControls property of Media Player to true.
{
if (sBrowser == "IE") {
document.MediaPlayer1.ShowControls = true;
} else {
document.MediaPlayer1.SetShowControls(true);
}
}
function hideClick() // This function is called by the btnHideControls button.
// It sets the ShowControls property of Media Player to false.
{
if (sBrowser == "IE") {
document.MediaPlayer1.ShowControls = false;
} else {
document.MediaPlayer1.SetShowControls(false);
}
}
function muteClick() // This function is called by the "Mute" button.
// It toggles the state of the Mute property of the Media Player.
{
var bMuteState;
if (sBrowser == "IE") {
bMuteState = document.MediaPlayer1.Mute;
} else {
bMuteState = document.MediaPlayer1.GetMute();
}
if (bMuteState == true) {
document.myButtons.btnMute.value="Mute";
if (sBrowser == "IE") {
document.MediaPlayer1.Mute = false;
} else {
document.MediaPlayer1.SetMute(false);
}
} else {
document.myButtons.btnMute.value="Un-Mute";
if (sBrowser == "IE") {
document.MediaPlayer1.Mute = true;
} else {
document.MediaPlayer1.SetMute(true);
}
}
}
</SCRIPT>
1) Ik wil mijn eigen buttons kunnen gebruiken, Plaatjes dus.
2) Hoe kan deze Crossbrowser worden. (IE 6, NS 6, Opera 6.)
3) Is er ook een Forward & Rewind? Nu heb ik alleen nog maar Play, Pause & Stop.
Alle 3 de gevallen hebben mij problemen op geleverd en daarom kon ik nog geen StarFire Radio maken op mijn website. Wel jammer, want ik heb geen zin in zo'n over maats lelijk RealPlayer of mediaplayer script.
Script is hieronder.
Alvast Thanx...
===========================================================
<OBJECT ID="MediaPlayer1" width=0 height=0
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase=
"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft® Windows® Media Player components..."
type="application/x-oleobject">
<PARAM NAME="FileName" VALUE="http://mymusic.starvoice.com/stream1/DistantSoundz-TimeAfterTime.m3u">
<PARAM NAME="ShowControls" VALUE="0">
<EMBED type="application/x-mplayer2"
pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/"
SRC="http://mymusic.starvoice.com/stream1/DistantSoundz-TimeAfterTime.m3u"
name="MediaPlayer1"
width=0
height=0
ShowControls=0>
</EMBED>
</OBJECT>
<center>
[img]"http://www.starvoice.com/intro/pics/jamielynnsiglercover.jpg"><br> <FORM[/img]
<INPUT NAME="btnPlay" TYPE="Button" VALUE="Play" onclick="document.MediaPlayer1.Play();">
<INPUT NAME="btnPause" TYPE="Button" VALUE="Pause" onclick="document.MediaPlayer1.Pause();">
<INPUT NAME="btnStop" TYPE="Button" VALUE="Stop" onclick="document.MediaPlayer1.Stop();">
</FORM>
<SCRIPT LANGUAGE="JavaScript">
// Browser sniff -- the following code does a very simple browser check and rates the
// browser as either Internet Explorer on a Win32 platform or not, so that we
// know to use the ActiveX model, or the plug-in Model.
var sBrowser = navigator.userAgent;
if ((sBrowser.indexOf("IE") > -1) && (navigator.platform == "Win32"))
{
sBrowser = "IE";
} else {
sBrowser = "nonIE";
}
// end browser sniff
function showClick() // This function is called by the btnShowControls button.
// It sets the ShowControls property of Media Player to true.
{
if (sBrowser == "IE") {
document.MediaPlayer1.ShowControls = true;
} else {
document.MediaPlayer1.SetShowControls(true);
}
}
function hideClick() // This function is called by the btnHideControls button.
// It sets the ShowControls property of Media Player to false.
{
if (sBrowser == "IE") {
document.MediaPlayer1.ShowControls = false;
} else {
document.MediaPlayer1.SetShowControls(false);
}
}
function muteClick() // This function is called by the "Mute" button.
// It toggles the state of the Mute property of the Media Player.
{
var bMuteState;
if (sBrowser == "IE") {
bMuteState = document.MediaPlayer1.Mute;
} else {
bMuteState = document.MediaPlayer1.GetMute();
}
if (bMuteState == true) {
document.myButtons.btnMute.value="Mute";
if (sBrowser == "IE") {
document.MediaPlayer1.Mute = false;
} else {
document.MediaPlayer1.SetMute(false);
}
} else {
document.myButtons.btnMute.value="Un-Mute";
if (sBrowser == "IE") {
document.MediaPlayer1.Mute = true;
} else {
document.MediaPlayer1.SetMute(true);
}
}
}
</SCRIPT>