Controls.playItem 메서드

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

playItem 메서드는 지정된 미디어 항목을 재생합니다.

구문

Controls.playItem(
  theMediaItem
)

매개 변수

theMediaItem [in]

재생할 미디어 개체입니다.

반환 값

이 메서드는 값을 반환하지 않습니다.

설명

미디어 항목은 설정 값에 관계없이 자동으로 로드되고 재생됩니다. autoStart 속성입니다. 항목을 자동으로 재생하지 않고 로드하려면 설정을 지정합니다. autoStart 를 false로 지정하고 Player에 값을 할당합니다. URL, 그 후 재생 을 호출하여 항목 재생을 시작할 수 있습니다.

참고

playItem은currentPlaylist의 항목에서만 작동합니다. 저장된 미디어 항목을 참조하여 playItem 을 호출하는 것은 지원되지 않습니다.

예제

다음 JScript 예제에서는 playItem 을 사용하여 현재 재생 목록의 미디어 항목을 재생합니다. 재생할 항목은 재생 목록의 위치에 따라 선택됩니다. Player 개체는 ID = "Player"로 만들어졌습니다.

// Declare a variable to hold the position of the media item 
// in the current playlist. An arbitrary value is supplied here.
var index = 3

// Retrieve the media item at the fourth position in the current playlist.
var media = Player.currentPlaylist.item(index);

// Play the media item.
Player.controls.playItem(media);

요구 사항

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

추가 정보

Controls 개체

Playlist.item