Skip to content

Commit

Permalink
fix: previous non-video asset showing for split second after video pl…
Browse files Browse the repository at this point in the history
…ayback
  • Loading branch information
nicomiguelino committed Oct 1, 2024
1 parent d3a2c9a commit 662cac5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions webview/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ void MainWindow::loadVideo(const QString &uri, unsigned int durationInSecs)
ready = false;
player->setMedia(QUrl::fromLocalFile(uri));

// Show a blank screen for a second before playing the video.
// This is to prevent the non-video content from being displayed for a short time
// after the video has finished playing.
view->loadImage("null");
QEventLoop loop;
QTimer::singleShot(1000, &loop, SLOT(quit()));
loop.exec();

view->hide();
videoWidget->setFullScreen(true);
videoWidget->show();
Expand Down

0 comments on commit 662cac5

Please sign in to comment.