![]() |
Qt 6.x
The Qt SDK
|
#include <qmediaplayer_p.h>
Additional Inherited Members | |
![]() | |
typedef void(* | StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **) |
using | ConnectionDataPointer = QExplicitlySharedDataPointer< ConnectionData > |
![]() | |
static bool | removeConnection (Connection *c) |
static QObjectPrivate * | get (QObject *o) |
static const QObjectPrivate * | get (const QObject *o) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot) |
static QMetaObject::Connection | connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static bool | disconnect (const QObject *sender, int signal_index, void **slot) |
static bool | disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot) |
Definition at line 37 of file qmediaplayer_p.h.
|
default |
void QMediaPlayerPrivate::setError | ( | QMediaPlayer::Error | error, |
const QString & | errorString | ||
) |
Definition at line 119 of file qmediaplayer.cpp.
References emit, error, errorString, and QMediaPlayer::NoError.
Definition at line 133 of file qmediaplayer.cpp.
References QUrl::AssumeLocalFile, control, QTemporaryFile::createNativeFile(), QDir::currentPath(), QPlatformMediaPlayer::error(), file, QFile::fileName(), QUrl::fromLocalFile(), QUrl::fromUserInput(), QMediaPlayer::InvalidMedia, QUrl::isEmpty(), QString::isEmpty(), QPlatformMediaPlayer::mediaStatusChanged(), QDir::mkpath(), QFile::open(), QUrl::path(), qrcFile, qrcMedia, qWarning, QIODevice::read(), QIODeviceBase::ReadOnly, QIODevice::reset(), QMediaPlayer::ResourceError, QUrl::scheme(), QPlatformMediaPlayer::setMedia(), QPlatformMediaPlayer::streamPlaybackSupported(), QFileInfo::suffix(), tempFile, QDir::tempPath(), url, and QUrl::url().
void QMediaPlayerPrivate::setState | ( | QMediaPlayer::PlaybackState | ps | ) |
\qmltype MediaPlayer \instantiates QMediaPlayer
Adds media playback to a scene.
\inqmlmodule QtMultimedia
\qml Text { text: "Click Me!"; font.pointSize: 24; width: 150; height: 50;
MediaPlayer { id: playMusic source: "music.wav" audioOutput: AudioOutput {} } MouseArea { anchors.fill: parent onPressed: { playMusic.play() } } } \endqml
You can use MediaPlayer together with a MultiMedia::AudioOutput to play audio content, or you can use it in conjunction with a Multimedia::VideoOutput for rendering video.
\qml Item { MediaPlayer { id: mediaplayer source: "groovy_video.mp4" audioOutput: AudioOutput {} videoOutput: videoOutput }
VideoOutput { id: videoOutput anchors.fill: parent }
MouseArea { anchors.fill: parent onPressed: mediaplayer.play(); } } \endqml
Definition at line 100 of file qmediaplayer.cpp.
References emit, QMediaPlayer::PlayingState, and state.
void QMediaPlayerPrivate::setStatus | ( | QMediaPlayer::MediaStatus | status | ) |
Definition at line 112 of file qmediaplayer.cpp.
References emit.
|
inline |
Definition at line 65 of file qmediaplayer_p.h.
References control, emit, QPlatformMediaPlayer::setVideoSink(), and videoSink.
QList< QMediaMetaData > QMediaPlayerPrivate::trackMetaData | ( | QPlatformMediaPlayer::TrackType | s | ) | const |
Definition at line 212 of file qmediaplayer.cpp.
References QList< T >::append(), control, i, QPlatformMediaPlayer::trackCount(), and QPlatformMediaPlayer::trackMetaData().
QAudioOutput* QMediaPlayerPrivate::audioOutput = nullptr |
Definition at line 46 of file qmediaplayer_p.h.
QPlatformMediaPlayer* QMediaPlayerPrivate::control = nullptr |
Definition at line 43 of file qmediaplayer_p.h.
Referenced by setMedia(), setVideoSink(), and trackMetaData().
QMediaPlayer::Error QMediaPlayerPrivate::error = QMediaPlayer::NoError |
Definition at line 55 of file qmediaplayer_p.h.
Referenced by setError().
QString QMediaPlayerPrivate::errorString |
Definition at line 44 of file qmediaplayer_p.h.
Referenced by setError().
std::unique_ptr<QFile> QMediaPlayerPrivate::qrcFile |
Definition at line 50 of file qmediaplayer_p.h.
Referenced by setMedia().
QUrl QMediaPlayerPrivate::qrcMedia |
Definition at line 49 of file qmediaplayer_p.h.
Referenced by setMedia().
QUrl QMediaPlayerPrivate::source |
Definition at line 51 of file qmediaplayer_p.h.
QMediaPlayer::PlaybackState QMediaPlayerPrivate::state = QMediaPlayer::StoppedState |
Definition at line 54 of file qmediaplayer_p.h.
Referenced by setState().
Definition at line 52 of file qmediaplayer_p.h.
Definition at line 48 of file qmediaplayer_p.h.
QVideoSink* QMediaPlayerPrivate::videoSink = nullptr |
Definition at line 47 of file qmediaplayer_p.h.
Referenced by setVideoSink().