MediaPlayer QML Type

Provides an interface to control a media player. More...

Import Statement: import QtInterfaceFramework.Media 1.0
In C++: QIfMediaPlayer
Inherits:

AbstractFeature

Properties

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

backendUpdatesEnabled : bool


configurationId : string


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:

ConstantDescription
NormalEach item in the queue is played in sequential order. Usually the playback stops when the end of the queue is reached.
RepeatTrackAlways 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.
RepeatAllWhen the end of the queue is reached, the first item starts to play.
ShuffleThe 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:

ConstantDescription
PlayingThe media player is currently playing an item.
PausedThe playback is paused and can be continued at the same position.
StoppedThe 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>


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.

See also play() and stop().


play()

Starts to play the current track. If the playQueue is empty it's up to the backend to decide what to do.

See also pause() and stop().


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.

See also play() and pause().


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