diff --git a/source/plugin.cpp b/source/plugin.cpp index 5e92dee..e2e460f 100644 --- a/source/plugin.cpp +++ b/source/plugin.cpp @@ -294,3 +294,11 @@ std::filesystem::path streamfx::config_file_path(std::string_view file) throw std::runtime_error("obs_module_get_config_path returned nullptr"); } } + +#ifdef ENABLE_FRONTEND +bool streamfx::open_url(std::string_view url) +{ + QUrl qurl = QString::fromUtf8(url.data()); + return QDesktopServices::openUrl(qurl); +} +#endif diff --git a/source/plugin.hpp b/source/plugin.hpp index 48797d1..41a6f3c 100644 --- a/source/plugin.hpp +++ b/source/plugin.hpp @@ -28,4 +28,8 @@ namespace streamfx { std::filesystem::path data_file_path(std::string_view file); std::filesystem::path config_file_path(std::string_view file); + +#ifdef ENABLE_FRONTEND + bool open_url(std::string_view url); +#endif } // namespace streamfx