Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently November 1st, 2024, 7:37 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Windows Media Looped Playlist
PostPosted: February 23rd, 2005, 2:46 pm 
Offline

Joined: November 3rd, 2004, 3:18 pm
Posts: 41
This may seem like a simple/strange question but here goes. I would like to setup a display in our lobby that plays a list of items in a playlist using Windows Media Player and have it play continuously. Has anyone done this? I want to play both video and audio where the audio would just have a single image being displayed while it is playing. Are there any programs for managing/creating these playlists? Can I have the items in the playlist play indefinitely?

Lyndon

_________________
Windows Vista Ultimate, 4GB RAM, 1TB Disk
Opus 6 Pro


Top
 Profile  
 
 Post subject:
PostPosted: March 3rd, 2005, 2:43 pm 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
Hi,

Thank you for your enquiry.

Windows Media Player playlists are saved in SMIL (Synchronised Multimedia Integration Language) and if you open one of these files in Notepad, you should see that they are relatively easy to understand. For example:

Code:
<?wpl version="1.0"?>
<smil>
    <head>
        <meta name="Generator" content="Microsoft Windows Media Player -- 10.0.0.3646"/>
        <author/>
        <title>My Playlist</title>
    </head>
    <body>
        <seq>
            <media src="C:\\Documents and Settings\User\My Documents\My Music\Track1.mp3" tid="{287CF3F9-ED09-4169-8FB9-B0CC1EC784E1}"/>
            <media src="C:\\Documents and Settings\User\My Documents\My Music\Track2.mp3" tid="{287CF3F9-ED09-4169-8FB9-B0CC1EC03E2B}"/>
            <media src="C:\\Documents and Settings\User\My Documents\My Music\Track3.mp3" tid="{287CF3F9-ED09-4169-8FB9-B0CC4F2BD2BD}"/>
        </seq>
    </body>
</smil>


We can see from the above code that each of the <media src> tags specifies a different track in the playlist.

If you know the structure of these playlist files, you can use a series of Read Line from File actions to retrieve a particular line from the playlist, strip out any unwanted information and store the result to a variable. This variable can then be used in a PlaySound() script action to play the file in question.

For example, on each of the <media src> lines, the first letter of the file path is always the 24th character on the line (including spaces at the start of the line). To determine the end of the path, we can use an indexOf function to find the next instance of a quotation mark (which will be after the last character of the file path). We can then create a substring of the characters between these two positions and store this to a variable ready for the PlaySound action.

The following code should give you some idea of how these actions will work:

Code:
playlist = OpenFile(SYSTEM_PUBLICATION_DIR+"playlist.wpl")
for (n=0;n<10;n++) {
playlist.ReadLine()
}
audio = playlist.ReadLine()
secondquote = audio.indexOf('"',24)
audio = audio.substring(24,secondquote)
PlaySound(audio)


Kind regards,

_________________
Robin Garrett
Digital Workshop Technical Support


Top
 Profile Visit website  
 
 Post subject:
PostPosted: March 4th, 2005, 1:05 pm 
Offline

Joined: November 3rd, 2004, 3:18 pm
Posts: 41
Robin,

Thanks for the help I will try your code and expand on it for what I want.

_________________
Windows Vista Ultimate, 4GB RAM, 1TB Disk
Opus 6 Pro


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 44 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group