-
Notifications
You must be signed in to change notification settings - Fork 0
/
videoplayer.h
executable file
·58 lines (47 loc) · 1.28 KB
/
videoplayer.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
48
49
50
51
52
53
54
55
56
57
58
#ifndef VIDEOPLAYER_H
#define VIDEOPLAYER_H
#include <QObject>
#include <QProcess>
#include <QJsonArray>
#include <QModelIndexList>
#include <VLCQtQml/QmlPlayer.h>
#include <VLCQtCore/MediaListPlayer.h>
#include <VLCQtCore/MediaPlayer.h>
#include <VLCQtCore/Video.h>
#include <vlc/vlc.h>
#include <vlc/libvlc_media.h>
class Playlist;
class YoutubePlayer : public QObject
{
Q_OBJECT
public:
YoutubePlayer(QObject *parent=nullptr);
Q_PROPERTY(bool showVideo MEMBER m_showVideo NOTIFY showVideoChanged)
Q_PROPERTY(VlcQmlPlayer* player READ getPlayer)
Q_PROPERTY(Playlist* playlist MEMBER m_playlist)
VlcQmlPlayer* getPlayer();
public slots:
void play(QJsonArray formats);
void play(QUrl video, QUrl audio);
void seekFwd();
void seekBck();
void seekFwdFwd();
void seekBckBck();
void next();
void prev();
void maybeNext();
void playFirst();
void on_playlist_mediaAdded(QModelIndexList newMedia);
void on_playlist_mediaReset();
protected:
VlcMediaPlayer *mediaPlayer;
VlcInstance *vlcInstance;
VlcMedia *media{nullptr};
VlcQmlPlayer *qmlPlayer;
Playlist *m_playlist;
bool m_showVideo{true};
signals:
void showVideoChanged(bool showVideo);
};
using VideoPlayer = YoutubePlayer;
#endif // VIDEOPLAYER_H