]> git.sur5r.net Git - minitube/blobdiff - src/yt/ytjs/ytjsvideo.h
New upstream version 3.8
[minitube] / src / yt / ytjs / ytjsvideo.h
diff --git a/src/yt/ytjs/ytjsvideo.h b/src/yt/ytjs/ytjsvideo.h
new file mode 100644 (file)
index 0000000..a617f51
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef YTJSVIDEO_H
+#define YTJSVIDEO_H
+
+#include <QtCore>
+class YTJSVideo : public QObject {
+    Q_OBJECT
+public:
+    explicit YTJSVideo(const QString &videoId, QObject *parent = nullptr);
+    void loadStreamUrl();
+    int getDefinitionCode() const { return definitionCode; }
+
+signals:
+    void gotStreamUrl(const QString &videoUrl, const QString &audioUrl);
+    void errorStreamUrl(const QString &message);
+
+private:
+    QString videoId;
+    bool loadingStreamUrl = false;
+    int definitionCode;
+};
+
+#endif // YTJSVIDEO_H