MediaPlayer

Since: BlackBerry 10.0.0

#include <bb/multimedia/MediaPlayer>

To link against this class, add the following line to your .pro file: LIBS += -lbbmultimedia

The MediaPlayer class provides the ability to control media playback.

This class is used by applications to control the playback of media sources. Creating multiple instances of this class allows you to play multiple media sources at the same time.

A playback example in C++:

    bb::multimedia::MediaPlayer mp(this);
    mp.setSourceUrl("asset:///media.mp3");

On user events...

    void onPlay() {
        mp.play(); // automatically prepares
    }

    void onStop() {
        mp.stop();
    }

A playback example in QML:

import bb.multimedia 1.0
// ...

Page {
    Container {
        // ...

        attachedObjects: [
            MediaPlayer {
                id: player
                sourceUrl: "asset:///media.mp4"

                // Set these properties for video
                videoOutput: VideoOutput.PrimaryDisplay
                windowId: fwcVideoSurface.windowId

                onMediaStateChanged: {
                    switch (player.mediaState) {
                        case MediaState.Unprepared:
                            break;
                        case MediaState.Prepared:
                            break;
                        // ...
                    }
                }
            }
        ]


        ForeignWindowControl {
            id: fwcVideoSurface
            windowId: "myVideoSurface"
            visible: boundToWindow

            updatedProperties: WindowProperty.Size |
                               WindowProperty.Position |
                               WindowProperty.Visible
        }

        // ...

        Button {
            id: btnPlay
            text: "Play"
            onClicked: {
                if (player.play() != MediaError.None) {
                    // Your error handling code here.
                }
            }
        }

        Button {
            id: btnStop
            text: "Stop"
            onClicked: {
                player.stop();
            }
        }

        Button {
            id: btnReset
            text: "Reset"
            onClicked: {
                player.reset();
            }
        }
    }
}
Permissions:

The application does not need any permission to play audio from its sandbox but would need the access_shared permission in order to access the shared content areas on the device.


Overview

Public Functions Index

MediaPlayer (QObject *parent=0)
virtual ~MediaPlayer ()
unsigned intaudioManagerHandle () const
bb::multimedia::AudioOutput::TypeaudioOutput () const
boolautoPause () const
bb::multimedia::BufferStatus::TypebufferStatus () const
unsigned intduration () const
boolisSeekable () const
bb::multimedia::MediaError::TypemediaError () const
bb::multimedia::MediaState::TypemediaState () const
QVariantMapmetaData () const
unsigned intposition () const
bb::multimedia::RepeatMode::TyperepeatMode () const
bb::multimedia::MediaError::TypesetAudioManagerHandle (unsigned int audioManagerHandle)
QUrlsourceUrl () const
doublespeed () const
unsigned intstatusInterval () const
unsigned inttrack () const
unsigned inttrackCount () const
QSizevideoDimensions () const
bb::multimedia::VideoOutput::TypevideoOutput () const
doublevolume () const
QStringwindowGroupId () const
QStringwindowId () const

Signals Index

voidaudioManagerHandleChanged (unsigned int audioManagerHandle)
voidaudioOutputChanged (bb::multimedia::AudioOutput::Type audioOutput)
voidautoPauseChanged (bool autoPause)
voidbuffering (double percentage)
voidbufferStatusChanged (bb::multimedia::BufferStatus::Type bufferStatus)
voiddurationChanged (unsigned int duration)
voiderror (bb::multimedia::MediaError::Type mediaError, unsigned int position)
voidmediaStateChanged (bb::multimedia::MediaState::Type mediaState)
voidmetaDataChanged (const QVariantMap &metaData)
voidplaybackCompleted ()
voidpositionChanged (unsigned int position)
voidrepeatModeChanged (bb::multimedia::RepeatMode::Type repeatMode)
voidseekableChanged (bool seekable)
voidsourceUrlChanged (const QUrl &sourceUrl)
voidspeedChanged (double speed)
voidstatusIntervalChanged (unsigned int statusInterval)
voidtrackChanged (unsigned int track)
voidtrackCountChanged (unsigned int trackCount)
voidvideoDimensionsChanged (const QSize &videoDimensions)
voidvideoOutputChanged (bb::multimedia::VideoOutput::Type videoOutput)
voidvolumeChanged (double volume)
voidwindowGroupIdChanged (const QString &windowGroupId)
voidwindowIdChanged (const QString &windowId)

Properties

QVariant audioManagerHandle

Represents the handle of an externally managed audio manager.

