Detailed usage of AxWindowsMediaPlayer)

Source: Internet
Author: User
Detailed usage of AxWindowsMediaPlayer Favorites


Find me and familiarize myself with what I have done.

Attribute/method name: Description:
[Basic attributes]
URL: String; specifies the media location, local or network address
UiMode: String; player interface mode, which can be Full, Mini, None, Invisible
PlayState: integer; playback status, 1 = stopped, 2 = paused, 3 = played, 6 = buffering, 9 = connected, 10 = ready
EnableContextMenu: Boolean; enable/disable context menu
FullScreen: boolean; Whether to display in full screen
[Controls] wmp. controls // basic player control
Controls. play; play
Controls. pause; pause
Controls. stop; stop
Controls. currentPosition: double; current progress
Controls. currentPositionString: string; current progress, string format. For example"
Controls. fastForward; Fast Forward
Controls. fastReverse; fast return
Controls. next; next
Controls. previous; previous Curve
[Settings] wmp. settings // basic player settings
Settings. volume: integer; volume: 0-100
Settings. autoStart: Boolean; Whether to play automatically
Settings. mute: Boolean; mute
Settings. playCount: integer; number of playbacks
[CurrentMedia] wmp. currentMedia // current media attribute
CurrentMedia. duration: double; total media Length
CurrentMedia. durationString: string; total media length, in string format. For example"
CurrentMedia. getItemInfo (const string); get current media information "Title" = media Title, "Author" = artist, "Copyright" = Copyright information, "Description" = media content Description, "Duration" = Duration (seconds), "FileSize" = file size, "FileType" = file type, "sourceURL" = original address
CurrentMedia. setItemInfo (const string); set media information by attribute name
CurrentMedia. name: string; same as currentMedia. getItemInfo ("Title ")
[CurrentPlaylist] wmp. currentPlaylist // attributes of the current playlist
CurrentPlaylist. count: integer; number of media contained in the current playlist
CurrentPlaylist. Item [integer]; gets or sets the media information of the specified project. Its subattributes are the same as those of the wmp. currentMedia AxWindowsMediaPlayer control.Favorites
MediaPlayer1.Play
MediaPlayer1.Stop stop
MediaPlayer1.Pause pause
MediaPlayer1.PlayCount file playback times
MediaPlayer1.AutoRewind loop playback
MediaPlayer1.Balance audio channel
MediaPlayer1.Volume volume
MediaPlayer1.Mute mute
MediaPlayer1.EnableContextMenu: whether the shortcut menu can be displayed when you right-click the control
MediaPlayer1.AnimationAtStart: whether to play the animation before playback
MediaPlayer1.ShowControls: display the control Toolbar
MediaPlayer1.ShowAudioControls: whether to display the sound control button
MediaPlayer1.ShowDisplay: displays information about the data file.
MediaPlayer1.ShowGotoBar: whether the Goto column is displayed
MediaPlayer1.ShowPositionControls: whether to display the position adjustment button
MediaPlayer1.ShowStatusBar: whether the status bar is displayed
MediaPlayer1.ShowTracker: whether the progress bar is displayed
MediaPlayer1.FastForward fast forward
MediaPlayer1.FastReverse quick return
MediaPlayer1.Rate fast forward/Return Rate
MediaPlayer1.AllowChangeDisplaySize: whether the playback image size can be set freely
MediaPlayer1.DisplaySize: sets the playback image size.
1-MpDefaultSize original size
2-MpHalfSize: half of the original size
3-mpdoublesize: twice the original size
4-MpFullScreen full screen
5-mponesixteenthscreen screen size: 1/16
6-MpOneFourthScreen: 1/4 of screen size
7-mponehalfscreen: 1/2 of screen size
MediaPlayer1.ClickToPlay: whether Media Player can be started by clicking the play window

 

Http://blog.csdn.net/brouse8079/archive/2007/10/17/1829885.aspx

 

AxWindowsMediaPlayer common attributes

2. Ctlcontrols attributes

The Ctlcontrols attribute is a unique feature of AxWindowsMediaPlayer.

To attribute, this control has many common members.

(1) method play

Used to play multimedia files. The format is:

Form name. Control name. Ctlcontrols. play ()

For example, AxWindowsMediaPlayer1.Ctlcontrols. play ()

'Here, the default form name is Me.

(2) method pause

Used to pause a video. The format is as follows:

Form name. Control name. Ctlcontrols. pause ()

For example, AxWindowsMediaPlayer1.Ctlcontrols. pause ()

(3) method stop

The format of a multimedia file used to stop playing is as follows:

Form name. Control name. Ctlcontrols. stop ()

For example, AxWindowsMediaPlayer1.Ctlcontrols. stop ()

