The Media Center Sandbox

Resources and discussion for developing experiences in the Windows Media Center platform.
Welcome to The Media Center Sandbox Sign in | Join | Help
in Search

Playlists

Last post 01-08-2007, 1:46 PM by johnwolf. 3 replies.
Sort Posts: Previous Next
  •  01-02-2007, 3:14 PM 1333

    Playlists

    A section in the MC SDK docs mentions that playlists in ASX or WPL format can be played in Media Center.

    I've tried to create a playlist file in ASX format with the following content:

    <?xml version="1.0" encoding="utf-8"?>
    <smil>
       <media id="v1" src="s:\Videos\Bear.wmv" />
       <media id="v2" src="s:\Videos\Butterfly.wmv" />
    </smil>

     I saved the file as 'c:\temp\playlist.asx'. How do I then get Media Center to play it? I tried:

    MediaCenterEnvironment.PlayMedia(Microsoft.MediaCenter.MediaType.Video, 
       @'c:\temp\playlist.asx',
    false);

    but this gave me an error saying it couldn't find the file. 's:' is a mapped drive with a copy of the sample videos on it. Has anyone had any luck playing playlists?

    Thanks for any pointers.

    Glenn.

  •  01-02-2007, 10:49 PM 1336 in reply to 1333

    Re: Playlists

    Hi,

    I had some similar issues with playing videos - and found I needed to convert the mapped paths back into UNC paths before I could access files in a lot of cases (in fact .NET code reqiures this as well if you are using System.IO). I'm not sure if the technique I'm using is kosher - but i was able to extract the mapped path UNC's from the registry without having to resort to Win32 calls..

    So if you access the playlist as  \\othermachine\s\videos\playlist.asx..   - then you can just have relative paths inside the playlist. (so you don't need to hardcode paths in the playlist - which would make it a pain to manage later on)..

    Niall

     

     

  •  01-03-2007, 5:13 PM 1350 in reply to 1336

    Re: Playlists

    The drive mapping I'm using is actually mapped to a virtual disk rather than a network path. Are you saying I still need to play the list by passing a full UNC path to the file?

    I'm not worried about having absolute paths within the playlist as the file is created on the fly just before playing.

    Do the paths within the playlist also have to be UNC paths?

    Thanks.
    Glenn

  •  01-08-2007, 1:46 PM 1381 in reply to 1333

    Re: Playlists

    I have no problem in playing a playlist for streaming medias by using the playmedia function.

    And here's what I found regarding the media file path.

    http://www.microsoft.com/windows/windowsmedia/howto/articles/introwmmeta.aspx
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems