-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoverlayvideoplayer.h
47 lines (37 loc) · 1.08 KB
/
overlayvideoplayer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef OVERLAYVIDEOPLAYER_H
#define OVERLAYVIDEOPLAYER_H
#include <QWidget>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsVideoItem>
#include <QtMultimedia/QMediaPlayer>
#include <QtMultimedia/QAudioOutput>
class OverlayVideoPlayer : public QWidget
{
Q_OBJECT
QGraphicsScene *scene;
QGraphicsView *view;
QGraphicsVideoItem *videoItem;
QMediaPlayer *player;
QAudioOutput *audio;
QGraphicsPixmapItem *logoItem;
protected:
void resizeEvent(QResizeEvent *event) override;
void mouseDoubleClickEvent(QMouseEvent *) override;
public:
explicit OverlayVideoPlayer(QWidget *parent = nullptr);
void setVideoUrl(QUrl url);
void closeVideo();
void setVolume(int);
void toggleMuted();
void setPosition(qint64);
signals:
void playStatusChanged(bool isPlaying);
void playbackEnded();
void muteChanged(bool muted);
void videoProgressChanged(qint64 current, qint64 total);
private slots:
void onMediaStatusChanged(QMediaPlayer::MediaStatus);
void onPositionChanged(qint64);
};
#endif // OVERLAYVIDEOPLAYER_H