Since:

BlackBerry 10.0.0

bb::multimedia::AudioOutput::Type audioOutput

Represents the audio output for the media source.

The audio output can be AudioOutput::None or AudioOutput::Default.

Since:

BlackBerry 10.0.0

bool autoPause

Represents the auto pause status of the player.

Since:

BlackBerry 10.0.0

bb::multimedia::BufferStatus::Type bufferStatus[read-only]

Represents the current buffer status.

The buffer status can be BufferStatus::Idle, BufferStatus::Buffering, or BufferStatus::Playing.

Since:

BlackBerry 10.0.0

QVariant duration[read-only]

Represents the length of time of the current track, when available.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type mediaError[read-only]

Represents the last runtime error code notified from the error() signal.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaState::Type mediaState[read-only]

Represents the current media state.

Since:

BlackBerry 10.0.0

QVariantMap metaData[read-only]

Represents the metadata associated with the current track.

Since:

BlackBerry 10.0.0

QVariant position[read-only]

Represents the position in milliseconds of the active track.

Since:

BlackBerry 10.0.0

bb::multimedia::RepeatMode::Type repeatMode

Represents the current repeat mode for the player.

The repeat mode of the player can be RepeatMode::None, RepeatMode::Track, or RepeatMode::All.

Since:

BlackBerry 10.0.0

bool seekable[read-only]

Represents the current seek status for the current track.

Since:

BlackBerry 10.0.0

QUrl sourceUrl

Represents the URL of the current media source.

This media source is guaranteed to be valid when the player has successfully acquired the necessary resources to play it. Otherwise, the acquisition of media resources by the player will fail.

Since:

BlackBerry 10.0.0

double speed

Represents the playback speed of the track that is currently playing.

All speed values are relative to a value of 1.0, which is considered normal playback speed. A value of zero means the player is paused. Positive speed values play forward and negative speed values play in reverse.

Since:

BlackBerry 10.0.0

QVariant statusInterval

Represents the requested amount of time in milliseconds between regular status updates.

Generally this setting is applied to position and buffering updates. If a track change occurs within the interval, it is still signaled immediately.

Since:

BlackBerry 10.0.0

QVariant track[read-only]

Represents the current track number in the playlist.

The value of track is always 1 in the case of a single file playback.

Since:

BlackBerry 10.0.0

QVariant trackCount[read-only]

Represents the total number of seekable tracks in the player.

Since:

BlackBerry 10.0.0

QSize videoDimensions[read-only]

Represents the video height and width dimensions of the media source.

This value is available as soon as playback begins.

Since:

BlackBerry 10.0.0

bb::multimedia::VideoOutput::Type videoOutput

Represents the video output device for the media source.

The video output device can be VideoOutput::None, VideoOutput::PrimaryDisplay, or VideoOutput::SecondaryDisplay.

Since:

BlackBerry 10.0.0

double volume

Represents the player channel volume.

QString windowGroupId

Represents the screen window group ID to use when creating the video surface.

Since:

BlackBerry 10.0.0

QString windowId

Represents the screen window ID to use when creating the video surface.

Since:

BlackBerry 10.0.0

Public Functions

