How to Make a Silverlight Textblock an Input Control
Silverlight Audio Player is an audio interface that you can install onto a website. Generally, when you install Silverlight Audio Player, the player launches and plays music automatically when the website is opened. The music in a Silverlight Audio Player is accessed from another location online, and the coding used to install Silverlight Audio Player points to the URL where the music is stored. If you prefer a website visitor to have control over the Silverlight player, you can also turn the Silverlight textblock in the coding into an input control.
Instructions
-
-
1
Download an XML editor to your computer. You can download many editors for free online. XML Notepad is Microsoft's native XML editor, which you can download at the Microsoft website, and Apple recommends Serna Free XML Editor, which you can download directly from the Apple site (see Resources).
-
2
Create the playlist of the songs that you want to play through Silverlight Audio Player in the XML editor if you haven't done so already. This is the textblock for Silverlight. To create a playlist textblock, launch the XML editor and enter the following coding into the file:
<xml version="1.0" encoding=utf-8" >
<playlist>
<audiofile url="http://www.[website]/[page]/audio/[file name]" title="[song title]" artist="[artist name]" />
"[website]" refers to the URL where the song is located; "[page]" references the specific page at that URL, if the website has more than one page; "[file name]" is the name of the song file, such as "Seasons Greetings.mp3"; "[song title]" is the song name as you want it to appear on your website; and "[artist name]" is the name of the singer or musician.
-
-
3
Add the coding above for each song you want to add to the Silverlight player on your site. Go to "File" and "Save" once you have finished with the playlist, and enter a name for the playlist when prompted. Save the playlist to the same folder that contains all your other website files.
-
4
Download and install Silverlight Audio Player (see Resources) to the website where you want to add the Silverlight input control. Install the playlist by transferring the coding you download from the site into your website editor as you would any other coding for your page.
-
5
Point the Silverlight player to the XML playlist you created in the XML editor. Type "Playlist=[path]" after "InitParams" in the Silverlight player coding and fill in "[path]" with the location of the playlist on your computer. Upload the playlist file to the website along with the player when uploading the player through your FTP service. The Silverlight player appears on the page with standard input controls.
-
1