Re: adding items to already running ASX file

From: Neil Smith [MVP Digital Media] (neil_at_nospam.com)
Date: 12/06/04


Date: Mon, 06 Dec 2004 17:50:41 GMT

Yeah I looked at the MSN and lamely, they're using Script.Encode to
hide their scripts, I guess that's where you ran into a roadblock ;-)

I had some problems with this. I checked the MSN site and it does work
with WMP7 so we need to replicate that. The problem is that WMP7
doesn't support the newMedia(URL) required to create a media item
without first playing it. It's a WMP9-only method.

With WMP9, you'd create a new media object and then use

newMediaItem=WMP9.newMedia(URL);
WMP9.currentPlaylist.appendItem(newMediaItem);

Luckily I got a workaround once the lightbulb came on over my head.

Here's the trick : You embed 2 copies of the media player, one visible
and one hidden :

<object id="MediaPlayerA"
classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6"
type="application/x-oleobject" width="320" height="304">
        <param name="autostart" value="true" />
        <param name="uimode" value="full" />
        <param name="url"
value="http://path/to/your/base_playlist.asx" />
</object>

<object id="MediaPlayerB"
classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6"
type="application/x-oleobject" width="0" height="0">
        <param name="autostart" value="false" />
        <param name="uimode" value="invisible" />
</object>

Now, you have 2 separate object references to work with. You can then
do the following :

WMPA=document.getElementById("MediaPlayerA");
WMPB=document.getElementById("MediaPlayerB");

WMPB.URL="file://F:\audio\oric\centi11km8.wav";
WMPA.currentPlaylist.appendItem(WMPB.currentMedia);

Since the WMPB (hidden) player is set to not autostart, it can load
the media asynchronously. You can then script the load event and fire
your function to add the media item when it becomes available (and
thus, add the full metadata about the item to your playlist).

That should work out for you
Cheers - Neil

On Sun, 05 Dec 2004 00:31:16 GMT, alphasquared
<no-spam-speedkills20@yahoo.com> wrote:

>Right now I'm dynamically creating an ASX file based on user input and
>embedding it into IE. I'm also showing thumbnails of other videos that I
>want the user to be able to watch. I want to append those videos to the
>playlist.
>
>So how do I add items to an ASX file that is already loaded in WMP? Kind of
>like video.msn.com is doing with their add to playlist.
>
>Thanks.



Relevant Pages

  • Re: Lag on Xbox360 MCX (Barb, do you see this too?)
    ... where the library as shown in the Media Center ... videos and pictures. ... "Barb Bowman" wrote: ... With MCE ...
    (microsoft.public.windows.mediacenter)
  • Re: Unbelieveable
    ... TV media won't show the videos anymore because they don't want ... And if the WTC videos were showing repeatedly, ... accusing the liberal media of trying to demoralize the country. ... war in iraq is another thing altogether... ...
    (rec.sport.football.college)
  • Re: Unbelieveable
    ... seems to have blinded you to the fact that the MS TV media don't ... And if the WTC videos were showing repeatedly, ... accusing the liberal media of trying to demoralize the country. ... war in iraq is another thing altogether... ...
    (rec.sport.football.college)
  • Highly confused newbie trying to sort out streaming video !!
    ... encoded by windows media encoder. ... IIS internet services that came with Win server 2003. ... >the videos are available to anyone who visits the site, ...
    (microsoft.public.windowsmedia.server)
  • Re: Unbelieveable
    ... TV media won't show the videos anymore because they don't want ... as victims of terrorist attacks is verbotten. ... And if the WTC videos were showing repeatedly, ... in iraq is another thing altogether... ...
    (rec.sport.football.college)