MediaPlayer QML Type
Provides an interface to control a media player. More...
Import Statement: | import QtInterfaceFramework.Media 1.0 |
In C++: | QIfMediaPlayer |
Inherits: |
Properties
- asynchronousBackendLoading : bool
(since 6.8)
- backendUpdatesEnabled : bool
(since 6.8)
- configurationId : string
(since 6.5)
- currentTrack : object
- discoveryMode : enumeration
- discoveryResult : enumeration
- duration : int
- isInitialized : bool
- isValid : bool
- muted : bool
- playMode : enumeration
- playQueue : PlayQueue
- playState : enumeration
- position : int
- preferredBackends : list<string>
(since 6.5)
- serviceObject : ServiceObject
- volume : int
Methods
Detailed Description
The MediaPlayer provides methods to control a media player. This media player can be local or even a remote device you are connected to e.g. over bluetooth.
By default the autoDiscovery is turned to Automatic for this feature and most likely will connect to a local media player instance.
Uses qtifmedia
as configurationId for InterfaceFrameworkConfiguration based settings.
Property Documentation
asynchronousBackendLoading : bool [since 6.8]
This property was introduced in Qt 6.8.
backendUpdatesEnabled : bool [since 6.8]
This property was introduced in Qt 6.8.
configurationId : string [since 6.5]
This property was introduced in Qt 6.5.
currentTrack : object [read-only]
Holds the current track represented as QVariant.
Note: This will be replaced by soon.
discoveryMode : enumeration
discoveryResult : enumeration [read-only]
duration : int [read-only]
Holds the total duration of the current song in seconds.
isInitialized : bool [read-only]
isValid : bool [read-only]
muted : bool
This property holds whether the audio output is muted.
See also volume.
playMode : enumeration
Holds the current playback mode of the media player. Available values are:
Constant | Description |
---|---|
Normal | Each item in the queue is played in sequential order. Usually the playback stops when the end of the queue is reached. |
RepeatTrack | Always repeat the current item. It should still be possible to change the current item using next() and previous(), but this depends on the implementation of the backend. |
RepeatAll | When the end of the queue is reached, the first item starts to play. |
Shuffle | The item in the queue are played in an random order. |
playQueue : PlayQueue [read-only]
Holds the play queue of this media player.
See also PlayQueue.
playState : enumeration [read-only]
Holds the current playback state of the media player. Available values are:
Constant | Description |
---|---|
Playing | The media player is currently playing an item. |
Paused | The playback is paused and can be continued at the same position. |
Stopped | The playback hasn't been started yet. Starting it, will always start from the beginning. |
position : int
Holds the position of the current song of the media player in seconds.
preferredBackends : list<string> [since 6.5]
This property was introduced in Qt 6.5.
serviceObject : ServiceObject
volume : int
Holds the sound volume level (0..100)
See also muted.
Method Documentation
next()
Skips to the next track in the playQueue.
See also playMode.
pause()
Pauses the currently ongoing playback.
play()
Starts to play the current track. If the playQueue is empty it's up to the backend to decide what to do.
previous()
Skips to the previous track in the playQueue.
See also playMode.
seek(offset)
Seeks into the current track using offset.
The offset can be positive or negative to either seek forward or backward. A successful seek will result in a change of the position property.
enumeration startAutoDiscovery()
stop()
Stops the currently ongoing playback.
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.