Home > Archive > ASP .NET > April 2007 > Embedded WMP stops playing
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Embedded WMP stops playing
|
|
| gsauns 2007-04-27, 7:07 pm |
| 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?
| |
| bruce barker 2007-04-27, 7:07 pm |
| most likely you tied the javascript to a control that posts back.
-- bruce (sqlwork.com)
gsauns wrote:
> 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?
>
| |
| gsauns 2007-04-29, 7:06 pm |
| 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.
|
|
|
|
|