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. |