AxWindowsMediaPlayer.currentMedia 속성
[이 페이지와 연결된 기능인 Windows 미디어 플레이어 SDK는 레거시 기능입니다. MediaPlayer로 대체되었습니다. MediaPlayer는 Windows 10 및 Windows 11 최적화되었습니다. 가능한 경우 새 코드에서 Windows 미디어 플레이어 SDK 대신 MediaPlayer를 사용하는 것이 좋습니다. 가능한 경우 레거시 API를 사용하는 기존 코드를 다시 작성하여 새 API를 사용하도록 제안합니다.]
currentMedia 속성은 현재 미디어 항목에 해당하는 IWMPMedia 인터페이스를 가져오거나 설정합니다.
구문
public IWMPMedia currentMedia {get; set;}
Public Property currentMedia As IWMPMedia
속성 값
현재 미디어 항목에 대한 액세스를 제공하는 WMPLib.IWMPMedia 인터페이스입니다.
설명
AxWindowsMediaPlayer.settings인 경우 autoStart 속성은 true이고, currentMedia를 설정할 때마다 재생이 자동으로 시작됩니다.
IWMPPlaylist.Item 속성(C#의 IWMPPlaylist.get_Item 메서드)을 통해 지정된 미디어 항목에 대한 IWMPMedia 인터페이스를 검색할 수 있습니다. 파일 이름을 사용하여 미디어 항목을 로드하려면 URL 속성을 설정하거나 newMedia를 사용합니다.
예제
다음 예제에서는 라이브러리의 첫 번째 미디어 항목을 검색하고 currentMedia 속성을 사용하여 검색된 미디어 항목을 현재 미디어 항목으로 설정하고 해당 이름을 표시합니다. AxWMPLib.AxWindowsMediaPlayer 개체는 player라는 변수로 표시됩니다.
// Get an interface to the first media item in the library.
WMPLib.IWMPMedia3 firstMedia = (WMPLib.IWMPMedia3)player.mediaCollection.getAll().get_Item(0);
// Make the retrieved media item the current media item.
player.currentMedia = firstMedia;
// Display the name of the current media item.
currentMediaLabel.Text = ("Found first media item. Name = " + player.currentMedia.name);
' Get an interface to the first media item in the library.
Dim firstMedia As WMPLib.IWMPMedia3 = player.mediaCollection.getAll().Item(0)
' Make the retrieved media item the current media item.
player.currentMedia = firstMedia
' Display the name of the current media item.
currentMediaLabel.Text = ("Found first media item. Name = " + player.currentMedia.name)
요구 사항
요구 사항 | 값 |
---|---|
버전 |
Windows 미디어 플레이어 9 시리즈 이상 |
네임스페이스 |
AxWMPLib |
어셈블리 |
|
추가 정보
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기