2014-03-27 19:10:15 +01:00
|
|
|
#include "videowidget.hpp"
|
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
|
|
|
|
|
|
|
VideoWidget::VideoWidget()
|
|
|
|
{
|
|
|
|
setNeedKeyFocus(true);
|
|
|
|
}
|
|
|
|
|
2014-06-10 01:57:54 +02:00
|
|
|
void VideoWidget::playVideo(const std::string &video)
|
2014-03-27 19:10:15 +01:00
|
|
|
{
|
|
|
|
mPlayer.playVideo(video);
|
|
|
|
|
|
|
|
setImageTexture(mPlayer.getTextureName());
|
|
|
|
}
|
|
|
|
|
|
|
|
int VideoWidget::getVideoWidth()
|
|
|
|
{
|
|
|
|
return mPlayer.getVideoWidth();
|
|
|
|
}
|
|
|
|
|
|
|
|
int VideoWidget::getVideoHeight()
|
|
|
|
{
|
|
|
|
return mPlayer.getVideoHeight();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool VideoWidget::update()
|
|
|
|
{
|
|
|
|
mPlayer.update();
|
|
|
|
return mPlayer.isPlaying();
|
|
|
|
}
|
|
|
|
|
2014-06-10 01:57:54 +02:00
|
|
|
void VideoWidget::stop()
|
2014-06-05 15:39:08 +02:00
|
|
|
{
|
|
|
|
mPlayer.close();
|
|
|
|
}
|
|
|
|
|
2014-03-27 19:10:15 +01:00
|
|
|
}
|