mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-06-21 17:34:18 +00:00
61 lines
2.7 KiB
C++
Generated
61 lines
2.7 KiB
C++
Generated
///
|
|
/// JHybridVideoPlayerFactorySpec.cpp
|
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
/// https://github.com/mrousavy/nitro
|
|
/// Copyright © Marc Rousavy @ Margelo
|
|
///
|
|
|
|
#include "JHybridVideoPlayerFactorySpec.hpp"
|
|
|
|
// Forward declaration of `HybridVideoPlayerSpec` to properly resolve imports.
|
|
namespace margelo::nitro::video { class HybridVideoPlayerSpec; }
|
|
// Forward declaration of `HybridVideoPlayerSourceSpec` to properly resolve imports.
|
|
namespace margelo::nitro::video { class HybridVideoPlayerSourceSpec; }
|
|
|
|
#include <memory>
|
|
#include "HybridVideoPlayerSpec.hpp"
|
|
#include "JHybridVideoPlayerSpec.hpp"
|
|
#include "HybridVideoPlayerSourceSpec.hpp"
|
|
#include "JHybridVideoPlayerSourceSpec.hpp"
|
|
|
|
namespace margelo::nitro::video {
|
|
|
|
std::shared_ptr<JHybridVideoPlayerFactorySpec> JHybridVideoPlayerFactorySpec::JavaPart::getJHybridVideoPlayerFactorySpec() {
|
|
auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
|
|
auto castHybridObject = std::dynamic_pointer_cast<JHybridVideoPlayerFactorySpec>(hybridObject);
|
|
if (castHybridObject == nullptr) [[unlikely]] {
|
|
throw std::runtime_error("Failed to downcast JHybridObject to JHybridVideoPlayerFactorySpec!");
|
|
}
|
|
return castHybridObject;
|
|
}
|
|
|
|
jni::local_ref<JHybridVideoPlayerFactorySpec::CxxPart::jhybriddata> JHybridVideoPlayerFactorySpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
return makeCxxInstance(jThis);
|
|
}
|
|
|
|
std::shared_ptr<JHybridObject> JHybridVideoPlayerFactorySpec::CxxPart::createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) {
|
|
auto castJavaPart = jni::dynamic_ref_cast<JHybridVideoPlayerFactorySpec::JavaPart>(javaPart);
|
|
if (castJavaPart == nullptr) [[unlikely]] {
|
|
throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridVideoPlayerFactorySpec::JavaPart!");
|
|
}
|
|
return std::make_shared<JHybridVideoPlayerFactorySpec>(castJavaPart);
|
|
}
|
|
|
|
void JHybridVideoPlayerFactorySpec::CxxPart::registerNatives() {
|
|
registerHybrid({
|
|
makeNativeMethod("initHybrid", JHybridVideoPlayerFactorySpec::CxxPart::initHybrid),
|
|
});
|
|
}
|
|
|
|
// Properties
|
|
|
|
|
|
// Methods
|
|
std::shared_ptr<HybridVideoPlayerSpec> JHybridVideoPlayerFactorySpec::createPlayer(const std::shared_ptr<HybridVideoPlayerSourceSpec>& source) {
|
|
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JHybridVideoPlayerSpec::JavaPart>(jni::alias_ref<JHybridVideoPlayerSourceSpec::JavaPart> /* source */)>("createPlayer");
|
|
auto __result = method(_javaPart, std::dynamic_pointer_cast<JHybridVideoPlayerSourceSpec>(source)->getJavaPart());
|
|
return __result->getJHybridVideoPlayerSpec();
|
|
}
|
|
|
|
} // namespace margelo::nitro::video
|