Share via


Windows Media Player 11 SDK IWMPNetwork.bufferingTime (VB and C#) 

Windows Media Player SDK banner art

Previous Next

IWMPNetwork.bufferingTime (VB and C#)

The bufferingTime property gets or sets the amount of time in milliseconds allocated for buffering incoming data before playback begins.

  

Property Value

A System.Int32 that is the buffering time in milliseconds, which ranges from zero to 60,000 with a default value of 5,000.

Example Code

The following code example uses bufferingTime to specify the number of seconds allocated for buffering incoming data. A text box allows the user to enter a new value for bufferingTime, and the property is updated in response to the Click event of a button. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.

  
Public Sub setBufTime_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles setBufTime.Click

    ' Retrieve input from the user and convert it to an integer.
    Dim newTime As Integer = System.Convert.ToInt32(bufText.Text)

    ' Test whether the integer is within the valid range. 
    If (newTime >= 0 And newTime <= 60) Then

        ' Set the new bufferingTime in miliseconds.
        player.network.bufferingTime = (newTime * 1000)

    Else

        System.Windows.Forms.MessageBox.Show("Buffering time must be between 0 and 60.")

    End If

End Sub

FakePre-272d8cb6a3b84d3b967a6bff0e8bddcc-e48e3b83393840a084d506ecf2fb9d28

private void setBufTime_Click(object sender, System.EventArgs e)
{
    // Retrieve input from the user and convert it to an integer.
    int newTime = System.Convert.ToInt32(bufText.Text);

    // Test whether the integer is within the valid range. 
    if (newTime >= 0 & newTime <= 60) 
    {
        // Set the new bufferingTime in miliseconds.
        player.network.bufferingTime = (newTime * 1000);
    }
    else
    {
        System.Windows.Forms.MessageBox.Show("Buffering time must be between 0 and 60.");
    }
}

Requirements

Version: Windows Media Player 9 Series or later

Namespace: WMPLib

Assembly: Interop.WMPLib.dll (automatically generated by Visual Studio)

See Also

Previous Next