Re: Show first frame of movie
- From: "Neil Smith [MVP Digital Media]" <neil@xxxxxxxxxx>
- Date: Tue, 30 May 2006 19:58:35 GMT
On Tue, 30 May 2006 12:20:57 +0200, Daniel Kirsch
<Iwillnotread_daniel@xxxxxx> wrote:
Neil Smith [MVP Digital Media] wrote:
It's not terribly precise either - your best option is to take a JPEG
of whichever non-black frame your video has, and display that in the
player area, then hiding the image and showing the player once your
playstate changes to playing.
I've now used attachEvent to add a playStateChange handler. However I
cannot find a way to reference the control from within the event
handler. When using the solution I've posted before, I'm creating a
closure which doesn't seem to be released from IE causing the video to
play even when I deleted the element and set all references to null.
Any chance to reference the video from within the event handler without
using closures? (There could be multiple videos on the page).
Sure, closures are a serious bug in IE.
There's usually no need to encounter that though.
I'd just reference the player object by ID, i.e.
<head>
<script language="javascript1.2">
var myWMPlayer=new Object();
function setPlayerObject(playerHTMLElementId) {
myWMPlayer = document.getElementById(playerHTMLElementId);
}
</script>
</head>
<body onload="setPlayerObject('video_player')">
In this case the player object ID is known at design time (i.e. when
you create the page). If for some reason it's not known, set it from
your event handler once, i.e.
if (myWMPlayer == null) {
setPlayerObject(event.srcElement.id);
}
Either of those ways, your player object is available in a globally
scoped object, without having to keep looking it up (which takes a few
resources), so can use it within your event handler code as well as
elsewhere as required (eg in onclick handlers to stop/start/pause)
HTH
Cheers - Neil
------------------------------------------------
Digital Media MVP : 2004-2006
http://mvp.support.microsoft.com/mvpfaqs
.
- Follow-Ups:
- Re: Show first frame of movie
- From: Daniel Kirsch
- Re: Show first frame of movie
- References:
- Show first frame of movie
- From: Daniel Kirsch
- Re: Show first frame of movie
- From: Neil Smith [MVP Digital Media]
- Re: Show first frame of movie
- From: Daniel Kirsch
- Show first frame of movie
- Prev by Date: Re: Full Screen problem on Mosaic
- Next by Date: Re: Playback - Chipmunk - Update Driver - DirectX - No Help
- Previous by thread: Re: Show first frame of movie
- Next by thread: Re: Show first frame of movie
- Index(es):
Relevant Pages
|