troubleshoot PlayStateChange
WMPTalk.com Forum Index WMPTalk.com
Discuss Windows Media Player
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web wmptalk.com
troubleshoot PlayStateChange

 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> Windows Media on Web
Author Message
raciere
Guest





Posted: Wed Jun 09, 2004 10:03 am    Post subject: troubleshoot PlayStateChange Reply with quote

at http://www.untamed.be/2/video_corbis.shtml (my new business site,
still in progress).

hit view source at the bottom of the custom player... you can see
that i've put together a variety of code samples to:

- create custom player/buttons
- overlay an image on top of the media player so no black blank screen
- display the media name, playstate, and status.

the issue i have is w. the image overlay code. i've used a quick code
sample from neil (searching the archives) and if i place this code:

<script language="javascript" for="Player"
event="PlayStateChange(currentState)">
if (currentState==3) {
showHide(this);
}
</script>

at the end of the html code, then when i click on play the overlay
image disappears and the video plays fine. however, the media name
and the playstate do NOT work... although the status displays just
fine.

if i place that same code higher up in the html page, say just after
the <object...> tag... then the media name, playstate, and status all
display fine... but the overlay image does NOT disappear and you
cannot see the video.

what am i doing wrong?

Back to top
Neil Smith [MVP Digital M
Guest





Posted: Thu Jun 10, 2004 12:43 am    Post subject: Re: troubleshoot PlayStateChange Reply with quote

Nice job. Probably, in your script for="player" blocks you want to add
an event handler for each different type of event you want to trap. As
it is, there are about 4 script for="player" cblocks of code. It's
likely that one or all of them are in intercepting events (which in IE
are bubbling up) for the player.

Since only one has an actual event handler, and it's the last one in
the page, it wil never get the events passed to it, as a less specific
event handler will grab it first.

You need to combine the script blocks (and find out the
event.srcElement.id) , or you should add event handlers to each script
block to tell the player which should be used for play/pause,
playStateChange and so on.

HTH
Neil

On 8 Jun 2004 23:03:45 -0700, sky@untamed.be (raciere) wrote:

Quote:
at http://www.untamed.be/2/video_corbis.shtml (my new business site,
still in progress).

hit view source at the bottom of the custom player... you can see
that i've put together a variety of code samples to:

- create custom player/buttons
- overlay an image on top of the media player so no black blank screen
- display the media name, playstate, and status.

the issue i have is w. the image overlay code. i've used a quick code
sample from neil (searching the archives) and if i place this code:

script language="javascript" for="Player"
event="PlayStateChange(currentState)"
if (currentState==3) {
showHide(this);
}
/script

at the end of the html code, then when i click on play the overlay
image disappears and the video plays fine. however, the media name
and the playstate do NOT work... although the status displays just
fine.

if i place that same code higher up in the html page, say just after
the <object...> tag... then the media name, playstate, and status all
display fine... but the overlay image does NOT disappear and you
cannot see the video.

what am i doing wrong?
Back to top
raciere
Guest





Posted: Thu Jun 10, 2004 11:03 pm    Post subject: Re: troubleshoot PlayStateChange Reply with quote

alas, i am a javascript hack, and implementing your recommends are
unfortunately beyond me! i'll keep hacking away and see what
happens..... or may just not use the medianame and playstate
altogether....

"Neil Smith [MVP Digital Media]" <neil@nospam.com> wrote in message news:<betec0t205d2rj6trht1kg4lpa55jit4si@4ax.com>...
Quote:
Nice job. Probably, in your script for="player" blocks you want to add
an event handler for each different type of event you want to trap. As
it is, there are about 4 script for="player" cblocks of code. It's
likely that one or all of them are in intercepting events (which in IE
are bubbling up) for the player.

Since only one has an actual event handler, and it's the last one in
the page, it wil never get the events passed to it, as a less specific
event handler will grab it first.

You need to combine the script blocks (and find out the
event.srcElement.id) , or you should add event handlers to each script
block to tell the player which should be used for play/pause,
playStateChange and so on.

HTH
Neil

On 8 Jun 2004 23:03:45 -0700, sky@untamed.be (raciere) wrote:

at http://www.untamed.be/2/video_corbis.shtml (my new business site,
still in progress).

hit view source at the bottom of the custom player... you can see
that i've put together a variety of code samples to:

- create custom player/buttons
- overlay an image on top of the media player so no black blank screen
- display the media name, playstate, and status.

the issue i have is w. the image overlay code. i've used a quick code
sample from neil (searching the archives) and if i place this code:

script language="javascript" for="Player"
event="PlayStateChange(currentState)"
if (currentState==3) {
showHide(this);
}
/script

at the end of the html code, then when i click on play the overlay
image disappears and the video plays fine. however, the media name
and the playstate do NOT work... although the status displays just
fine.

if i place that same code higher up in the html page, say just after
the <object...> tag... then the media name, playstate, and status all
display fine... but the overlay image does NOT disappear and you
cannot see the video.

what am i doing wrong?


Back to top
 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> Windows Media on Web All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Microsoft Office Forum New Topics
Powered by phpBB