Re: adding items to already running ASX file
From: Neil Smith [MVP Digital Media] (neil_at_nospam.com)
Date: 12/06/04
- Next message: OrlandoBeau: "WMP10 Won't Play MPG's From Web Links"
- Previous message: Backerman: "Streaming mpeg files cause Quicktime Viewer to run in IE6"
- In reply to: alphasquared: "adding items to already running ASX file"
- Next in thread: alphasquared: "Re: adding items to already running ASX file"
- Reply: alphasquared: "Re: adding items to already running ASX file"
- Messages sorted by: [ date ] [ thread ]
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.
- Next message: OrlandoBeau: "WMP10 Won't Play MPG's From Web Links"
- Previous message: Backerman: "Streaming mpeg files cause Quicktime Viewer to run in IE6"
- In reply to: alphasquared: "adding items to already running ASX file"
- Next in thread: alphasquared: "Re: adding items to already running ASX file"
- Reply: alphasquared: "Re: adding items to already running ASX file"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|