TTMSFNCWXAudioPlayer Class
Component that plays an audio source and publishes its playback options, transport state, and notification events for design-time use.
API unit family: TMSFNCWXAudioPlayer
Inherits from: TTMSFNCWXCustomAudioPlayer
Syntax
TTMSFNCWXAudioPlayer = class(TTMSFNCWXCustomAudioPlayer)
Remarks
Set URL to the audio source and use the published playback properties and events to control and observe play, pause, seeking, volume, and rate changes.
Properties
| Name | Description |
|---|---|
| AutoPlay | When True, playback starts automatically once the source is loaded. Defaults to False. (inherited from TTMSFNCWXCustomMediaPlayer) |
| Controls | When True, the built-in transport controls are shown. Defaults to True. (inherited from TTMSFNCWXCustomMediaPlayer) |
| CurrentTime | Current playback position, in seconds. Assign a value to seek. (inherited from TTMSFNCWXCustomMediaPlayer) |
| Duration | Gets the total length of the loaded audio source, in seconds. (inherited from TTMSFNCWXCustomAudioPlayer) |
| IsPlaying | Indicates whether the audio source is currently playing. (inherited from TTMSFNCWXCustomAudioPlayer) |
| Loop | When True, playback restarts from the beginning once it reaches the end. Defaults to False. (inherited from TTMSFNCWXCustomMediaPlayer) |
| Muted | When True, audio output is muted while playback continues. Defaults to False. (inherited from TTMSFNCWXCustomMediaPlayer) |
| PlayBackRate | Playback speed multiplier, where 1.0 is normal speed. (inherited from TTMSFNCWXCustomMediaPlayer) |
| Preload | Controls how much of the source is preloaded before playback. Defaults to plAuto. (inherited from TTMSFNCWXCustomMediaPlayer) |
| URL | The address of the media source to play. (inherited from TTMSFNCWXCustomMediaPlayer) |
| Volume | Output volume in the range 0.0 (silent) to 1.0 (full volume). (inherited from TTMSFNCWXCustomMediaPlayer) |
Methods
| Name | Description |
|---|---|
| ForwardAudio | Advances the current playback position forward by the specified number of seconds. (inherited from TTMSFNCWXCustomAudioPlayer) |
| Pause | Pauses playback at the current position. (inherited from TTMSFNCWXCustomMediaPlayer) |
| Play | Starts or resumes playback of the current source. (inherited from TTMSFNCWXCustomMediaPlayer) |
| RewindAudio | Moves the current playback position backward by the specified number of seconds. (inherited from TTMSFNCWXCustomAudioPlayer) |
Events
| Name | Description |
|---|---|
| OnAudioInitialized | Occurs after the underlying audio element has been created and is ready to accept playback commands. (inherited from TTMSFNCWXCustomAudioPlayer) |
| OnEnded | Occurs when playback reaches the end of the source. (inherited from TTMSFNCWXCustomMediaPlayer) |
| OnError | Occurs when the source fails to load or play. (inherited from TTMSFNCWXCustomMediaPlayer) |
| OnMetaDataLoaded | Occurs when the source metadata, such as duration, has been loaded. (inherited from TTMSFNCWXCustomMediaPlayer) |
| OnPause | Occurs when playback is paused. (inherited from TTMSFNCWXCustomMediaPlayer) |
| OnPlay | Occurs when playback starts. (inherited from TTMSFNCWXCustomMediaPlayer) |
| OnRateChange | Occurs when the playback rate changes. (inherited from TTMSFNCWXCustomMediaPlayer) |
| OnTimeUpdate | Occurs repeatedly while playback advances, reporting the current position. (inherited from TTMSFNCWXCustomMediaPlayer) |
| OnVolumeChange | Occurs when the volume or mute state changes. (inherited from TTMSFNCWXCustomMediaPlayer) |