| Author |
Message |
Guest
|
Posted:
Wed Oct 12, 2005 4:30 pm Post subject:
xhtml and "embedding" of MediaPlayer file |
|
|
Hi,
I have been 'boxing' with the following problem for a couple of day
now.
<html>
<head>
<title>Embedding Windows Media Player</title>
<script language="javascript">
function swapImageWithFlash () {
alert("vahu");
var WMP7;
if ( navigator.appName != "Netscape" ){
WMP7 = new ActiveXObject('WMPlayer.OCX');
}
if (WMP7) {
var temp;
temp = '<OBJECT ID=MediaPlayer
CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA standby="Loading
Microsoft Windows Media Player components...\"
TYPE="application/x-oleobject" width="286" height="225">';
temp = temp + '<PARAM NAME="url" VALUE="URLToWmvMovie">';
temp = temp + '<PARAM NAME="AutoStart" VALUE="true">';
temp = temp + '<PARAM NAME="ShowControls" VALUE="1">';
temp = temp + '<PARAM NAME="uiMode" VALUE="mini">';
temp = temp + '</OBJECT>';
alert(temp);
document.getElementById("swapImage").innerHTML = temp;
}
else {
alert("44");
}
}
</script>
</head>
<body>
<div id="swapImage"><a href="#" onclick="swapImageWithFlash();">click
here </a></div>
</body>
</html>
In the above html I am trying to invoke the swapImageWithFlash
function, when the user click on the <a>-tag. Now the javascript
function is suppose to change the innerHTML of the div so that it plays
some wmv file (URLToWmvMovie is a URL to a valid wmv file). It just
doesn't play. Only a square with a red x in the top left corner
appears.
Is this possible at all ? The file plays fine if I do not try the
xhtml, meaning that if the mediaplayer object is inserted in normal
html.
Any help/hints will be greatly appreciated.
BR
Saya
|
|
| Back to top |
|
 |
