diff --git a/es-app/src/SystemScreensaver.cpp b/es-app/src/SystemScreensaver.cpp index 8be829374..767b30857 100644 --- a/es-app/src/SystemScreensaver.cpp +++ b/es-app/src/SystemScreensaver.cpp @@ -12,6 +12,7 @@ #if defined(_RPI_) #include "components/VideoOmxComponent.h" #endif +#include "components/VideoFFmpegComponent.h" #include "components/VideoVlcComponent.h" #include "resources/Font.h" #include "utils/FileSystemUtil.h" @@ -179,10 +180,18 @@ void SystemScreensaver::startScreensaver(bool generateMediaList) // Create the correct type of video component. if (Settings::getInstance()->getBool("ScreensaverOmxPlayer")) mVideoScreensaver = new VideoOmxComponent(mWindow); + else if (Settings::getInstance()->getString("VideoPlayer") == "vlc") + mVideoScreensaver = new VideoVlcComponent(window); + else + mVideoScreensaver = new VideoFFmpegComponent(window); + else mVideoScreensaver = new VideoVlcComponent(mWindow); #else - mVideoScreensaver = new VideoVlcComponent(mWindow); + if (Settings::getInstance()->getString("VideoPlayer") == "vlc") + mVideoScreensaver = new VideoVlcComponent(mWindow); + else + mVideoScreensaver = new VideoFFmpegComponent(mWindow); #endif mVideoScreensaver->topWindow(true); diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 94497f2b9..a9ae564a1 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -755,6 +755,25 @@ void GuiMenu::openOtherSettings() }); #endif + // Video player. + auto video_player = std::make_shared> + (mWindow, getHelpStyle(), "FULLSCREEN MODE", false); + std::string selectedPlayer = Settings::getInstance()->getString("VideoPlayer"); + video_player->add("VLC", "vlc", selectedPlayer == "vlc"); + video_player->add("FFmpeg (experimental)", "ffmpeg", selectedPlayer == "ffmpeg"); + // If there are no objects returned, then there must be a manually modified entry in the + // configuration file. Simply set the video player to VLC in this case. + if (video_player->getSelectedObjects().size() == 0) + video_player->selectEntry(0); + s->addWithLabel("VIDEO PLAYER", video_player); + s->addSaveFunc([video_player, s] { + if (video_player->getSelected() != Settings::getInstance()->getString("VideoPlayer")) { + Settings::getInstance()->setString("VideoPlayer", video_player->getSelected()); + s->setNeedsSaving(); + s->setNeedsReloading(); + } + }); + // When to save game metadata. auto save_gamelist_mode = std::make_shared> (mWindow, getHelpStyle(), "WHEN TO SAVE METADATA", false); diff --git a/es-app/src/views/gamelist/VideoGameListView.cpp b/es-app/src/views/gamelist/VideoGameListView.cpp index 08f5ee041..b584198ba 100644 --- a/es-app/src/views/gamelist/VideoGameListView.cpp +++ b/es-app/src/views/gamelist/VideoGameListView.cpp @@ -12,12 +12,14 @@ #if defined(_RPI_) #include "components/VideoOmxComponent.h" #endif +#include "components/VideoFFmpegComponent.h" #include "components/VideoVlcComponent.h" #include "utils/FileSystemUtil.h" #include "views/ViewController.h" #if defined(_RPI_) #include "Settings.h" #endif +#include "AudioManager.h" #include "CollectionSystemsManager.h" #include "SystemData.h" @@ -64,10 +66,15 @@ VideoGameListView::VideoGameListView( #if defined(_RPI_) if (Settings::getInstance()->getBool("VideoOmxPlayer")) mVideo = new VideoOmxComponent(window); - else + else if (Settings::getInstance()->getString("VideoPlayer") == "vlc") mVideo = new VideoVlcComponent(window); + else + mVideo = new VideoFFmpegComponent(window); #else - mVideo = new VideoVlcComponent(window); + if (Settings::getInstance()->getString("VideoPlayer") == "vlc") + mVideo = new VideoVlcComponent(window); + else + mVideo = new VideoFFmpegComponent(window); #endif mList.setPosition(mSize.x() * (0.50f + padding), mList.getPosition().y()); @@ -388,8 +395,10 @@ void VideoGameListView::updateInfoPanel() mThumbnail.setImage(file->getThumbnailPath()); mMarquee.setImage(file->getMarqueePath()); mVideo->setImage(file->getImagePath()); + AudioManager::getInstance()->clearStream(); mVideo->onHide(); + if (!mVideo->setVideo(file->getVideoPath())) mVideo->setDefaultVideo(); } diff --git a/es-core/src/Settings.cpp b/es-core/src/Settings.cpp index cbe1b085b..842137e87 100644 --- a/es-core/src/Settings.cpp +++ b/es-core/src/Settings.cpp @@ -205,6 +205,7 @@ void Settings::setDefaults() #if defined (__unix__) mStringMap["FullscreenMode"] = { "normal", "normal" }; #endif + mStringMap["VideoPlayer"] = { "vlc", "vlc" }; #if defined(_RPI_) mBoolMap["VideoOmxPlayer"] = { false, false }; // We're defaulting to OMX Player for full screen video on the Pi.