Embedded WMP stops playing

G

gsauns

I have a Windows Media Player control embedded in my page. This is the
code I use to get it to play:

function setPlayerURL()
{
player = document.getElementById("wmpWindow");
myURL =
document.getElementById("pathStore").getAttribute("value");
player.URL = myURL;
alert(player.URL);
}


I used the alert to debug. I could not get it to work at all, until I
realized that the control DOES play the video WHILE the alert is open.
As soon as you click OK on the alert, the video stops and cannot be
played again.
I used another function to determine what the URL of the player is at
the moment that you click another button. That alert comes up blank.
This is my code for the player:

<object id="wmpWindow" width="400" height="300"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject" >
<param name="uiMode" value="full" />
<param name="AutoStart" value="true" />
</object>

It seems like after the Javascript function finishes, the page
refreshes and set the URL to "".
Why is this happening?
 
B

bruce barker

most likely you tied the javascript to a control that posts back.

-- bruce (sqlwork.com)
 
G

gsauns

So I needed it to a control that doesn't post back... I changed my
button to an HTML control instead of an ASP control, and that fixed
it. Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top