mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 06:19:55 +00:00
49 lines
804 B
C++
49 lines
804 B
C++
#include "videowidget.hpp"
|
|
|
|
#include <extern/ogre-ffmpeg-videoplayer/videoplayer.hpp>
|
|
|
|
#include "../mwsound/movieaudiofactory.hpp"
|
|
|
|
namespace MWGui
|
|
{
|
|
|
|
VideoWidget::VideoWidget()
|
|
{
|
|
mPlayer.reset(new Video::VideoPlayer());
|
|
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()
|
|
{
|
|
return mPlayer->update();
|
|
}
|
|
|
|
void VideoWidget::stop()
|
|
{
|
|
mPlayer->close();
|
|
}
|
|
|
|
bool VideoWidget::hasAudioStream()
|
|
{
|
|
return mPlayer->hasAudioStream();
|
|
}
|
|
|
|
}
|