2014-03-27 18:10:15 +00:00
|
|
|
#include "videowidget.hpp"
|
|
|
|
|
2014-10-22 20:11:03 +00:00
|
|
|
#include "../mwsound/movieaudiofactory.hpp"
|
|
|
|
|
2014-03-27 18:10:15 +00:00
|
|
|
namespace MWGui
|
|
|
|
{
|
|
|
|
|
|
|
|
VideoWidget::VideoWidget()
|
|
|
|
{
|
|
|
|
setNeedKeyFocus(true);
|
|
|
|
}
|
|
|
|
|
2014-06-09 23:57:54 +00:00
|
|
|
void VideoWidget::playVideo(const std::string &video)
|
2014-03-27 18:10:15 +00:00
|
|
|
{
|
2014-10-22 20:11:03 +00:00
|
|
|
mPlayer.setAudioFactory(new MWSound::MovieAudioFactory());
|
2014-03-27 18:10:15 +00:00
|
|
|
mPlayer.playVideo(video);
|
|
|
|
|
|
|
|
setImageTexture(mPlayer.getTextureName());
|
|
|
|
}
|
|
|
|
|
|
|
|
int VideoWidget::getVideoWidth()
|
|
|
|
{
|
|
|
|
return mPlayer.getVideoWidth();
|
|
|
|
}
|
|
|
|
|
|
|
|
int VideoWidget::getVideoHeight()
|
|
|
|
{
|
|
|
|
return mPlayer.getVideoHeight();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool VideoWidget::update()
|
|
|
|
{
|
2014-10-24 19:19:17 +00:00
|
|
|
return mPlayer.update();
|
2014-03-27 18:10:15 +00:00
|
|
|
}
|
|
|
|
|
2014-06-09 23:57:54 +00:00
|
|
|
void VideoWidget::stop()
|
2014-06-05 13:39:08 +00:00
|
|
|
{
|
|
|
|
mPlayer.close();
|
|
|
|
}
|
|
|
|
|
2014-10-22 20:11:03 +00:00
|
|
|
bool VideoWidget::hasAudioStream()
|
|
|
|
{
|
|
|
|
return mPlayer.hasAudioStream();
|
|
|
|
}
|
|
|
|
|
2014-03-27 18:10:15 +00:00
|
|
|
}
|