7 class Video : public QObject {
15 const QString title() const { return m_title; }
16 void setTitle( QString title ) { m_title = title; }
18 const QString description() const { return m_description; }
19 void setDescription( QString description ) { m_description = description; }
21 const QString author() const { return m_author; }
22 void setAuthor( QString author ) { m_author = author; }
24 const QString authorUri() const { return m_authorUri; }
25 void setAuthorUri( QString authorUri ) { m_authorUri = authorUri; }
27 const QUrl webpage() const { return m_webpage; }
28 void setWebpage( QUrl webpage ) { m_webpage = webpage; }
30 QList<QUrl> thumbnailUrls() const { return m_thumbnailUrls; }
31 void addThumbnailUrl(QUrl url) {
32 m_thumbnailUrls << url;
35 void preloadThumbnail();
36 const QImage thumbnail() const;
38 int duration() const { return m_duration; }
39 void setDuration( int duration ) { m_duration = duration; }
41 int viewCount() const { return m_viewCount; }
42 void setViewCount( int viewCount ) { m_viewCount = viewCount; }
44 const QDateTime published() const { return m_published; }
45 void setPublished( QDateTime published ) { m_published = published; }
47 int getDefinitionCode() const { return definitionCode; }
50 QUrl getStreamUrl() { return m_streamUrl; }
52 QString id() { return videoId; }
55 void setThumbnail(QByteArray bytes);
59 void gotStreamUrl(QUrl streamUrl);
60 void errorStreamUrl(QString message);
63 void gotVideoInfo(QByteArray);
64 void errorVideoInfo(QNetworkReply*);
65 void scrapeWebPage(QByteArray);
66 void gotHeadHeaders(QNetworkReply*);
70 void findVideoUrl(int definitionCode);
71 void foundVideoUrl(QString videoToken, int definitionCode);
74 QString m_description;
80 QList<QUrl> m_thumbnailUrls;
82 QDateTime m_published;
85 // The YouTube video id
86 // This is needed by the gotVideoInfo callback
92 // current index for the elTypes list
93 // needed to iterate on elTypes
96 bool loadingStreamUrl;
99 // This is required in order to use QPointer<Video> as a QVariant
100 // as used by the Model/View playlist
101 typedef QPointer<Video> VideoPointer;
102 Q_DECLARE_METATYPE(VideoPointer)