7 #ifndef MEDIA_AUDIOONLY
12 class MediaQtAV : public Media {
16 MediaQtAV(QObject *parent = nullptr);
17 #ifndef MEDIA_AUDIOONLY
18 void setRenderer(const QString &name);
19 QWidget *videoWidget();
20 void playSeparateAudioAndVideo(const QString &video, const QString &audio);
23 void setAudioOnly(bool value);
26 Media::State state() const;
28 void play(const QString &file);
33 void relativeSeek(qint64 ms);
36 void setBufferMilliseconds(qint64 value);
37 void setUserAgent(const QString &value);
39 void enqueue(const QString &file);
41 bool hasQueue() const;
43 qint64 position() const;
44 qint64 duration() const;
45 qint64 remainingTime() const;
48 void setVolume(qreal value);
50 bool volumeMuted() const;
51 void setVolumeMuted(bool value);
53 QString errorString() const;
56 void checkAboutToFinish(qint64 position);
57 void onMediaStatusChange(QtAV::MediaStatus status);
58 void onAVError(const QtAV::AVError &e);
61 QtAV::AVPlayer *createPlayer(bool audioOnly);
62 void connectPlayer(QtAV::AVPlayer *player);
63 void setCurrentPlayer(QtAV::AVPlayer *player);
64 void smoothSourceChange(const QString &file, const QString &externalAudio);
66 QtAV::AVPlayer *player1;
67 QtAV::AVPlayer *player2;
68 QtAV::AVPlayer *currentPlayer;
70 QQueue<QString> queue;
71 bool aboutToFinishEmitted = false;
72 QString lastErrorString;
74 #ifndef MEDIA_AUDIOONLY
75 QtAV::VideoRendererId rendererId;
77 bool audioOnly = false;