Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WMV in layer does not play . . .

Status
Not open for further replies.

harlekeyn

Programmer
Mar 10, 2002
13
CA
This could be a difficult one.

Howcome the following embedded WMV
loads, but does not play?


Tristan Laurillard
harlekeyn@gmx.net



=========================================

Code:
<html>
<head>


<SCRIPT language=&quot;Javascript&quot;>


// This function (monitor) is what I use all the time 
// to create and change layers. Very handy, use it on
// every site in my file &quot;monitor.js&quot;



///////////////// start what is normally stored in &quot;monitor.js&quot; /////////////////

// monitor.js version 2001.12.16
//
// description:
// creates a dynamic layer for both MSIE and NN
// and includes a few more handy functions:
//
// ===================================
// > > > > > EXAMPLE < < < < < < <
// 
// in body: monitor(&quot;mymonitor&quot;,25,200,150,150);
// if you want the layer to be placed relative to the HTML-
BODY
// or
// in body: monitor(&quot;mymonitor&quot;,25,200,150,150,'glued');
// if you want the layer to be placed relative to the WINDOW
//
//                       ---to change its contents--- 
//                       changemymonitor(&quot;hello&quot;);
//
//                       ---to move the layer--
//                       movemymonitor(40,40);
//
//                       ---to place the layer to a certain 
point---
//                       placemymonitor(125,350);
//
//                       ---to load next.html in the layer--
- [currently only MSIE]
//                       loadpageinmymonitor
(&quot;next.html&quot;,&quot;scrolling=yes&quot;);     or
//                       loadpageinmymonitor
(&quot;next.html&quot;,&quot;scrolling=no&quot;);     or
//                       loadpageinmymonitor
(&quot;next.html&quot;,&quot;scrolling=auto&quot;);
//
// ===================================
//
// this javascript is to be improved
// to receive a new version when updated, or
// to suggest changes, mail to harlekeyn@gmx.net
//
// Tristan Laurillard
// [URL unfurl="true"]www.laurillard.8m.com[/URL]

