mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-08-16 02:56:22 +00:00
71 lines
2.9 KiB
C++
71 lines
2.9 KiB
C++
///
|
|
/// NitroVideoOnLoad.cpp
|
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
/// https://github.com/mrousavy/nitro
|
|
/// Copyright © 2024 Marc Rousavy @ Margelo
|
|
///
|
|
|
|
#include "NitroVideoOnLoad.hpp"
|
|
|
|
#include <jni.h>
|
|
#include <fbjni/fbjni.h>
|
|
#include <NitroModules/HybridObjectRegistry.hpp>
|
|
|
|
#include "JHybridVideoPlayerSpec.hpp"
|
|
#include "JHybridVideoPlayerFactorySpec.hpp"
|
|
#include "JHybridVideoPlayerSourceSpec.hpp"
|
|
#include "JHybridVideoPlayerSourceFactorySpec.hpp"
|
|
#include "JHybridVideoViewViewManagerSpec.hpp"
|
|
#include "JHybridVideoViewViewManagerFactorySpec.hpp"
|
|
#include <NitroModules/JNISharedPtr.hpp>
|
|
#include <NitroModules/DefaultConstructableObject.hpp>
|
|
|
|
namespace margelo::nitro::video {
|
|
|
|
int initialize(JavaVM* vm) {
|
|
using namespace margelo::nitro;
|
|
using namespace margelo::nitro::video;
|
|
using namespace facebook;
|
|
|
|
return facebook::jni::initialize(vm, [] {
|
|
// Register native JNI methods
|
|
margelo::nitro::video::JHybridVideoPlayerSpec::registerNatives();
|
|
margelo::nitro::video::JHybridVideoPlayerFactorySpec::registerNatives();
|
|
margelo::nitro::video::JHybridVideoPlayerSourceSpec::registerNatives();
|
|
margelo::nitro::video::JHybridVideoPlayerSourceFactorySpec::registerNatives();
|
|
margelo::nitro::video::JHybridVideoViewViewManagerSpec::registerNatives();
|
|
margelo::nitro::video::JHybridVideoViewViewManagerFactorySpec::registerNatives();
|
|
|
|
// Register Nitro Hybrid Objects
|
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
"VideoPlayerFactory",
|
|
[]() -> std::shared_ptr<HybridObject> {
|
|
static DefaultConstructableObject<JHybridVideoPlayerFactorySpec::javaobject> object("com/margelo/nitro/video/HybridVideoPlayerFactory");
|
|
auto instance = object.create();
|
|
auto globalRef = jni::make_global(instance);
|
|
return JNISharedPtr::make_shared_from_jni<JHybridVideoPlayerFactorySpec>(globalRef);
|
|
}
|
|
);
|
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
"VideoPlayerSourceFactory",
|
|
[]() -> std::shared_ptr<HybridObject> {
|
|
static DefaultConstructableObject<JHybridVideoPlayerSourceFactorySpec::javaobject> object("com/margelo/nitro/video/HybridVideoPlayerSourceFactory");
|
|
auto instance = object.create();
|
|
auto globalRef = jni::make_global(instance);
|
|
return JNISharedPtr::make_shared_from_jni<JHybridVideoPlayerSourceFactorySpec>(globalRef);
|
|
}
|
|
);
|
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
"VideoViewViewManagerFactory",
|
|
[]() -> std::shared_ptr<HybridObject> {
|
|
static DefaultConstructableObject<JHybridVideoViewViewManagerFactorySpec::javaobject> object("com/margelo/nitro/video/HybridVideoViewViewManagerFactory");
|
|
auto instance = object.create();
|
|
auto globalRef = jni::make_global(instance);
|
|
return JNISharedPtr::make_shared_from_jni<JHybridVideoViewViewManagerFactorySpec>(globalRef);
|
|
}
|
|
);
|
|
});
|
|
}
|
|
|
|
} // namespace margelo::nitro::video
|