void Video::loadThumbnail() {
if (thumbnailUrl.isEmpty() || loadingThumbnail) return;
loadingThumbnail = true;
- QObject *reply = HttpUtils::yt().get(thumbnailUrl);
+ auto reply = HttpUtils::yt().get(thumbnailUrl);
connect(reply, SIGNAL(data(QByteArray)), SLOT(setThumbnail(QByteArray)));
+ connect(reply, &HttpReply::error, this, [this](auto &msg) {
+ qWarning() << msg;
+ loadingThumbnail = false;
+ });
}
void Video::setDuration(int value) {
ytjsVideo = new YTJSVideo(id, this);
connect(ytjsVideo, &YTJSVideo::gotStreamUrl, this, &Video::streamUrlLoaded);
connect(ytjsVideo, &YTJSVideo::errorStreamUrl, this, [this](const QString &msg) {
+ qDebug() << msg;
ytjsVideo->deleteLater();
ytjsVideo = nullptr;
loadStreamUrlYT();
ytVideo = new YTVideo(id, this);
connect(ytVideo, &YTVideo::gotStreamUrl, this, &Video::streamUrlLoaded);
connect(ytVideo, &YTVideo::errorStreamUrl, this, [this](const QString &msg) {
+ qDebug() << msg;
emit errorStreamUrl(msg);
ytVideo->deleteLater();
ytVideo = nullptr;