Sie sind auf Seite 1von 6

//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////// MediaCollection.getPlaylistByQuery This is preliminary documentation and subject to change.

//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////// The getPlaylistByQuery method retrieves a Playlist object containing Media objec ts that match the query conditions. Syntax player.mediaCollection.getPlaylistByQuery( query, mediaType, sortAttribute, sortAscending ) Parameters query Query object that defines the conditions used to create the playlist. mediaType String containing the media type. Must contain one of the following values: "aud io", "video", "photo", "playlist", or "other". sortAttribute String containing the attribute name used for sorting. An empty string ("") mean s no sorting is applied. sortAscending Boolean, true indicating that the playlist must be sorted in ascending order. Return Values This method returns a Playlist object. Remarks Compound queries using Query are not case sensitive. When the compound query specified by the query parameter contains a condition bu ilt on the MediaType attribute, that condition is ignored. The value for the med iaType parameter is always used. For example, if the compound query contains the condition "MediaType Equals audio" and the value for the mediaType parameter is "video", the resulting playlist will contain only video items. Requirements Version: Windows Media Player 11. Library: Use wmp.dll.

See Also MediaCollection Object MediaType Attribute Query Object Previous Next //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////// MediaCollection.getStringCollectionByQuery This is preliminary documentation and subject to change. //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////// The getStringCollectionByQuery method retrieves a StringCollection object contai ning all strings that match the query conditions. Syntax player.mediaCollection.getStringCollectionByQuery( attribute, query, mediaType, sortAttribute, sortAscending ) Parameters attribute String containing the attribute name. query Query object. mediaType String containing the media type. Must contain one of the following values: "aud io", "video", "photo", "playlist", or "other". sortAttribute String containing the attribute name used for sorting. An empty string ("") mean s no sorting is applied. sortAscending Boolean, true indicating that the StringCollection must be sorted in ascending o rder. Return Values This method returns a StringCollection object. Remarks

Compound queries using Query are not case sensitive. When the compound query specified by the query parameter contains a condition bu ilt on the MediaType attribute, that condition is ignored. The value for the med iaType parameter is always used. For example, if the compound query contains the condition "MediaType Equals audio" and the value for the mediaType parameter is "video", the resulting playlist will contain only video items. Requirements Version: Windows Media Player 11. Library: Use wmp.dll. See Also MediaCollection Object MediaType Attribute //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////// Query Object This is preliminary documentation and subject to change. //////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////// The Query object represents a compound query. The Query object supports the following methods. Method Description addCondition Adds a condition to the Query object using AND logic. beginNextGroup Begins a new condition group. For purposes of illustration, player.mediaCollection.createQuery() is used to re present the Query object in the reference syntax sections. About the Query Object MediaCollection.createQuery MediaCollection.getPlaylistByQuery MediaCollection.getStringCollectionByQuery Object Model Reference for Scripting Query.addCondition This is preliminary documentation and subject to change.

The addCondition method adds a condition to the Query object using AND logic. Syntax player.mediaCollection.createQuery().addCondition(attribute, operator, value) Parameters attribute String containing the attribute name.

operator String containing the operator. See Remarks for supported values. value String containing the attribute value. Return Values This method does not return a value. Remarks Compound queries using Query are not case sensitive. A list of values for the attribute parameter can be found in the Alphabetical At tribute Reference section. Conditions contained in a Query object are organized into condition groups. Mult iple conditions within a condition group are always concatenated using AND logic . Condition groups are always concatenated to each other using OR logic. To star t a new condition group, call Query.beginNextGroup. The following table lists the supported values for operator. Operator Applies to -------- ------- -BeginsWith Strings Contains Strings Equals All types GreaterThan Numbers, Dates GreaterThanOrEquals Numbers, Dates LessThan Numbers, Dates LessThanOrEquals Numbers, Dates NotEquals All types Example Code The following JScript example uses Query.addCondition and Query.beginNextGroup t o perform an example query. // // // // // Perform an example query for media for which: The genre contains "jazz" and the title begins with "a" OR the genre contains "jazz" and the author begins with "b".

// Create the query object. var Query = Player.mediaCollection.createQuery(); // Add the first condition group. Query.addCondition("WM/Genre", "Contains", "jazz"); Query.addCondition("Title", "BeginsWith", "a"); // Begin the new condition group ("or"). Query.beginNextGroup();

// Add the second condition group. Query.addCondition("WM/Genre", "Contains", "jazz"); Query.addCondition("Author", "BeginsWith", "b"); // Perform the var Playlist = Query, "audio", "", false); Requirements Version: Windows Media Player 11. Library: Use wmp.dll. See Also MediaCollection.createQuery MediaCollection.getPlaylistByQuery MediaCollection.getStringCollectionByQuery Query Object Query.beginNextGroup //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////// Query.beginNextGroup This is preliminary documentation and subject to change. //////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////// The beginNextGroup method begins a new condition group. Syntax player.mediaCollection.createQuery().beginNextGroup() Parameters This method takes no parameters. Return Values This method does not return a value. Remarks Beginning a new condition group implies that you have completed the current cond ition group. The new condition group is always concatenated to the previous cond ition group using OR logic. Requirements Version: Windows Media Player 11. Library: Use wmp.dll. query on "audio" media. Player.mediaCollection.getPlaylistByQuery( // query // mediaType // sortAttribute // sortAscending

See Also MediaCollection.createQuery MediaCollection.getPlaylistByQuery MediaCollection.getStringCollectionByQuery Query Object Query.addCondition //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////// MediaCollection.getByAttributeAndMediaType This is preliminary documentation and subject to change. //////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////// The getByAttributeAndMediaType method retrieves a Playlist object containing Med ia objects having the specified attribute and media type. Syntax Player.mediaCollection.getByAttributeAndMediaType("genre", "", "Playlists") Parameters attribute String containing the attribute. value String containing the value. mediaType String containing the media type. Must contain one of the following values: "aud io", "video", "photo", "playlist", or "other". Return Values This method returns a Playlist object Requirements Version: Windows Media Player 11. Library: Use wmp.dll. See Also Attribute Reference MediaCollection Object Playlist Object

Das könnte Ihnen auch gefallen