Detailed Description
The QMediaContent class is used to prepare a media resource for playing in Qtopia.
A QMediaContent is constructed with a URL, that may refer to a local or remote resource, or a QContent that refers to a local media resource.
If the QMediaContent is constructed with a valid piece of media a signal will be emitted with for each of the controls available to manipulate that media.
During the life-time of a piece of media, the controls available may change, due to different formats being available in the content, each time a control is usable or unusable a controlAvailable or controlUnavailable signal will be emitted.
If there is an error preparing the media resource, the mediaError signal will be emitted, with a QString detailing the error information.
Example:
{
QContent beep = findBeepSound();
m_mediaContent = new QMediaContent(beep);
connect(mediaContent, SIGNAL(controlAvailable(QString)),
this, SLOT(mediaControlAvailable(QString)));
}
void mediaControlAvailable(QString const& id)
{
if (id == QMediaControl::name())
{
m_mediaControl = new QMediaControl(m_mediaContent);
m_mediaControl->start();
}
}
Member Function Documentation
QMediaContent::QMediaContent ( QUrl const & url, QString const & domain = QLatin1String( "Media" ), QObject * parent = 0 )
Create a QMediaContent from a URL.
The URL may point to a local or remote media resource.
The url paramter is a URL representing the location of the media content. The domain is the audio domain in which this media content should exist. The parent is the Parent QObject.
QMediaContent::QMediaContent ( QContent const & content, QString const & domain = QLatin1String( "Media" ), QObject * parent = 0 )
Create a QMediaContent from a QContent.
This creates a QMediaContent from a local resource known by the Document System.
The content is the QContent representing the location of the media content. The domain is the audio domain in which this media content should exist. The parent is the Parent QObject.
QMediaContent::~QMediaContent ()
Destroy the QMediaContent object.
void QMediaContent::controlAvailable ( const QString & id ) [signal]
Signals that a control with identity id is now available for use.
void QMediaContent::controlUnavailable ( const QString & id ) [signal]
Signals that a control with identity id is no longer usable.
QStringList QMediaContent::controls () const
Return a list of Controls that this Media supports.
void QMediaContent::mediaError ( const QString & mediaError ) [signal]
Signals that there was an error trying to access a piece of media content. Details of the error are contained in the mediaError parameter.
void QMediaContent::playContent ( QUrl const & url, QString const & domain = "Media" ) [static]
Play immediately, and to the end, the content specified by url in the media domain.
void QMediaContent::playContent ( QContent const & content, QString const & domain = "Media" ) [static]
This is an overloaded member function, provided for convenience.
Play immediately, and to the end, the content specified by content in the media domain.
QStringList QMediaContent::supportedMimeTypes () [static]
Returns a list of Mime Types handled by the Qt Extended Media system.
QStringList QMediaContent::supportedUriSchemes ( QString const & mimeType ) [static]
Returns a list of URI schemes that can be used in combination with the mimeType.