MediaCollection.getAll 메서드
[이 페이지와 연결된 기능인 Windows 미디어 플레이어 SDK는 레거시 기능입니다. MediaPlayer로 대체되었습니다. MediaPlayer는 Windows 10 및 Windows 11 최적화되었습니다. 가능한 경우 새 코드에서 Windows 미디어 플레이어 SDK 대신 MediaPlayer를 사용하는 것이 좋습니다. 가능한 경우 레거시 API를 사용하는 기존 코드를 다시 작성하여 새 API를 사용하도록 제안합니다.]
getAll 메서드는 라이브러리의 모든 미디어 항목이 포함된 재생 목록을 검색합니다.
구문
retVal = MediaCollection.getAll()
매개 변수
이 메서드에는 매개 변수가 없습니다.
반환 값
이 메서드는 Playlist 개체를 반환합니다.
설명
이 메서드를 사용하려면 라이브러리에 대한 읽기 권한이 필요합니다. 자세한 내용은 라이브러리 액세스를 참조하세요.
예제
다음 JScript 예제에서는 MediaCollection을 사용합니다. get모든 미디어 컬렉션에서 임의로 미디어 항목을 재생합니다. Player 개체는 ID = "Player"로 만들어졌습니다.
// Store the count of all media items in the media collection.
var count = Player.mediaCollection.getAll().count;
// Generate a random number using the media count.
var rand = Math.random() * count;
// Round down the random number to the nearest integer.
rand = Math.floor(rand);
// Make the random media item the current media item.
Player.currentMedia = Player.mediaCollection.getAll().item(rand);
// Play the media item.
// Player.controls.play();
요구 사항
요구 사항 | 값 |
---|---|
버전 |
Windows 미디어 플레이어 버전 7.0 이상. |
DLL |
|
추가 정보
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기