fix(provider): make source optional

This commit is contained in:
2026-07-21 19:50:30 +02:00
parent a335509b4e
commit 6eb02d32cb
17 changed files with 57 additions and 36 deletions
+2 -2
View File
@@ -232,9 +232,9 @@ namespace margelo::nitro::omni {
}
// Methods
void JHybridOmniPlayerSpec::setSource(const Source& src) {
void JHybridOmniPlayerSpec::setSource(const std::optional<Source>& src) {
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JSource> /* src */)>("setSource");
method(_javaPart, JSource::fromCpp(src));
method(_javaPart, src.has_value() ? JSource::fromCpp(src.value()) : nullptr);
}
void JHybridOmniPlayerSpec::play() {
static const auto method = _javaPart->javaClassStatic()->getMethod<void()>("play");