1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 08:49:55 +00:00
openmw-tes3mp/apps/openmw/mwgui/videowidget.cpp

48 lines
717 B
C++
Raw Normal View History

#include "videowidget.hpp"
#include "../mwsound/movieaudiofactory.hpp"
namespace MWGui
{
VideoWidget::VideoWidget()
{
setNeedKeyFocus(true);
}
void VideoWidget::playVideo(const std::string &video)
{
mPlayer.setAudioFactory(new MWSound::MovieAudioFactory());
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();
}
void VideoWidget::stop()
{
mPlayer.close();
}
bool VideoWidget::hasAudioStream()
{
return mPlayer.hasAudioStream();
}
}