The getByAuthor method retrieves a playlist of the media items by the specified author.
retVal = MediaCollection.getByAuthor( author )
String containing the name of the author.
This method returns a Playlist object.
To use this method, read access to the library is required. For more information, see Library Access.
The following JScript example uses MediaCollection.getByAuthor to retrieve a playlist of media items. The playlist contains items matching the author specified by the user in an HTML TEXT input element named GetAuthor. The Player object was created with ID = "Player".
<!-- Use an HTML BUTTON element to create the playlist and play the media items. --> <INPUT TYPE = "BUTTON" NAME = "PlayAuthor" ID = "PlayAuthor" VALUE = "Play Author" onClick = " /* Retrieve the author name text from the user. */ var author = GetAuthor.value; /* Create the playlist by using getByAuthor. */ var pl = Player.mediaCollection.getByAuthor(Author); /* Make the new playlist the current playlist. */ Player.currentPlaylist = pl; /* Play the media items in the new playlist. */ Player.controls.play(); ">
||Windows Media Player version 7.0 or later.