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

Windows Media Player SDK banner art

Previous Next

IWMPNetwork.encodedFrameRate (VB and C#)

The encodedFrameRate property gets the video frame rate specified by the content author.

  [Visual Basic]
ReadOnly Property encodedFrameRate As Integer

[C#]
int encodedFrameRate {get;}

Property Value

A System.Int32 that is the encoded frame rate in frames per second (fps).

Note   Although this property measures the encoded frame rate in frames per second, the frameRate property measures the current frame rate in frames per hundred seconds.

Example Code

The following code example uses encodedFrameRate to display the frame rate specified when the file was encoded. The information is displayed in a label, in response to the PlayStateChange Event. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.

  [Visual Basic]
' Create an event handler for the PlayStateChange event.
Public Sub player_PlayStateChange(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles player.PlayStateChange

    ' Display the encodedFrameRate when the player is playing. 
    Select Case e.newState

        Case 3 ' Play State = WMPLib.WMPPlayState.wmppsPlaying = 3

            If (player.network.encodedFrameRate <> 0) Then

                encodedFrameRateLabel.Text = "Current Encoded Frame Rate: " + player.network.encodedFrameRate + " K bits/second"

            End If

    End Select

End Sub

FakePre-eb5890921b7d4cf48445b9a6e7f818bd-85fc5b9b6e4f4d10922e4846cffc2350

// Add a delegate for the PlayStateChange event.
player.PlayStateChange += new AxWMPLib._WMPOCXEvents_PlayStateChangeEventHandler(player_PlayStateChange);

// Create an event handler for the PlayStateChange event.
private void player_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e)
{
    // Display the encodedFrameRate when the player is playing. 
    switch (e.newState)
    {
        case 3:  // Play State = WMPLib.WMPPlayState.wmppsPlaying = 3
            if (player.network.encodedFrameRate != 0)
            {
                encodedFrameRateLabel.Text = "Current Encoded Frame Rate: " + player.network.encodedFrameRate + " K bits/second";
            }
            break;

        default:
            break;
    }
}

Requirements

Version: Windows Media Player 9 Series or later

Namespace: WMPLib

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

See Also

Previous Next