Share via


AxWindowsMediaPlayer.uiMode property

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The uiMode property gets or sets a value indicating which controls are shown in the user interface.

Syntax

public System.String uiMode {get; set;}

Public Property uiMode As System.String

Property value

A System.String that is one of the following values.

Value Description Audio example Video example
invisible Windows Media Player is embedded without any visible user interface (controls, video or visualization window). (Nothing is displayed.) (Nothing is displayed.)
none Windows Media Player is embedded without controls, and with only the video or visualization window displayed. uimode = 'none' with audio uimode = 'none' with video
mini Windows Media Player is embedded with the status window, play/pause, stop, mute, and volume controls shown in addition to the video or visualization window. uimode = 'mini' with audio uimode = 'mini' with video
full Default. Windows Media Player is embedded with the status window, seek bar, play/pause, stop, mute, next, previous, fast forward, rewind, and volume controls in addition to the video or visualization window. uimode = 'full' with audio uimode = 'full' with video
custom Windows Media Player is embedded with a custom user interface. Can only be used in C++ programs. (Custom user interface is displayed.) (Custom user interface is displayed.)

Remarks

This property specifies the appearance of the embedded Windows Media Player. When uiMode is set to "none", "mini", or "full", a window is present for the display of video clips and audio visualizations. This window can be hidden in mini or full mode by setting the height attribute of the OBJECT tag to 40, which is measured from the bottom, and leaves the controls portion of the user interface visible. If no embedded interface is desired, set both the width and height attributes to zero.

If uiMode is set to "invisible", no user interface is displayed, but space is still reserved on the page as specified by width and height. This is useful for retaining page layout when uiMode can change. Additionally, the reserved space is transparent, so any elements layered behind the control will be visible.

If uiMode is set to "full" or "mini", Windows Media Player displays transport controls in full-screen mode. If uiMode is set to "none", no controls are displayed in full-screen mode.

If the window is visible and audio content is being played, the visualization displayed will be the one most recently used in Windows Media Player.

If uiMode is set to "custom" in a C++ program that implements IWMPRemoteMediaServices, the skin file indicated by IWMPRemoteMediaServices.GetCustomUIMode is displayed.

During full-screen playback, Windows Media Player hides the mouse cursor when enableContextMenu equals false and uiMode equals "none".

Examples

The following example creates a list box that allows the user to change the user interface mode for an embedded Windows Media Player object. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.

// Load the list box with the four UI mode options.
uiModeOptions.Items.Add("invisible");
uiModeOptions.Items.Add("none");
uiModeOptions.Items.Add("mini");
uiModeOptions.Items.Add("full");


private void uiModeOptions_OnSelectedIndexChanged(object sender, System.EventArgs e)
{
    // Get the selected UI mode in the list box as a string.
    string newMode = (string)(((System.Windows.Forms.ListBox)sender).SelectedItem);
     
    // Set the UI mode that the user selected.
    player.uiMode = newMode;            
}

' Load the list box with the four UI mode options.
uiModeOptions.Items.Add("invisible")
uiModeOptions.Items.Add("none")
uiModeOptions.Items.Add("mini")
uiModeOptions.Items.Add("full")


Public Sub uiModeOptions_OnSelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles uiModeOptions.SelectedIndexChanged

    ' Get the selected UI mode in the list box as a string.
    Dim lb As System.Windows.Forms.ListBox = sender
    Dim newMode As String = lb.SelectedItem

    ' Set the UI mode that the user selected.
    player.uiMode = newMode

End Sub

Requirements

Requirement Value
Version
Windows Media Player version 7.0 or later. Windows Media Player 9 Series or later for "invisible" or "custom"
Namespace
AxWMPLib
Assembly
AxInterop.WMPLib.dll (AxInterop.WMPLib.dll.dll)

See also

AxWindowsMediaPlayer Object (VB and C#)

AxWindowsMediaPlayer.enableContextMenu (VB and C#)