Neil Smith [MVP Digital M
Guest
|
Posted:
Wed Oct 12, 2005 4:30 pm Post subject:
Re: xhtml and "embedding" of MediaPlayer file |
|
|
On 12 Oct 2005 07:29:49 -0700, vaqas.hussain@valtech.dk wrote:
[quote]Hi,
I have been 'boxing' with the following problem for a couple of day
now.
html
head
title>Embedding Windows Media Player</title
script language="javascript"
function swapImageWithFlash () {
alert("vahu");
var WMP7;
if ( navigator.appName != "Netscape" ){
WMP7 = new ActiveXObject('WMPlayer.OCX');
}
if (WMP7) {
var temp;
temp = '<OBJECT ID=MediaPlayer
CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA standby="Loading
Microsoft Windows Media Player components...\"
TYPE="application/x-oleobject" width="286" height="225">';
temp = temp + '<PARAM NAME="url" VALUE="URLToWmvMovie">';
temp = temp + '<PARAM NAME="AutoStart" VALUE="true">';
temp = temp + '<PARAM NAME="ShowControls" VALUE="1">';
temp = temp + '<PARAM NAME="uiMode" VALUE="mini">';
temp = temp + '</OBJECT>';
alert(temp);
document.getElementById("swapImage").innerHTML = temp;
}
else {
alert("44");
}
}
/script
/head
body
div id="swapImage"><a href="#" onclick="swapImageWithFlash();">click
here </a></div
/body
/html
In the above html I am trying to invoke the swapImageWithFlash
function, when the user click on the <a>-tag. Now the javascript
function is suppose to change the innerHTML of the div so that it plays
some wmv file (URLToWmvMovie is a URL to a valid wmv file). It just
doesn't play. Only a square with a red x in the top left corner
appears.
[/quote]
That's a broken ActiveX control icon. Why not try adding quotes to all
the attributes including the ClassID and object ID.
Next, note that you've escaped the closing quote on the standby=""
attribute, which makes the string unterminated. Remove the backslash.
Also note that the standby attribute was only relevant and used for
media player 6.4 and earlier, so you may as well pull it out
completely.
[quote]Is this possible at all ? The file plays fine if I do not try the
xhtml, meaning that if the mediaplayer object is inserted in normal
html.
[/quote]
Please leave XHTML out of this, as it's confusing you - there's no
XHTML here : You have no doctype declaration, nor any namespace on the
html tag
The javascript string you created is not XHTML either (in addition,
the ID attribute is not an XHTML id attribute, so it's in a different
- HTML4 - namespace, as are the PARAM elements, and XHTML requires a
type for any script language declarations, which should be inside
CDATA sections)
HTH
Cheers - Neil |
|
| Back to top |
|
 |
Guest
|
Posted:
Thu Oct 13, 2005 12:30 pm Post subject:
Re: xhtml and "embedding" of MediaPlayer file |
|
|
Hi Neil,
Sorry about the confusion. I did not mean XHTML but dynamic HTML
(DHTML), I suppose.
I have tried pulling out the standby attriute and "" the ID and classID
but I still get a broken activeX icon. Any ideas ?
BR
Saya
Neil Smith [MVP Digital Media] skrev:
| Quote: | On 12 Oct 2005 07:29:49 -0700, vaqas.hussain@valtech.dk wrote:
Hi,
I have been 'boxing' with the following problem for a couple of day
now.
html
head
title>Embedding Windows Media Player</title
script language="javascript"
function swapImageWithFlash () {
alert("vahu");
var WMP7;
if ( navigator.appName != "Netscape" ){
WMP7 = new ActiveXObject('WMPlayer.OCX');
}
if (WMP7) {
var temp;
temp = '<OBJECT ID=MediaPlayer
CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA standby="Loading
Microsoft Windows Media Player components...\"
TYPE="application/x-oleobject" width="286" height="225">';
temp = temp + '<PARAM NAME="url" VALUE="URLToWmvMovie">';
temp = temp + '<PARAM NAME="AutoStart" VALUE="true">';
temp = temp + '<PARAM NAME="ShowControls" VALUE="1">';
temp = temp + '<PARAM NAME="uiMode" VALUE="mini">';
temp = temp + '</OBJECT>';
alert(temp);
document.getElementById("swapImage").innerHTML = temp;
}
else {
alert("44");
}
}
/script
/head
body
div id="swapImage"><a href="#" onclick="swapImageWithFlash();">click
here </a></div
/body
/html
In the above html I am trying to invoke the swapImageWithFlash
function, when the user click on the <a>-tag. Now the javascript
function is suppose to change the innerHTML of the div so that it plays
some wmv file (URLToWmvMovie is a URL to a valid wmv file). It just
doesn't play. Only a square with a red x in the top left corner
appears.
That's a broken ActiveX control icon. Why not try adding quotes to all
the attributes including the ClassID and object ID.
Next, note that you've escaped the closing quote on the standby=""
attribute, which makes the string unterminated. Remove the backslash.
Also note that the standby attribute was only relevant and used for
media player 6.4 and earlier, so you may as well pull it out
completely.
Is this possible at all ? The file plays fine if I do not try the
xhtml, meaning that if the mediaplayer object is inserted in normal
html.
Please leave XHTML out of this, as it's confusing you - there's no
XHTML here : You have no doctype declaration, nor any namespace on the
html tag
The javascript string you created is not XHTML either (in addition,
the ID attribute is not an XHTML id attribute, so it's in a different
- HTML4 - namespace, as are the PARAM elements, and XHTML requires a
type for any script language declarations, which should be inside
CDATA sections)
HTH
Cheers - Neil |
|
|
| Back to top |
|
 |
Guest
|
Posted:
Thu Oct 13, 2005 12:30 pm Post subject:
Re: xhtml and "embedding" of MediaPlayer file |
|
|
Hi Neil,
Sorry about the confusion. I did not mean XHTML but dynamic HTML
(DHTML), I suppose.
I have tried pulling out the standby attriute and "" the ID and classID
but I still get a broken activeX icon. Any ideas ?
BR
Saya
Neil Smith [MVP Digital Media] skrev:
| Quote: | On 12 Oct 2005 07:29:49 -0700, vaqas.hussain@valtech.dk wrote:
Hi,
I have been 'boxing' with the following problem for a couple of day
now.
html
head
title>Embedding Windows Media Player</title
script language="javascript"
function swapImageWithFlash () {
alert("vahu");
var WMP7;
if ( navigator.appName != "Netscape" ){
WMP7 = new ActiveXObject('WMPlayer.OCX');
}
if (WMP7) {
var temp;
temp = '<OBJECT ID=MediaPlayer
CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA standby="Loading
Microsoft Windows Media Player components...\"
TYPE="application/x-oleobject" width="286" height="225">';
temp = temp + '<PARAM NAME="url" VALUE="URLToWmvMovie">';
temp = temp + '<PARAM NAME="AutoStart" VALUE="true">';
temp = temp + '<PARAM NAME="ShowControls" VALUE="1">';
temp = temp + '<PARAM NAME="uiMode" VALUE="mini">';
temp = temp + '</OBJECT>';
alert(temp);
document.getElementById("swapImage").innerHTML = temp;
}
else {
alert("44");
}
}
/script
/head
body
div id="swapImage"><a href="#" onclick="swapImageWithFlash();">click
here </a></div
/body
/html
In the above html I am trying to invoke the swapImageWithFlash
function, when the user click on the <a>-tag. Now the javascript
function is suppose to change the innerHTML of the div so that it plays
some wmv file (URLToWmvMovie is a URL to a valid wmv file). It just
doesn't play. Only a square with a red x in the top left corner
appears.
That's a broken ActiveX control icon. Why not try adding quotes to all
the attributes including the ClassID and object ID.
Next, note that you've escaped the closing quote on the standby=""
attribute, which makes the string unterminated. Remove the backslash.
Also note that the standby attribute was only relevant and used for
media player 6.4 and earlier, so you may as well pull it out
completely.
Is this possible at all ? The file plays fine if I do not try the
xhtml, meaning that if the mediaplayer object is inserted in normal
html.
Please leave XHTML out of this, as it's confusing you - there's no
XHTML here : You have no doctype declaration, nor any namespace on the
html tag
The javascript string you created is not XHTML either (in addition,
the ID attribute is not an XHTML id attribute, so it's in a different
- HTML4 - namespace, as are the PARAM elements, and XHTML requires a
type for any script language declarations, which should be inside
CDATA sections)
HTH
Cheers - Neil |
|
|
| Back to top |
|
 |
|
|
|
|