MediaPlayer (

MediaPlayer class constructor.

Parameters
parent

An optional parameter to specify the parent of this QObject.

Since:

BlackBerry 10.0.0

virtual~MediaPlayer ()

Destructor.

Since:

BlackBerry 10.0.0

unsigned int audioManagerHandle ()

Returns the handle of an externally managed audio manager.

Return:

Returns the handle of an externally managed audio manager or zero if managed internally.

Since:

BlackBerry 10.0.0

bb::multimedia::AudioOutput::Type audioOutput ()

Returns the audio output used for audio playback.

The values for audio output can either be AudioOutput::Default or AudioOutput::None.

Return:

Returns the current audio output.

Since:

BlackBerry 10.0.0

bool autoPause ()

Provides the auto pause status of the player.

When auto pause is enabled, the platform will be allowed to automatically pause the player under some circumstances. In the case where playback is occurring over a headset, and the headset is removed, playback will be paused rather than continuing over the speaker.

Return:

Returns true if auto pause is enabled, and false otherwise.

Since:

BlackBerry 10.0.0

bb::multimedia::BufferStatus::Type bufferStatus ()

Returns the current buffer status.

The buffer status can be BufferStatus::Idle, BufferStatus::Buffering, or BufferStatus::Playing.

Return:

Returns the current buffer status.

Since:

BlackBerry 10.0.0

unsigned int duration ()

Provides the duration of a currently prepared track.

The duration of the current track is available once prepare() has been called, and the player has successfully acquired the resources to play the current track. The duration of the current track is no longer available when stop() has been called. In any other case, a duration of zero is returned.

Return:

Returns the duration in milliseconds of the current track, and zero otherwise.

Since:

BlackBerry 10.0.0

bool isSeekable ()

Provides the seek status of the current track.

If playback for the current track has the ability to seek to an arbitrary location, this function will return true. Otherwise tracks are not seekable by default. When the track is seekable, the seekableChanged() signal is emitted.

Return:

Returns true if the track is seekable, and false otherwise.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type mediaError ()

Used to retrieve the last recording error.

If the error() signal has been emitted, this property will return the last error type, otherwise MediaError::None is returned. This property is automatically reset to MediaError::None when recording starts.

Return:

Returns the last playback media error.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaState::Type mediaState ()

Used to determine the current media state.

If prepare() has not been called or the recording has been stopped, MediaState::Unprepared will be returned. If actively recording, MediaState::Started will be returned. If paused, MediaState::Paused will be returned.

Return:

Returns the current media state.

Since:

BlackBerry 10.0.0

QVariantMap metaData ()

Used to retrieve the metadata for the track that is currently playing.

Return:

Returns the metadata for the track that is currently playing.

Since:

BlackBerry 10.0.0

unsigned int position ()

Provides the playback position of the current track.

The playback position of the current track changes while the player is playing, or after a successful call to the seekTime() or seekPercent() functions. A value of zero is returned when the player has not yet acquired the resources to play the media source, or after it has been stopped by a call to the stop() function.

Return:

Returns the playback position in milliseconds of the current track.

Since:

BlackBerry 10.0.0

bb::multimedia::RepeatMode::Type repeatMode ()

Retrieves the current playback repeat mode as set by a call from setRepeatMode().

Return:

Returns the current playback repeat mode.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type setAudioManagerHandle (
  • unsigned intaudioManagerHandle)

Sets the handle of an externally managed audio manager.

Changing this property while the player is prepared will cause the audio management to switch seamlessly to the new audio manager. The original owner of the audio manager handle is responsible for releasing it.

Parameters
audioManagerHandle

The audio manager handle to use.

Return:

Returns the last playback media error.

Since:

BlackBerry 10.0.0

QUrl sourceUrl ()

Retrieves the source URL for the player as set by a call from setSourceUrl().

Return:

Returns the source URL for the player.

Since:

BlackBerry 10.0.0

double speed ()

Retrieves the current playback speed as set by a call from setSpeed().

Return:

Returns the current playback speed, as described by setSpeed().

Since:

BlackBerry 10.0.0

unsigned int statusInterval ()

Represents the requested amount of time in milliseconds between regular status updates.

Generally this setting is applied to position and buffering updates. If a track change occurs within the interval, it is still signaled immediately. By default the requested update status interval is 1000 milliseconds.

Return:

Returns the current requested status interval in milliseconds, as described by setStatusInterval().

Since:

BlackBerry 10.0.0

unsigned int track ()

Returns the current track in a playlist.

Single track playback will have a value of 1, otherwise the track number of the current track in the playlist is returned.

Return:

Returns the current player track number.

Since:

BlackBerry 10.0.0

unsigned int trackCount ()

Retrieves the number of tracks available to the player.

This value can be used to specify a playlist file rather than a single track as the media source for the player. This function returns 1 when a single track is specified as the media source.

Return:

Returns the number of tracks available to the player.

Since:

BlackBerry 10.0.0

QSize videoDimensions ()

Retrieves the video dimensions for the current track when available.

Return:

Returns the video dimensions when available.

Since:

BlackBerry 10.0.0

bb::multimedia::VideoOutput::Type videoOutput ()

Retrieves the video output of the screen used for video rendering.

The screen window is created during preparation if the videoOutput is set to either VideoOutput::PrimaryDisplay or VideoOutput::SecondaryDisplay. If the value for videoOutput is set to VideoOutput::None then the screen will be destroyed. The window ID set using setWindowId() is returned.

Return:

Returns the current video output.

Since:

BlackBerry 10.0.0

double volume ()

Retrieves the channel volume for this instance of the player.

Return:

Returns the current volume in the range of 0.0 to 1.0.

QString windowGroupId ()

Retrieves the window group ID of the video screen.

Return:

Returns the window group ID of the screen used for video rendering. The screen window is created during preparation if the windowId property is set and the videoOutput is not VideoOutput::None. The window group ID set using setWindowGroupId() will be returned regardless of state.

Since:

BlackBerry 10.0.0

QString windowId ()

Retrieves the window ID of the video screen.

Return:

Returns the window ID of the screen used for video rendering. The screen window is created during preparation if this property is set and the videoOutput is not VideoOutput::None. The window ID set using setWindowId() will be returned regardless of state.

Since:

BlackBerry 10.0.0

Public Slots

bb::multimedia::MediaError::Type nextTrack ()

Moves playback to the next track in the playlist.

If the media source is a playlist, this function will move to the next track. On success it will result in a trackChanged() signal.

If the media source is not a playlist then calling this function does nothing.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type pause ()

Pauses a currently playing track.

This function is equivalent to calling setSpeed(0.0). On success a paused() signal will be emitted. Call play() or setSpeed() with a non-zero value to restart playback.

Calling this function while playback is already paused does nothing.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type play ()

Starts playback of a track.

This function will start playback of a track. The player will be prepared triggering a preparedChanged() signal if needed. If the player is paused it will be resumed. If the player is stopped it will restart from the beginning. Successful playback will emit a playing() signal.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type prepare ()

Acquires resources necessary for playback without playing the track.

Once all the resources have been acquired for playback, a preparedChanged() signal will be emitted. This process will then move the player into the stopped state. The playback speed will be set to 1.0, regardless of any previous activity by the player.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type previousTrack ()

Moves playback to the previous track in the playlist.

If the media source is a playlist, this function will move to the previous track. On success it will result in a trackChanged() signal.

If the media source is not a playlist then calling this function does nothing.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type reset ()

Frees all resources previously acquired for playback.

Calling this function has no effect if the player is already in the unprepared state. Otherwise all acquired resources are freed, stopping the player if needed, and the state is moved to unprepared.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type seek (
  • unsigned inttrack,
  • unsigned intposition )

Seeks to the track and position nearest to the given time.

This function will seek to the specified track and attempt to also seek to the given position. On success the trackChanged() signal will be emitted if the track is different than the current track, and the positionChanged() signal will be emitted with the new location.

Parameters
track

The one-based index of the track to seek to.

position

The position in milliseconds to attempt to seek to.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type seekPercent (
  • doublepercentage)

Seeks to the position nearest to the given duration percentage.

This function will attempt to seek to the given duration percentage. On success the positionChanged() signal will be emitted with the new location, or an error() signal is emitted.

Parameters
percentage

The percentage of duration to attempt to seek to. Valid values are 0.0 to 1.0.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type seekTime (
  • unsigned intposition)

Seeks to the position nearest to the given time.

This function will attempt to seek to the given position. On success the positionChanged() signal will be emitted with the new location.

Parameters
position

The position in milliseconds to attempt to seek to.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type seekTrack (
  • unsigned inttrack)

Changes the current track to the specified index.

This function will cause the player to seek to the specified track and will result in a trackChanged() signal.

Parameters
track

The one-based index of the track to seek to.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type setAudioOutput (

Used to set the audio output for the player.

This function sets the audio output for the player. This can be either AudioOutput::Default or AudioOutput::None.

Parameters
audioOutput

The specified audio output type.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type setAutoPause (
  • boolautoPause)

Used to set the auto pause functionality for the player.

This function enables or disables the auto pause functionality of the player. If enabled, the platform will be allowed to auto pause playback. In the case where playback is occuring over a headset, and the headset is removed, playback will be paused rather than continuing over the speaker.

Parameters
autoPause

If true auto pause is enabled, if false auto pause is disabled.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type setRepeatMode (

Used to set the value of the repeat mode for the player.

This function sets the repeat mode for the player. When set to track, the player will continuously play and repeat the current track. When set to all, the player will play all tracks in a playlist, then repeat the entire playlist once all tracks have been played. When set to none, no repetition will occur.

Parameters
repeatMode

The specified repeat mode. The value can be RepeatMode::None, RepeatMode::Track, or RepeatMode::All.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type setSourceUrl (

Sets the URI to be used as the media source.

This function sets the media source for the player. The URL can point to a single track, or a playlist. If the player has acquired the resources to play the media source and this value is empty, then the player will stop and release any resources that it currently holds.

Parameters
url

A URL string pointing to a track or a playlist to use as a media source.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type setSpeed (
  • doublespeed)

Sets the playback speed of the player.

Normal playback speed is 1.0, and it is the default speed when the player is prepared. The player is prepared when it has acquired the necessary resources to play the media source.

Setting this value to 0.0 is equivalent to pausing playback and will emit the paused() signal.

Conversely, if this call successfully changes the playback speed from 0.0 to a non-zero speed, then the player will move from paused to playing and the playing() signal will be emitted.

Any value between 0.0 and 1.0 is slow-forward playback and values above 1.0 will result in fast-forward playback corresponding to the value. For example, a value of 0.5 will playback at half speed, and a value of 2.0 will result in twice normal playback speed.

Negative values result in reverse playback, if supported by the media source. If reverse playback is not supported, calling this function with a negative value will have no effect.

If this call successfully changes the playback speed, even when the player is effectively stopped or started as a result of the call, the speedChanged() signal is always emitted by the player.

A call to setSpeed() when the player is prepared or stopped will result in playback at the new speed once play() is called. If the speed is set to 0.0 when stopped then a call to play() will immediately transition the player to the paused state, and will emit the paused() signal.

Parameters
speed

The playback speed.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type setStatusInterval (
  • unsigned intstatusInterval)

Represents the requested amount of time in milliseconds between regular status update.

Generally this setting is applied to position and buffering updates. If a track change occurs within the interval, it is still signaled immediately.

Parameters
statusInterval

The requested status interval in milliseconds.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type setVideoOutput (

Sets the video output device to be used for playback.

This function sets the video output on a player. If the player is prepared and the video output is being set to or from none, the player will be unprepared. It is up to the user to call prepare() or play(). Switching between primary and secondary video outputs on a prepared player does not interrupt playback since the video device is already acquired.

Parameters
videoOutput

The video output device to be used.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type setVideoSourceRect (
  • intx,
  • inty,
  • unsigned intwidth,
  • unsigned intheight )

Sets the video source rectangle to be used for display on the video surface.

The values for this rectangle must be less than or equal to the video dimensions. By default the value of this rectangle is equal to the video dimensions. The values of this rectangle can be used to simulate zooming into a video.

Parameters
x

The X coordinate of the video rectangle.

y

the Y coordinate of the video rectangle.

width

The width of the video source rectangle.

height

The height of the video source rectange.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type setVolume (
  • doublevolume)

Sets the player channel volume to the given percentage.

The channel volume is different than the master volume, which is controlled independently by the platform audio manager.

Parameters
volume

The percentage of volume to set. Valid values are 0.0 to 1.0.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

void setWindowGroupId (

Sets the window group ID to use when the video output device is set to either primary or secondary.

This function sets the window group ID to use when the player creates a screen to use for the video surface.

Parameters
windowGroupId

The screen window group ID name to use.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

void setWindowId (

Sets the window ID to use when the video output device is set to either primary or secondary.

This function sets the window ID to use when the player creates a screen to use for the video surface.

Parameters
windowId

The screen window ID name to use.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

bb::multimedia::MediaError::Type stop ()

Stops the player and moves to the stopped state.

This function will move the player into the stopped state. Calling play() will result in the media commencing playing back from the start. This function will result in the stopped() signal being emitted. The stopped() signal indicates that the player is in the stopped state.

Return:

Returns MediaError::None on success, otherwise a specific media error code.

Since:

BlackBerry 10.0.0

Signals

void audioManagerHandleChanged (
  • unsigned intaudioManagerHandle)

This signal is emitted when the externally managed audio manager has changed.

Parameters
audioManagerHandle

The audio manager handle.

Since:

BlackBerry 10.0.0

void audioOutputChanged (

This signal is emitted when the audio output has changed.

In response to setAudioOutput() this signal will be emitted to notify of the change.

Parameters
audioOutput

The current audio output.

Since:

BlackBerry 10.0.0

void autoPauseChanged (
  • boolautoPause)

This signal is emitted when the audio pause property has changed.

Parameters
autoPause

The current auto pause property value.

Since:

BlackBerry 10.0.0

void buffering (
  • doublepercentage)

This signal is emitted when the player is buffering.

When the player is buffering, this signal will be emitted indicating what percentage of the buffer has been filled. The player will still be in the playing state.

Parameters
percentage

The percentage of the buffer filled (0 - 1.0).

Since:

BlackBerry 10.0.0

void bufferStatusChanged (

This signal is emitted when the player buffer status has changed.

The values for this signal can be BufferStatus::Idle, BufferStatus::Buffering, or BufferStatus::Playing.

Parameters
bufferStatus

The current buffer status.

Since:

BlackBerry 10.0.0

void durationChanged (
  • unsigned intduration)

This signal is emitted when the track duration is known.

Retrieving the duration of some tracks may not be known when the track is changed. This signal will notify of the duration when available.

Parameters
duration

The total duration of the track in milliseconds.

Since:

BlackBerry 10.0.0

void error (

This signal is emitted when an error occurs during any operation on the MediaPlayer().

When an error occurs during playback, this signal is emitted with the error code, as well as the position in the recording where the error occurred.

Parameters
mediaError

The playback media error.

position

The position of the player when the error occurred.

Since:

BlackBerry 10.0.0

void mediaStateChanged (

This signal is emitted when the state of the media has been changed.

Parameters
mediaState

The current media state.

Since:

BlackBerry 10.0.0

void metaDataChanged (

This signal is emitted when the metadata has been parsed.

Parameters
metaData

The parsed metadata.

Since:

BlackBerry 10.0.0

void playbackCompleted ()

This signal is emitted when all tracks have completed playback.

Since:

BlackBerry 10.0.0

void positionChanged (
  • unsigned intposition)

This signal is emitted when the track playback position has changed.

This signal will be emitted approximately once per second in response to a call to seek() or when normal status updates occur.

Parameters
position

The current track playback position in milliseconds.

Since:

BlackBerry 10.0.0

void repeatModeChanged (

This signal is emitted when the player repeat value has changed.

Possible values:
Parameters
repeatMode

The new repeat value that the player has changed to.

Since:

BlackBerry 10.0.0

void seekableChanged (
  • boolseekable)

This signal is emitted when the known seek ability of a track changes.

Parameters
seekable

If true the position of the current track is seekable, if false the position of the current track is not seekable.

Since:

BlackBerry 10.0.0

void sourceUrlChanged (
  • const QUrl &sourceUrl)

This signal is emitted when the player media source has been changed.

This signal is emitted when the media source for the player has been changed in response to a call to setSource().

Parameters
sourceUrl

The source URL for the player.

Since:

BlackBerry 10.0.0

void speedChanged (
  • doublespeed)

This signal is emitted when the track playback speed has been changed.

This signal is emitted in response to a call to setSpeed() or pause() while the player is in the playing state. This signal is also emitted in response to a call to play() while the player is in the paused state.

Parameters
speed

The playback speed relative to normal playback of 1.0.

Since:

BlackBerry 10.0.0

void statusIntervalChanged (
  • unsigned intstatusInterval)

This signal is emitted when the requested status interval has been changed.

This signal is emitted in response to a call to setStatusInterval().

Parameters
statusInterval

The requested status interval in milliseconds.

Since:

BlackBerry 10.0.0

void trackChanged (
  • unsigned inttrack)

This signal is emitted when the track has changed.

This signal is emitted when the player has acquired the necessary resources for playback, and the track has changed.

Parameters
track

The current track index.

Since:

BlackBerry 10.0.0

void trackCountChanged (
  • unsigned inttrackCount)

This signal is emitted when the track count has changed.

This signal is emitted when the player has acquired the necessary resources for playback, and the track count has changed.

Parameters
trackCount

The number of tracks available to the player.

Since:

BlackBerry 10.0.0

void videoDimensionsChanged (
  • const QSize &videoDimensions)

This signal is emitted when the video dimensions have changed.

This signal is emitted once the player has determined the dimensions of the video component or they have changed.

Parameters
videoDimensions

A size object containing both the video height and width.

Since:

BlackBerry 10.0.0

void videoOutputChanged (

This signal is emitted when the video output has changed.

In response to setVideoOutput() this signal will be emitted to notify of the change.

Parameters
videoOutput

The current video output.

Since:

BlackBerry 10.0.0

void volumeChanged (
  • doublevolume)

This signal is emitted when the player channel volume has been changed.

This signal is emitted in response to a call to setVolume().

Parameters
volume

The player channel volume in range of 0.0 to 1.0.

void windowGroupIdChanged (

This signal is emitted when the window group ID has changed.

In response to setWindowGroupId() this signal will be emitted to notify of the change.

Parameters
windowGroupId

The new window group ID to use for the video output.

Since:

BlackBerry 10.0.0

void windowIdChanged (

This signal is emitted when the window ID has changed.

In response to setWindowId() this signal will be emitted to notify of the change.

Parameters
windowId

The new window ID to use for the video output.

Since:

BlackBerry 10.0.0

Last modified: 2014-03-13

comments powered by Disqus