function monitor(name,left,top,width,height,layerglue)
{
var centerwidth = 800; 
var centerheight = 600;

if (document.all) 
	{
	centerwidth = ((document.body.clientWidth)/2); 
	centerheight = ((document.body.clientHeight)/2);
	}

if (document.layers) 
	{
	centerwidth = ((window.innerWidth)/2); 
	centerheight = ((window.innerHeight)/2);
	}


if ((left == 'center')) left=centerwidth; 
if ((top == 'center')) top=centerheight;

document.write(&quot;<style>#&quot; + name + &quot;2 \{POSITION:absolute; 
VISIBILITY:visible; TOP:&quot; + top + &quot;px; LEFT:&quot; + left + &quot;px; 
Z-INDEX:2; WIDTH:&quot; + width + &quot;; HEIGHT:&quot; + height + &quot;\} 
<\/style>&quot;);
document.write(&quot;<DIV ID='&quot; + name + &quot;2'><table border=0 
cellpadding=0 cellspacing=0><tr><td height=&quot; + height + &quot; 
width=&quot; + width + &quot; ID='cel&quot; + name 
+ &quot;'></td></tr></table></DIV>&quot;);
document.write(&quot;<LAYER ID='&quot; + name + &quot;' top=&quot; + top + &quot; 
left=&quot; + left + &quot; width=&quot; + width + &quot; height=&quot; + height 
+ &quot;></layer>&quot;);
document.write(&quot;<script language=\&quot;Javascript\&quot;>&quot;);
document.write(&quot;function change&quot; + name + &quot;(text){if 
(document.layers) {	document.&quot; + name + &quot;.document.write
(text); document.&quot; + name + &quot;.document.close();} else if 
(document.all) {cel&quot; + name + &quot;.innerHTML=text;}}&quot;);
document.write(&quot;function move&quot; + name + &quot;(x,y) {if 
(document.all) {&quot; + name + &quot;2.style.pixelLeft += x; &quot; + 
name + &quot;2.style.pixelTop += y; }    else if 
(document.layers) { document.layers.&quot; + name + &quot;.left = 
((document.layers.&quot; + name + &quot;.left) + (x)) ; 
document.layers.&quot; + name + &quot;.top = ((document.layers.&quot; + 
name + &quot;.top) + (y)) ; }}&quot;);

	if (layerglue == &quot;glued&quot;)
	document.write(&quot;function place&quot; + name + &quot;(x,y) {if 
(document.all) {&quot; + name + &quot;2.style.left = (x + 
document.body.scrollLeft); &quot; + name + &quot;2.style.top = (y + 
document.body.scrollTop); }    else if (document.layers) { 
document.layers.&quot; + name + &quot;.left = x ; document.layers.&quot; + 
name + &quot;.top = y ; }}&quot;)

	else
	document.write(&quot;function place&quot; + name + &quot;(x,y) {if 
(document.all) {&quot; + name + &quot;2.style.pixelLeft = x; &quot; + name 
+ &quot;2.style.pixelTop = y; }    else if (document.layers) { 
document.layers.&quot; + name + &quot;.left = x ; document.layers.&quot; + 
name + &quot;.top = y ; }}&quot;);

	if (document.all)
	document.write(&quot;function loadpagein&quot; + name 
+ &quot;(url,scrolloption) {change&quot; + name + &quot;('<iframe ' + 
scrolloption + ' frameborder=0 height=100% width=100% src=' 
+ url + '></iframe>');}&quot;);

	if (document.layers)
	document.write(&quot;function loadpagein&quot; + name 
+ &quot;(url,scrolloption) {change&quot; + name 
+ &quot;('<center>+++<br>Script doesn\\'t work in 
Netscape.<br>This<a href=' + url + '> page</a> won\\'t load 
inside this layer.<br>+++</center>');}&quot;);

document.write(&quot;var &quot; + name + &quot;status = 'loaded';&quot;);
document.write(&quot;<\/script>&quot;);

}

///////////////// end what is normally stored 
in &quot;monitor.js&quot; /////////////////

var testcontents =
'<table width=150><tr><td bgcolor=#AAAAAA>Hello, this is a 
layer</td></tr></table>' ;


var introductie_video =

&quot;<OBJECT ID=itmeintro WIDTH=436 HEIGHT=320 
CLASSID='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' 
CODEBASE='[URL unfurl="true"]http://www.microsoft.com/ntserver/netshow/download[/URL]
/en/nsmp2inf.cab#Version=5,1,51,415' standby='Loading 
Microsoft Media Player components...' type='application/x-
oleobject'>\n&quot; +
&quot;<PARAM NAME=AutoStart VALUE=true>\n&quot; +
&quot;<PARAM NAME=FileName VALUE='[URL unfurl="true"]http://www.itme.nl/www.itme.nl/flash/itme-[/URL]
intro.wmv'>\n&quot; +
&quot;<PARAM NAME=ControlType VALUE=1>\n&quot; +
&quot;<param name='showcontrols' value='1'>\n&quot; +
&quot;<EMBED Type=video/x-ms-asf-plugin 
pluginspage='[URL unfurl="true"]http://www.microsoft.com/windows/mediaplayer/do[/URL]
wnload/default.asp' src='0' name='nsplay' AutoStart=1 
ShowControls=1 width=436 height=320>\n&quot; +
&quot;</embed>\n&quot; +
&quot;</OBJECT>\n&quot; ;

</SCRIPT>

</head>
<body>

<SCRIPT language=&quot;Javascript&quot;>
monitor('mp',100,100,1,1);
</SCRIPT>

<a href=&quot;Javascript:changemp(testcontents)&quot;>test 1</a><br>
<a href=&quot;Javascript:changemp(introductie_video)&quot;>test 2</a><br>

</body>

</html>
 
Some days later:

I fixed the problem now.
Here's the solution:

1) load the wmv-player in the layer, with filename = &quot;&quot;
2) then change its src by using
document.itmeintro.filename = &quot;myvideo.wmv&quot;;
-- where 'itmeintro' is whatever you ID you gave it --

I did not try it in Netscape yet, but
we are boycotting them, are we not?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top