aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/LVideoLabel.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-11-14 15:53:30 -0500
committerKen Moore <ken@ixsystems.com>2017-11-14 15:53:30 -0500
commitb2eb3023b7f9a922011a1120060cadf0fd19127f (patch)
tree86e8d8e0bb91044250f799946ed5797ac01c5687 /src-qt5/core/libLumina/LVideoLabel.cpp
parentFix up the insertion of files from multiple directories within the tar backend. (diff)
downloadlumina-b2eb3023b7f9a922011a1120060cadf0fd19127f.tar.gz
lumina-b2eb3023b7f9a922011a1120060cadf0fd19127f.tar.bz2
lumina-b2eb3023b7f9a922011a1120060cadf0fd19127f.zip
A few tweaks for teh LVideoLabel - trying to get it loading a bit more reliably.
Also disable the LVideoLabel from being used at the moment in lumina-fm - needs a bit more work before we turn this on for everybody.
Diffstat (limited to 'src-qt5/core/libLumina/LVideoLabel.cpp')
-rw-r--r--src-qt5/core/libLumina/LVideoLabel.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src-qt5/core/libLumina/LVideoLabel.cpp b/src-qt5/core/libLumina/LVideoLabel.cpp
index bddb1cba..93e95afd 100644
--- a/src-qt5/core/libLumina/LVideoLabel.cpp
+++ b/src-qt5/core/libLumina/LVideoLabel.cpp
@@ -1,15 +1,15 @@
#include "LVideoLabel.h"
#include <LuminaXDG.h>
#include <QCoreApplication>
+#include <QTimer>
LVideoLabel::LVideoLabel(QString file, bool icons, QWidget *parent) : QLabel(parent) {
thumbnail = QPixmap();
entered = false;
this->icons = icons;
filepath = file;
- defaultThumbnail = LXDG::findIcon("unknown", "").pixmap(256,256);
-
- QTimer::singleShot(0, this, SLOT(initializeBackend()) );
+ defaultThumbnail = LXDG::findIcon("media-playback-start", "").pixmap(256,256);
+ QTimer::singleShot(qrand()%10, this, SLOT(initializeBackend()) );
}
LVideoLabel::~LVideoLabel() {
@@ -23,15 +23,17 @@ void LVideoLabel::initializeBackend(){
mediaPlayer->setVideoOutput(surface);
mediaPlayer->setPlaybackRate(3);
mediaPlayer->setMuted(true);
-
+
this->setPixmap(defaultThumbnail.scaled(this->size(),Qt::IgnoreAspectRatio));
mediaPlayer->setMedia(QUrl::fromLocalFile(filepath));
- mediaPlayer->play();
this->connect(surface, SIGNAL(frameReceived(QPixmap)), this, SLOT(stopVideo(QPixmap)));
this->connect(mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)), this, SLOT(stateChanged(QMediaPlayer::State)));
this->connect(mediaPlayer, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, SLOT(setDuration(QMediaPlayer::MediaStatus)));
this->connect(this, SIGNAL(rollOver()), surface, SLOT(switchRollOver()));
+
+ //QTimer::singleShot( qrand()%100,mediaPlayer, SLOT(play()) );
+ //mediaPlayer->play();
}
void LVideoLabel::enableIcons() {
@@ -72,7 +74,7 @@ void LVideoLabel::setDuration(QMediaPlayer::MediaStatus status) {
mediaPlayer->play();
}else if(status == QMediaPlayer::InvalidMedia){
mediaPlayer->stop();
- mediaPlayer->play();
+ QTimer::singleShot(qrand()%100, mediaPlayer, SLOT(play())); //mediaPlayer->play();
}/*else if(status == QMediaPlayer::LoadingMedia) {
mediaPlayer->pause();
QTimer timer;
bgstack15