(4) fastforward Method

This interface is used to fast forward a video. The format is as follows:

Form name. Control name. Ctlcontrols. fastforward ()

For example:

AxWindowsMediaPlayer1.Ctlcontrols. forward ()

(5) fastreverse

Form name. Control name. Ctlcontrols. fastreverse ()

For example:

AxWindowsMediaPlayer1.Ctlcontrols. fastreverse

()

6. Attribute CurrentPosition

Used to obtain the current playback progress of a multimedia file. The value is a numerical value.

Format:

Form name. Control name. Ctlcontrols. currentPosition

D1 = AxWindowsMediaPlayer1.Ctlcontrols. currentPosi

Tion

D1 is an integer variable.

7. Attribute Duration

Used to obtain the total playback Time of the current multimedia file. The value is

Value Type in the following format:

Form name. Control name. currentMedia. duration

For example, d2

= AxWindowsMediaPlayer1.currentMedia. duration

D2 is an integer variable.
Controls. currentPositionString: string; when forward

Degree, string format. For example"

Attribute/method name: Description:
[Basic attributes]
URL: String; Specifies the media location, local or network address
UiMode: String; player interface mode, which can be Full, Mini,

None, Invisible
PlayState: integer; playback status, 1 = stopped, 2 = paused,

3 = playing, 6 = buffering, 9 = connecting, 10 = ready

Player. PlayStateChange + = new AxWMPLib. _ WMPOCXEvents_PlayStateChangeEventHandler (player_PlayStateChange );

Private void player_PlayStateChange (object sender, AxWMPLib. _ WMPOCXEvents_PlayStateChangeEvent e)
{
// Test the current state of the player and display a message for each state.
Switch (e. newState)
{
Case 0: // Undefined
CurrentStateLabel. Text = "Undefined ";
Break;

Case 1: // Stopped
CurrentStateLabel. Text = "Stopped ";
Break;

Case 2: // Paused
CurrentStateLabel. Text = "Paused ";
Break;

Case 3: // Playing
CurrentStateLabel. Text = "Playing ";
Break;

Case 4: // ScanForward
CurrentStateLabel. Text = "ScanForward ";
Break;

Case 5: // ScanReverse
CurrentStateLabel. Text = "ScanReverse ";
Break;

Case 6: // Buffering
CurrentStateLabel. Text = "Buffering ";
Break;

Case 7: // Waiting
CurrentStateLabel. Text = "Waiting ";
Break;

Case 8: // MediaEnded
CurrentStateLabel. Text = "MediaEnded ";
Break;

Case 9: // Transitioning
CurrentStateLabel. Text = "Transitioning ";
Break;

Case 10: // Ready
CurrentStateLabel. Text = "Ready ";
Break;

Case 11: // Reconnecting
CurrentStateLabel. Text = "Reconnecting ";
Break;

Case 12: // Last
CurrentStateLabel. Text = "Last ";
Break;

Default:
CurrentStateLabel. Text = ("Unknown State:" + e. newState. ToString ());
Break;
}
}

 

 

EnableContextMenu: Boolean; enable/disable context menu
FullScreen: boolean; Whether to display in full screen
Controls. currentPosition: double; current progress
Controls. fastForward; Fast Forward
Controls. fastReverse; fast return
Controls. next; next
Controls. previous; previous Curve
[Settings] wmp. settings // basic player settings
Settings. volume: integer; volume: 0-100
Settings. autoStart: Boolean; Whether to play automatically
Settings. mute: Boolean; mute
Settings. playCount: integer; number of playbacks
[CurrentMedia] wmp. currentMedia // current media attribute
CurrentMedia. duration: double; total media Length
CurrentMedia. durationString: string; total media Length

 

, String format. For example"
CurrentMedia. getItemInfo (const string );

Previous media information "Title" = media Title, "Author" = Art

Home, "Copyright" = Copyright information, "Description" = Media

Description, "Duration" = Duration (seconds), "FileSize" =

File size, "FileType" = file type, "sourceURL" = original

Start address
CurrentMedia. setItemInfo (const string );

Set media information for sexual names
CurrentMedia. name: string; same

CurrentMedia. getItemInfo ("Title ")
[CurrentPlaylist] wmp. currentPlaylist // specifies the current stream.

Put list attributes
CurrentPlaylist. count: integer; current playlist

Number of included media
CurrentPlaylist. Item [integer]; get or set the specified

Project media information. Its subattributes are the same as wmp. currentMedia.

 

Http://hi.baidu.com/spt1985/blog/item/544bcdde42a7015cccbf1a09.html

Source: http://www.cnblogs.com/xianyin05/archive/2009/05/05/1449967.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.