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 QUrl webpage() const { return m_webpage; }
25 void setWebpage( QUrl webpage ) { m_webpage = webpage; }
27 QList<QUrl> thumbnailUrls() const { return m_thumbnailUrls; }
28 void addThumbnailUrl(QUrl url) {
29 m_thumbnailUrls << url;
32 void preloadThumbnail();
33 const QImage thumbnail() const;
35 int duration() const { return m_duration; }
36 void setDuration( int duration ) { m_duration = duration; }
38 int viewCount() const { return m_viewCount; }
39 void setViewCount( int viewCount ) { m_viewCount = viewCount; }
41 const QDateTime published() const { return m_published; }
42 void setPublished( QDateTime published ) { m_published = published; }
44 int getDefinitionCode() const { return definitionCode; }
47 QUrl getStreamUrl() { return m_streamUrl; }
49 QString id() { return videoId; }
52 void setThumbnail(QByteArray bytes);
56 void gotStreamUrl(QUrl streamUrl);
57 void errorStreamUrl(QString message);
60 void gotVideoInfo(QByteArray);
61 void errorVideoInfo(QNetworkReply*);
62 void scrapeWebPage(QByteArray);
63 void gotHeadHeaders(QNetworkReply*);
67 void findVideoUrl(int definitionCode);
68 void foundVideoUrl(QString videoToken, int definitionCode);
71 QString m_description;
76 QList<QUrl> m_thumbnailUrls;
78 QDateTime m_published;
81 // The YouTube video id
82 // This is needed by the gotVideoInfo callback
88 // current index for the elTypes list
89 // needed to iterate on elTypes
92 bool loadingStreamUrl;
95 // This is required in order to use QPointer<Video> as a QVariant
96 // as used by the Model/View playlist
97 typedef QPointer<Video> VideoPointer;
98 Q_DECLARE_METATYPE(VideoPointer)