Re: Show first frame of movie

Tech-Archive recommends: Fix windows errors by optimizing your registry



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
.



Relevant Pages

  • Re: WMP 11 problem with streaming video on Vista
    ... See http://zachd.com/pss/pss.html for some helpful WMP info. ... explorer and firefox to play streaming video (only allowing 100% image not ... software to play through external player VLC player it shows the video. ...
    (microsoft.public.windowsmedia.player)
  • Re: Choppy video/audio
    ... How much do you currently pay for AOL dial-up? ... who offers broadband for video streaming, ... As long as I have WIN Media Player can I uninstall Real Player w/o ... Even if you are successful in rolling back from Adobe Flash 10 to ...
    (microsoft.public.windowsxp.help_and_support)
  • =?ISO-2022-JP?B?d3d3LmVsZWN0cm9uaWNzLW1hYy1zb255LmNvbSBTYW1zdW5nIFlQLVAySkFCIFAyIFdpZA==?= =
    ... Slim and robust 4 GB multimedia player with digital FM radio ... Built-in Bluetooth 2.0: ... MP3, WMA, Subscription WMA ... Video maximum resolution: 480x272 or 320x240 ...
    (rec.music.christian)
  • Re: WMP 11 problem with streaming video on Vista
    ... I am also facing same problem, It's seem that problem happend with vista ... decode and codec but not useful. ... window (toolbar player) there seems no requirement for the graphics ... typically overlays and/or directX video ...
    (microsoft.public.windowsmedia.player)
  • Re: WMP 11 problem with streaming video on Vista
    ... My chipset driver is version 7.14.10.1350 ... software to play through external player VLC player it shows the video. ... See http://zachd.com/pss/pss.html for some helpful WMP info. ...
    (microsoft.public.windowsmedia.player)