MediaCollection.getByGenre 메서드

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

getByGenre 메서드는 지정된 장르를 사용하여 미디어 항목의 재생 목록을 검색합니다.

구문

retVal = MediaCollection.getByGenre(
  genre
)

매개 변수

genre [in]

장르의 이름을 포함하는 문자열입니다.

반환 값

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

설명

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

예제

다음 JScript 예제에서는 MediaCollection을 사용합니다. getByGenre - 미디어 항목의 재생 목록을 검색합니다. 재생 목록에는 GetGenre라는 HTML TEXT 입력 요소에서 사용자가 지정한 장르의 항목이 포함됩니다. Player 개체는 ID = "Player"로 만들어졌습니다.

<!-- Use an HTML BUTTON element to create the playlist and play 
the media items. -->
<INPUT TYPE = "BUTTON"  
       NAME = "PlayGenre"  
       ID = "PlayGenre"  
       VALUE = "Play Genre"

onClick = "
    /* Retrieve the genre text from the user. */
    var genre = GetGenre.value;

    /* Create the playlist using getByGenre. */
    var pl = Player.mediaCollection.getByGenre(genre);

    /* Make the new playlist the current playlist. */
    Player.currentPlaylist = pl;

    /* Play the digital media item in the new playlist. */
    Player.controls.play();
">

요구 사항

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

추가 정보

MediaCollection 개체

재생 목록 개체

Settings.mediaAccessRights

Settings.requestMediaAccessRights