IWMPNetwork::bufferingProgress 속성

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

bufferingProgress 속성은 완료된 버퍼링의 백분율을 가져옵니다.

구문

public System.Int32 bufferingProgress {get; set;}

Public ReadOnly Property bufferingProgress As System.Int32

속성 값

백분율로 표현되는 버퍼링 진행률인 System.Int32 입니다.

설명

재생이 중지되고 다시 시작될 때마다 이 속성은 0으로 다시 설정됩니다. 재생이 일시 중지된 경우 다시 설정되지 않습니다.

버퍼링은 스트리밍 콘텐츠에만 적용됩니다. 이 속성은 AxWindowsMediaPlayer.URL 속성을 사용하여 재생 URL이 설정된 런타임 동안에만 유효한 정보를 가져옵니다.

AxWindowsMediaPlayer._WMPOCXEvents_BufferingEvent 사용하여 버퍼링이 시작되거나 중지되는 시기를 결정합니다.

예제

다음 예제에서는 bufferingProgress를 사용하여 버 퍼링 이벤트에 대한 응답으로 레이블에서 완료된 버퍼링의 백분율을 표시합니다. 이 예제에서는 1초 간격의 타이머를 사용하여 디스플레이를 업데이트합니다. AxWMPLib.AxWindowsMediaPlayer 개체는 player라는 변수로 표시됩니다.

// Add a delegate for the Buffering event.
player.Buffering += new AxWMPLib._WMPOCXEvents_BufferingEventHandler(player_Buffering);

// Create an event handler for the Buffering event.
private void player_Buffering(object sender, AxWMPLib._WMPOCXEvents_BufferingEvent e)
{
    // Determine whether buffering has started or stopped.
    if (e.start == true)
    {
        // Set the timer interval at one second (1000 miliseconds).
        timer.Interval = 1000;
        
        // Start the timer.
        timer.Start();
    }
    else
    {
        // Buffering is complete. Stop the timer.
        timer.Stop();
    }
}

// Update the buffering progress in a timer event handler.
private void UpdateBufferingProgress(object sender, EventArgs e)
{
    bufferingProgressLabel.Text = ("Buffering progress: " + player.network.bufferingProgress + " percent complete");
}

' Create an event handler for the Buffering event.
Public Sub player_Buffering(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_BufferingEvent) Handles player.Buffering

    ' Test whether packets may be arriving.
    Select Case e.newState

    ' If WMPPlayState is Stopped, Paused, ScanForward, ScanReverse, Waiting, MediaEnded
    ' or Transitioning then stop the timer. 
        Case 1
        Case 2
        Case 4
        Case 5
        Case 7
        Case 8
        Case 9
            timer.Stop()

        ' If WMPPlayState is Playing or Buffering then set the timer interval and start the timer.
        Case Else
            timer.Interval = 1000
            timer.Start()

    End Select

End Sub

' Update the buffering progress in a timer event handler.
Public Sub UpdateBufferingProgress(ByVal sender As Object, ByVal e As System.EventArgs) Handles timer.Tick

    bufferingProgressLabel.Text = ("Buffering progress: " + player.network.bufferingProgress + " percent complete")

End Sub

요구 사항

요구 사항
버전
Windows 미디어 플레이어 9 시리즈 이상
네임스페이스
WMPLib
어셈블리
Interop.WMPLib.dll(Interop.WMPLib.dll.dll)

추가 정보

AxWindowsMediaPlayer.URL(VB 및 C#)

AxWindowsMediaPlayer.Buffering 이벤트(VB 및 C#)

IWMPNetwork 인터페이스(VB 및 C#)