Skip to content

Commit

Permalink
feat(video): pause video when stop
Browse files Browse the repository at this point in the history
Change-Id: I96d78bf9fab88109010b5d794c462f72104622d0
  • Loading branch information
justforlxz committed Apr 25, 2018
1 parent b5303cc commit ba6cfa4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/modules/videowidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ void VideoWidget::updateControlButton()
m_control->setHoverPic(":/resources/play_hover.svg");
m_control->setPressPic(":/resources/play_press.svg");
break;
case QMediaPlayer::StoppedState: {
m_player->setPosition(1);
m_player->pause();
}
break;
default:
break;
}
Expand Down Expand Up @@ -127,7 +132,7 @@ void VideoWidget::leaveEvent(QEvent *e)
{
ModuleInterface::leaveEvent(e);

m_control->hide();
m_control->setVisible(m_player->state() == QMediaPlayer::PausedState);
}

void VideoWidget::resizeEvent(QResizeEvent *e)
Expand Down

0 comments on commit ba6cfa4

Please sign in to comment.