PlaylistCollection.getByName 메서드

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

getByName 메서드는 지정된 이름의 재생 목록이 포함된 PlaylistArray 개체(있는 경우)를 검색합니다.

구문

retVal = PlaylistCollection.getByName(
  name
)

매개 변수

name [in]

검색할 재생 목록의 이름을 포함하는 문자열입니다.

반환 값

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

설명

PlaylistArray를 사용합니다. 계산하여 재생 목록이 있는지 여부를 확인합니다. count가 0이면 재생 목록이 존재하지 않습니다.

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

예제

다음 JScript 예제에서는 playlistCollection을 사용합니다. getByName을 사용하여 "ThreeList"라는 재생 목록에 대한 playlistCollection 개체를 검사. "Threelist" 재생 목록이 있는 경우 getByName 은 "ThreeList"를 현재 재생 목록으로 설정합니다. Player 개체는 ID = "Player"를 사용하여 만들어졌습니다.

//Retrieve the count of the playlists named "ThreeList".
var Checkit = Player.playlistCollection.getByName("ThreeList").count;

//Since duplicate playlist names are allowed, the count returned
//will be either zero (no playlist) or greater than zero 
//(playlist exists).
if (Checkit > 0){ 
    
   //Retrieve a playlistArray object containing "ThreeList". Assume that
   //there is only one playlist with that name, and assign it to the 
   //current playlist.
   Player.currentPlaylist = Player.playlistCollection.getByName("ThreeList").item(0);
}

요구 사항

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

추가 정보

PlaylistArray 개체

PlaylistArray.count

PlaylistCollection 개체

Settings.mediaAccessRights

Settings.requestMediaAccessRights