7 class Video : public QObject {
14 const QString title() const { return m_title; }
15 void setTitle( QString title ) { m_title = title; }
17 const QString description() const { return m_description; }
18 void setDescription( QString description ) { m_description = description; }
20 const QString author() const { return m_author; }
21 void setAuthor( QString author ) { m_author = author; }
23 const QUrl webpage() const { return m_webpage; }
24 void setWebpage( QUrl webpage ) { m_webpage = webpage; }
26 QList<QUrl> thumbnailUrls() const { return m_thumbnailUrls; }
27 void addThumbnailUrl(QUrl url) {
28 m_thumbnailUrls << url;
31 void preloadThumbnail();
32 const QImage thumbnail() const;
34 int duration() const { return m_duration; }
35 void setDuration( int duration ) { m_duration = duration; }
37 int viewCount() const { return m_viewCount; }
38 void setViewCount( int viewCount ) { m_viewCount = viewCount; }
40 const QDateTime published() const { return m_published; }
41 void setPublished( QDateTime published ) { m_published = published; }
43 bool getDefinitionCode() const { return definitionCode; }
46 QUrl getStreamUrl() { return m_streamUrl; }
49 void setThumbnail(QByteArray bytes);
53 void gotStreamUrl(QUrl streamUrl);
54 void errorStreamUrl(QString message);
57 void gotVideoInfo(QByteArray);
58 void errorVideoInfo(QNetworkReply*);
59 void scrapeWebPage(QByteArray);
60 void gotHeadHeaders(QNetworkReply*);
64 void findVideoUrl(int definitionCode);
65 void foundVideoUrl(QString videoToken, int definitionCode);
68 QString m_description;
73 QList<QUrl> m_thumbnailUrls;
75 QDateTime m_published;
78 // The YouTube video id
79 // This is needed by the gotVideoInfo callback
85 // current index for the elTypes list
86 // needed to iterate on elTypes
90 // This is required in order to use QPointer<Video> as a QVariant
91 // as used by the Model/View playlist
92 typedef QPointer<Video> VideoPointer;
93 Q_DECLARE_METATYPE(VideoPointer)