다음을 통해 공유


MediaCollection.getAttributeStringCollection 메서드

[이 페이지와 연결된 기능인 Windows 미디어 플레이어 SDK는 레거시 기능입니다. MediaPlayer로 대체되었습니다. MediaPlayer는 Windows 10 및 Windows 11 최적화되었습니다. 가능한 경우 새 코드에서 Windows 미디어 플레이어 SDK 대신 MediaPlayer를 사용하는 것이 좋습니다. 가능한 경우 레거시 API를 사용하는 기존 코드를 다시 작성하여 새 API를 사용하도록 제안합니다.]

getAttributeStringCollection 메서드는 지정된 미디어 형식 내의 지정된 특성에 대한 모든 값 집합을 나타내는 StringCollection 개체를 검색합니다.

구문

retVal = MediaCollection.getAttributeStringCollection(
  attribute,
  mediaType
)

매개 변수

특성 [in]

특성을 지정하는 문자열입니다.

mediaType [in]

미디어 형식을 나타내는 문자열입니다. "Audio", "Video", "Playlist" 또는 "Other" 값 중 하나를 포함합니다.

반환 값

이 메서드는 StringCollection 개체를 반환합니다.

설명

이 메서드를 사용하려면 라이브러리에 대한 읽기 권한이 필요합니다. 자세한 내용은 라이브러리 액세스를 참조하세요.

Windows 미디어 플레이어 지원하는 특성에 대한 자세한 내용은 특성 참조 섹션을 참조하세요.

예제

다음 JScript 예제에서는 MediaCollection을 사용합니다. getAttributeStringCollection - 미디어 컬렉션의 오디오 항목에 대한 특정 특성에 해당하는 값 목록을 표시합니다. ID = "Attribute"로 만든 HTML SELECT 요소를 사용하면 사용자가 아티스트, 장르 또는 앨범과 같은 특성을 선택할 수 있습니다. ID = "AttributeVals"로 만든 HTML TEXTAREA 요소가 결과를 표시합니다. Player 개체는 ID = "Player"로 만들어졌습니다.

// Clear the text in the display area.
AttributeVals.value = "";

// Store the mediaCollection object.
var library = Player.mediaCollection;

// Get the string collection for the attribute type the user selects.
var all = library.getAttributeStringCollection(Attribute.value, "Audio");

// Loop through the string collection.
for (i = 0; i < all.count; i++){

    // Display the items one line at a time.
    AttributeVals.value += all.item(i);
    AttributeVals.value += "\n";
}

요구 사항

요구 사항
버전
Windows 미디어 플레이어 버전 7.0 이상.
DLL
Wmp.dll

추가 정보

MediaCollection 개체

Settings.mediaAccessRights

Settings.requestMediaAccessRights

StringCollection 개체