@react-native-video/drm 7.0.0-beta.0 → 7.0.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1 -1
  3. package/lib/typescript/src/PluginManager.nitro.d.ts.map +1 -1
  4. package/nitrogen/generated/android/ReactNativeVideoDrm+autolinking.cmake +1 -1
  5. package/nitrogen/generated/android/ReactNativeVideoDrm+autolinking.gradle +1 -1
  6. package/nitrogen/generated/android/ReactNativeVideoDrmOnLoad.cpp +27 -17
  7. package/nitrogen/generated/android/ReactNativeVideoDrmOnLoad.hpp +14 -5
  8. package/nitrogen/generated/android/c++/JHybridPluginManagerSpec.cpp +23 -16
  9. package/nitrogen/generated/android/c++/JHybridPluginManagerSpec.hpp +20 -21
  10. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videodrm/HybridPluginManagerSpec.kt +17 -15
  11. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videodrm/ReactNativeVideoDrmOnLoad.kt +1 -1
  12. package/nitrogen/generated/ios/ReactNativeVideoDrm+autolinking.rb +2 -2
  13. package/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Bridge.cpp +2 -1
  14. package/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Bridge.hpp +1 -1
  15. package/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Umbrella.hpp +1 -1
  16. package/nitrogen/generated/ios/ReactNativeVideoDrmAutolinking.mm +1 -1
  17. package/nitrogen/generated/ios/ReactNativeVideoDrmAutolinking.swift +9 -8
  18. package/nitrogen/generated/ios/c++/HybridPluginManagerSpecSwift.cpp +1 -1
  19. package/nitrogen/generated/ios/c++/HybridPluginManagerSpecSwift.hpp +10 -1
  20. package/nitrogen/generated/ios/swift/HybridPluginManagerSpec.swift +10 -4
  21. package/nitrogen/generated/ios/swift/HybridPluginManagerSpec_cxx.swift +18 -3
  22. package/nitrogen/generated/shared/c++/HybridPluginManagerSpec.cpp +1 -1
  23. package/nitrogen/generated/shared/c++/HybridPluginManagerSpec.hpp +1 -1
  24. package/package.json +10 -7
  25. package/src/PluginManager.nitro.ts +4 -2
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024-2025 TheWidlarzGroup
3
+ Copyright (c) 2024-present TheWidlarzGroup
4
4
  Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  of this software and associated documentation files (the "Software"), to deal
6
6
  in the Software without restriction, including without limitation the rights
package/README.md CHANGED
@@ -5,7 +5,7 @@ DRM plugin for react-native-video. It adds Widevine (Android) and FairPlay (iOS,
5
5
  ## Requirements
6
6
 
7
7
  - react-native-video >= 7.0.0-alpha.3
8
- - react-native-nitro-modules >= 0.27.2
8
+ - react-native-nitro-modules >= 0.35.0
9
9
 
10
10
  ## Installation
11
11
 
@@ -1 +1 @@
1
- {"version":3,"file":"PluginManager.nitro.d.ts","sourceRoot":"","sources":["../../../src/PluginManager.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,WAAW,aACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;IACzD,MAAM,IAAI,IAAI,CAAC;IACf,OAAO,IAAI,IAAI,CAAC;IAChB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B"}
1
+ {"version":3,"file":"PluginManager.nitro.d.ts","sourceRoot":"","sources":["../../../src/PluginManager.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,WAAW,aAAc,SAAQ,YAAY,CAAC;IAClD,GAAG,EAAE,OAAO,CAAC;IACb,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC;IACA,MAAM,IAAI,IAAI,CAAC;IACf,OAAO,IAAI,IAAI,CAAC;IAChB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B"}
@@ -2,7 +2,7 @@
2
2
  # ReactNativeVideoDrm+autolinking.cmake
3
3
  # This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  # https://github.com/mrousavy/nitro
5
- # Copyright © 2025 Marc Rousavy @ Margelo
5
+ # Copyright © Marc Rousavy @ Margelo
6
6
  #
7
7
 
8
8
  # This is a CMake file that adds all files generated by Nitrogen
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeVideoDrm+autolinking.gradle
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  /// This is a Gradle file that adds all files generated by Nitrogen
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeVideoDrmOnLoad.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #ifndef BUILDING_REACTNATIVEVIDEODRM_WITH_GENERATED_CMAKE_PROJECT
@@ -21,24 +21,34 @@
21
21
  namespace margelo::nitro::videodrm {
22
22
 
23
23
  int initialize(JavaVM* vm) {
24
+ return facebook::jni::initialize(vm, []() {
25
+ ::margelo::nitro::videodrm::registerAllNatives();
26
+ });
27
+ }
28
+
29
+ struct JHybridPluginManagerSpecImpl: public jni::JavaClass<JHybridPluginManagerSpecImpl, JHybridPluginManagerSpec::JavaPart> {
30
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/videodrm/PluginManager;";
31
+ static std::shared_ptr<JHybridPluginManagerSpec> create() {
32
+ static auto constructorFn = javaClassStatic()->getConstructor<JHybridPluginManagerSpecImpl::javaobject()>();
33
+ jni::local_ref<JHybridPluginManagerSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
34
+ return javaPart->getJHybridPluginManagerSpec();
35
+ }
36
+ };
37
+
38
+ void registerAllNatives() {
24
39
  using namespace margelo::nitro;
25
40
  using namespace margelo::nitro::videodrm;
26
- using namespace facebook;
27
-
28
- return facebook::jni::initialize(vm, [] {
29
- // Register native JNI methods
30
- margelo::nitro::videodrm::JHybridPluginManagerSpec::registerNatives();
31
-
32
- // Register Nitro Hybrid Objects
33
- HybridObjectRegistry::registerHybridObjectConstructor(
34
- "PluginManager",
35
- []() -> std::shared_ptr<HybridObject> {
36
- static DefaultConstructableObject<JHybridPluginManagerSpec::javaobject> object("com/margelo/nitro/videodrm/PluginManager");
37
- auto instance = object.create();
38
- return instance->cthis()->shared();
39
- }
40
- );
41
- });
41
+
42
+ // Register native JNI methods
43
+ margelo::nitro::videodrm::JHybridPluginManagerSpec::CxxPart::registerNatives();
44
+
45
+ // Register Nitro Hybrid Objects
46
+ HybridObjectRegistry::registerHybridObjectConstructor(
47
+ "PluginManager",
48
+ []() -> std::shared_ptr<HybridObject> {
49
+ return JHybridPluginManagerSpecImpl::create();
50
+ }
51
+ );
42
52
  }
43
53
 
44
54
  } // namespace margelo::nitro::videodrm
@@ -2,24 +2,33 @@
2
2
  /// ReactNativeVideoDrmOnLoad.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include <jni.h>
9
+ #include <functional>
9
10
  #include <NitroModules/NitroDefines.hpp>
10
11
 
11
12
  namespace margelo::nitro::videodrm {
12
13
 
14
+ [[deprecated("Use registerNatives() instead.")]]
15
+ int initialize(JavaVM* vm);
16
+
13
17
  /**
14
- * Initializes the native (C++) part of ReactNativeVideoDrm, and autolinks all Hybrid Objects.
15
- * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`).
18
+ * Register the native (C++) part of ReactNativeVideoDrm, and autolinks all Hybrid Objects.
19
+ * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`),
20
+ * inside a `facebook::jni::initialize(vm, ...)` call.
16
21
  * Example:
17
22
  * ```cpp (cpp-adapter.cpp)
18
23
  * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
19
- * return margelo::nitro::videodrm::initialize(vm);
24
+ * return facebook::jni::initialize(vm, []() {
25
+ * // register all ReactNativeVideoDrm HybridObjects
26
+ * margelo::nitro::videodrm::registerNatives();
27
+ * // any other custom registrations go here.
28
+ * });
20
29
  * }
21
30
  * ```
22
31
  */
23
- int initialize(JavaVM* vm);
32
+ void registerAllNatives();
24
33
 
25
34
  } // namespace margelo::nitro::videodrm
@@ -2,7 +2,7 @@
2
2
  /// JHybridPluginManagerSpec.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "JHybridPluginManagerSpec.hpp"
@@ -13,40 +13,47 @@
13
13
 
14
14
  namespace margelo::nitro::videodrm {
15
15
 
16
- jni::local_ref<JHybridPluginManagerSpec::jhybriddata> JHybridPluginManagerSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
17
- return makeCxxInstance(jThis);
16
+ std::shared_ptr<JHybridPluginManagerSpec> JHybridPluginManagerSpec::JavaPart::getJHybridPluginManagerSpec() {
17
+ auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
18
+ auto castHybridObject = std::dynamic_pointer_cast<JHybridPluginManagerSpec>(hybridObject);
19
+ if (castHybridObject == nullptr) [[unlikely]] {
20
+ throw std::runtime_error("Failed to downcast JHybridObject to JHybridPluginManagerSpec!");
21
+ }
22
+ return castHybridObject;
18
23
  }
19
24
 
20
- void JHybridPluginManagerSpec::registerNatives() {
21
- registerHybrid({
22
- makeNativeMethod("initHybrid", JHybridPluginManagerSpec::initHybrid),
23
- });
25
+ jni::local_ref<JHybridPluginManagerSpec::CxxPart::jhybriddata> JHybridPluginManagerSpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
26
+ return makeCxxInstance(jThis);
24
27
  }
25
28
 
26
- size_t JHybridPluginManagerSpec::getExternalMemorySize() noexcept {
27
- static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
28
- return method(_javaPart);
29
+ std::shared_ptr<JHybridObject> JHybridPluginManagerSpec::CxxPart::createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) {
30
+ auto castJavaPart = jni::dynamic_ref_cast<JHybridPluginManagerSpec::JavaPart>(javaPart);
31
+ if (castJavaPart == nullptr) [[unlikely]] {
32
+ throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridPluginManagerSpec::JavaPart!");
33
+ }
34
+ return std::make_shared<JHybridPluginManagerSpec>(castJavaPart);
29
35
  }
30
36
 
31
- void JHybridPluginManagerSpec::dispose() noexcept {
32
- static const auto method = javaClassStatic()->getMethod<void()>("dispose");
33
- method(_javaPart);
37
+ void JHybridPluginManagerSpec::CxxPart::registerNatives() {
38
+ registerHybrid({
39
+ makeNativeMethod("initHybrid", JHybridPluginManagerSpec::CxxPart::initHybrid),
40
+ });
34
41
  }
35
42
 
36
43
  // Properties
37
44
  bool JHybridPluginManagerSpec::getIsEnabled() {
38
- static const auto method = javaClassStatic()->getMethod<jboolean()>("isEnabled");
45
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jboolean()>("isEnabled");
39
46
  auto __result = method(_javaPart);
40
47
  return static_cast<bool>(__result);
41
48
  }
42
49
 
43
50
  // Methods
44
51
  void JHybridPluginManagerSpec::enable() {
45
- static const auto method = javaClassStatic()->getMethod<void()>("enable");
52
+ static const auto method = _javaPart->javaClassStatic()->getMethod<void()>("enable");
46
53
  method(_javaPart);
47
54
  }
48
55
  void JHybridPluginManagerSpec::disable() {
49
- static const auto method = javaClassStatic()->getMethod<void()>("disable");
56
+ static const auto method = _javaPart->javaClassStatic()->getMethod<void()>("disable");
50
57
  method(_javaPart);
51
58
  }
52
59
 
@@ -2,7 +2,7 @@
2
2
  /// HybridPluginManagerSpec.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -18,32 +18,33 @@ namespace margelo::nitro::videodrm {
18
18
 
19
19
  using namespace facebook;
20
20
 
21
- class JHybridPluginManagerSpec: public jni::HybridClass<JHybridPluginManagerSpec, JHybridObject>,
22
- public virtual HybridPluginManagerSpec {
21
+ class JHybridPluginManagerSpec: public virtual HybridPluginManagerSpec, public virtual JHybridObject {
23
22
  public:
24
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/videodrm/HybridPluginManagerSpec;";
25
- static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
26
- static void registerNatives();
27
-
28
- protected:
29
- // C++ constructor (called from Java via `initHybrid()`)
30
- explicit JHybridPluginManagerSpec(jni::alias_ref<jhybridobject> jThis) :
31
- HybridObject(HybridPluginManagerSpec::TAG),
32
- HybridBase(jThis),
33
- _javaPart(jni::make_global(jThis)) {}
23
+ struct JavaPart: public jni::JavaClass<JavaPart, JHybridObject::JavaPart> {
24
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/videodrm/HybridPluginManagerSpec;";
25
+ std::shared_ptr<JHybridPluginManagerSpec> getJHybridPluginManagerSpec();
26
+ };
27
+ struct CxxPart: public jni::HybridClass<CxxPart, JHybridObject::CxxPart> {
28
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/videodrm/HybridPluginManagerSpec$CxxPart;";
29
+ static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
30
+ static void registerNatives();
31
+ using HybridBase::HybridBase;
32
+ protected:
33
+ std::shared_ptr<JHybridObject> createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) override;
34
+ };
34
35
 
35
36
  public:
37
+ explicit JHybridPluginManagerSpec(const jni::local_ref<JHybridPluginManagerSpec::JavaPart>& javaPart):
38
+ HybridObject(HybridPluginManagerSpec::TAG),
39
+ JHybridObject(javaPart),
40
+ _javaPart(jni::make_global(javaPart)) {}
36
41
  ~JHybridPluginManagerSpec() override {
37
42
  // Hermes GC can destroy JS objects on a non-JNI Thread.
38
43
  jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
39
44
  }
40
45
 
41
46
  public:
42
- size_t getExternalMemorySize() noexcept override;
43
- void dispose() noexcept override;
44
-
45
- public:
46
- inline const jni::global_ref<JHybridPluginManagerSpec::javaobject>& getJavaPart() const noexcept {
47
+ inline const jni::global_ref<JHybridPluginManagerSpec::JavaPart>& getJavaPart() const noexcept {
47
48
  return _javaPart;
48
49
  }
49
50
 
@@ -57,9 +58,7 @@ namespace margelo::nitro::videodrm {
57
58
  void disable() override;
58
59
 
59
60
  private:
60
- friend HybridBase;
61
- using HybridBase::HybridBase;
62
- jni::global_ref<JHybridPluginManagerSpec::javaobject> _javaPart;
61
+ jni::global_ref<JHybridPluginManagerSpec::JavaPart> _javaPart;
63
62
  };
64
63
 
65
64
  } // namespace margelo::nitro::videodrm
@@ -2,7 +2,7 @@
2
2
  /// HybridPluginManagerSpec.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  package com.margelo.nitro.videodrm
@@ -10,7 +10,7 @@ package com.margelo.nitro.videodrm
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.jni.HybridData
12
12
  import com.facebook.proguard.annotations.DoNotStrip
13
- import com.margelo.nitro.core.*
13
+ import com.margelo.nitro.core.HybridObject
14
14
 
15
15
  /**
16
16
  * A Kotlin class representing the PluginManager HybridObject.
@@ -24,18 +24,6 @@ import com.margelo.nitro.core.*
24
24
  "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
25
25
  )
26
26
  abstract class HybridPluginManagerSpec: HybridObject() {
27
- @DoNotStrip
28
- private var mHybridData: HybridData = initHybrid()
29
-
30
- init {
31
- super.updateNative(mHybridData)
32
- }
33
-
34
- override fun updateNative(hybridData: HybridData) {
35
- mHybridData = hybridData
36
- super.updateNative(hybridData)
37
- }
38
-
39
27
  // Properties
40
28
  @get:DoNotStrip
41
29
  @get:Keep
@@ -50,7 +38,21 @@ abstract class HybridPluginManagerSpec: HybridObject() {
50
38
  @Keep
51
39
  abstract fun disable(): Unit
52
40
 
53
- private external fun initHybrid(): HybridData
41
+ // Default implementation of `HybridObject.toString()`
42
+ override fun toString(): String {
43
+ return "[HybridObject PluginManager]"
44
+ }
45
+
46
+ // C++ backing class
47
+ @DoNotStrip
48
+ @Keep
49
+ protected open class CxxPart(javaPart: HybridPluginManagerSpec): HybridObject.CxxPart(javaPart) {
50
+ // C++ JHybridPluginManagerSpec::CxxPart::initHybrid(...)
51
+ external override fun initHybrid(): HybridData
52
+ }
53
+ override fun createCxxPart(): CxxPart {
54
+ return CxxPart(this)
55
+ }
54
56
 
55
57
  companion object {
56
58
  protected const val TAG = "HybridPluginManagerSpec"
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeVideoDrmOnLoad.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  package com.margelo.nitro.videodrm
@@ -2,7 +2,7 @@
2
2
  # ReactNativeVideoDrm+autolinking.rb
3
3
  # This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  # https://github.com/mrousavy/nitro
5
- # Copyright © 2025 Marc Rousavy @ Margelo
5
+ # Copyright © Marc Rousavy @ Margelo
6
6
  #
7
7
 
8
8
  # This is a Ruby script that adds all files generated by Nitrogen
@@ -52,7 +52,7 @@ def add_nitrogen_files(spec)
52
52
  spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
53
53
  # Use C++ 20
54
54
  "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
55
- # Enables C++ <-> Swift interop (by default it's only C)
55
+ # Enables C++ <-> Swift interop (by default it's only ObjC)
56
56
  "SWIFT_OBJC_INTEROP_MODE" => "objcxx",
57
57
  # Enables stricter modular headers
58
58
  "DEFINES_MODULE" => "YES",
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeVideoDrm-Swift-Cxx-Bridge.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "ReactNativeVideoDrm-Swift-Cxx-Bridge.hpp"
@@ -10,6 +10,7 @@
10
10
  // Include C++ implementation defined types
11
11
  #include "HybridPluginManagerSpecSwift.hpp"
12
12
  #include "ReactNativeVideoDrm-Swift-Cxx-Umbrella.hpp"
13
+ #include <NitroModules/NitroDefines.hpp>
13
14
 
14
15
  namespace margelo::nitro::videodrm::bridge::swift {
15
16
 
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeVideoDrm-Swift-Cxx-Bridge.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeVideoDrm-Swift-Cxx-Umbrella.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeVideoDrmAutolinking.mm
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #import <Foundation/Foundation.h>
@@ -2,19 +2,16 @@
2
2
  /// ReactNativeVideoDrmAutolinking.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
+ import NitroModules
9
+
10
+ // TODO: Use empty enums once Swift supports exporting them as namespaces
11
+ // See: https://github.com/swiftlang/swift/pull/83616
8
12
  public final class ReactNativeVideoDrmAutolinking {
9
13
  public typealias bridge = margelo.nitro.videodrm.bridge.swift
10
14
 
11
- /**
12
- * Creates an instance of a Swift class that implements `HybridPluginManagerSpec`,
13
- * and wraps it in a Swift class that can directly interop with C++ (`HybridPluginManagerSpec_cxx`)
14
- *
15
- * This is generated by Nitrogen and will initialize the class specified
16
- * in the `"autolinking"` property of `nitro.json` (in this case, `PluginManager`).
17
- */
18
15
  public static func createPluginManager() -> bridge.std__shared_ptr_HybridPluginManagerSpec_ {
19
16
  let hybridObject = PluginManager()
20
17
  return { () -> bridge.std__shared_ptr_HybridPluginManagerSpec_ in
@@ -22,4 +19,8 @@ public final class ReactNativeVideoDrmAutolinking {
22
19
  return __cxxWrapped.getCxxPart()
23
20
  }()
24
21
  }
22
+
23
+ public static func isPluginManagerRecyclable() -> Bool {
24
+ return PluginManager.self is any RecyclableView.Type
25
+ }
25
26
  }
@@ -2,7 +2,7 @@
2
2
  /// HybridPluginManagerSpecSwift.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "HybridPluginManagerSpecSwift.hpp"
@@ -2,7 +2,7 @@
2
2
  /// HybridPluginManagerSpecSwift.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -47,9 +47,18 @@ namespace margelo::nitro::videodrm {
47
47
  inline size_t getExternalMemorySize() noexcept override {
48
48
  return _swiftPart.getMemorySize();
49
49
  }
50
+ bool equals(const std::shared_ptr<HybridObject>& other) override {
51
+ if (auto otherCast = std::dynamic_pointer_cast<HybridPluginManagerSpecSwift>(other)) {
52
+ return _swiftPart.equals(otherCast->_swiftPart);
53
+ }
54
+ return false;
55
+ }
50
56
  void dispose() noexcept override {
51
57
  _swiftPart.dispose();
52
58
  }
59
+ std::string toString() override {
60
+ return _swiftPart.toString();
61
+ }
53
62
 
54
63
  public:
55
64
  // Properties
@@ -2,10 +2,9 @@
2
2
  /// HybridPluginManagerSpec.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /// See ``HybridPluginManagerSpec``
@@ -18,20 +17,27 @@ public protocol HybridPluginManagerSpec_protocol: HybridObject {
18
17
  func disable() throws -> Void
19
18
  }
20
19
 
20
+ public extension HybridPluginManagerSpec_protocol {
21
+ /// Default implementation of ``HybridObject.toString``
22
+ func toString() -> String {
23
+ return "[HybridObject PluginManager]"
24
+ }
25
+ }
26
+
21
27
  /// See ``HybridPluginManagerSpec``
22
28
  open class HybridPluginManagerSpec_base {
23
29
  private weak var cxxWrapper: HybridPluginManagerSpec_cxx? = nil
24
30
  public init() { }
25
31
  public func getCxxWrapper() -> HybridPluginManagerSpec_cxx {
26
32
  #if DEBUG
27
- guard self is HybridPluginManagerSpec else {
33
+ guard self is any HybridPluginManagerSpec else {
28
34
  fatalError("`self` is not a `HybridPluginManagerSpec`! Did you accidentally inherit from `HybridPluginManagerSpec_base` instead of `HybridPluginManagerSpec`?")
29
35
  }
30
36
  #endif
31
37
  if let cxxWrapper = self.cxxWrapper {
32
38
  return cxxWrapper
33
39
  } else {
34
- let cxxWrapper = HybridPluginManagerSpec_cxx(self as! HybridPluginManagerSpec)
40
+ let cxxWrapper = HybridPluginManagerSpec_cxx(self as! any HybridPluginManagerSpec)
35
41
  self.cxxWrapper = cxxWrapper
36
42
  return cxxWrapper
37
43
  }
@@ -2,10 +2,9 @@
2
2
  /// HybridPluginManagerSpec_cxx.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /**
@@ -76,7 +75,7 @@ open class HybridPluginManagerSpec_cxx {
76
75
  */
77
76
  public func getCxxPart() -> bridge.std__shared_ptr_HybridPluginManagerSpec_ {
78
77
  let cachedCxxPart = self.__cxxPart.lock()
79
- if cachedCxxPart.__convertToBool() {
78
+ if Bool(fromCxx: cachedCxxPart) {
80
79
  return cachedCxxPart
81
80
  } else {
82
81
  let newCxxPart = bridge.create_std__shared_ptr_HybridPluginManagerSpec_(self.toUnsafe())
@@ -96,6 +95,14 @@ open class HybridPluginManagerSpec_cxx {
96
95
  return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
97
96
  }
98
97
 
98
+ /**
99
+ * Compares this object with the given [other] object for reference equality.
100
+ */
101
+ @inline(__always)
102
+ public func equals(other: HybridPluginManagerSpec_cxx) -> Bool {
103
+ return self.__implementation === other.__implementation
104
+ }
105
+
99
106
  /**
100
107
  * Call dispose() on the Swift class.
101
108
  * This _may_ be called manually from JS.
@@ -105,6 +112,14 @@ open class HybridPluginManagerSpec_cxx {
105
112
  self.__implementation.dispose()
106
113
  }
107
114
 
115
+ /**
116
+ * Call toString() on the Swift class.
117
+ */
118
+ @inline(__always)
119
+ public func toString() -> String {
120
+ return self.__implementation.toString()
121
+ }
122
+
108
123
  // Properties
109
124
  public final var isEnabled: Bool {
110
125
  @inline(__always)
@@ -2,7 +2,7 @@
2
2
  /// HybridPluginManagerSpec.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "HybridPluginManagerSpec.hpp"
@@ -2,7 +2,7 @@
2
2
  /// HybridPluginManagerSpec.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-video/drm",
3
- "version": "7.0.0-beta.0",
3
+ "version": "7.0.0-beta.11",
4
4
  "description": "DRM plugin for react-native-video",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -66,19 +66,17 @@
66
66
  },
67
67
  "devDependencies": {
68
68
  "@react-native/babel-preset": "0.79.2",
69
- "@release-it/conventional-changelog": "^9.0.2",
70
69
  "@types/react": "^18.3.0",
71
70
  "del-cli": "^5.1.0",
72
71
  "eslint": "^8.51.0",
73
72
  "eslint-config-prettier": "9.0.0",
74
73
  "eslint-plugin-prettier": "^5.0.1",
75
- "nitrogen": "^0.30.0",
74
+ "nitrogen": "0.35.0",
76
75
  "prettier": "^3.0.3",
77
76
  "react": "18.3.1",
78
77
  "react-native": "^0.77.0",
79
78
  "react-native-builder-bob": "^0.40.13",
80
- "react-native-nitro-modules": "^0.30.0",
81
- "release-it": "^17.10.0",
79
+ "react-native-nitro-modules": "0.35.0",
82
80
  "typescript": "^5.8.3",
83
81
  "react-native-video": "*"
84
82
  },
@@ -86,7 +84,7 @@
86
84
  "react": "*",
87
85
  "react-native": "*",
88
86
  "react-native-video": ">=7.0.0-alpha.3",
89
- "react-native-nitro-modules": ">=0.27.2"
87
+ "react-native-nitro-modules": ">=0.35.0"
90
88
  },
91
89
  "jest": {
92
90
  "preset": "react-native",
@@ -96,7 +94,12 @@
96
94
  ]
97
95
  },
98
96
  "release-it": {
99
- "git": false,
97
+ "git": {
98
+ "commit": false,
99
+ "tag": false,
100
+ "push": false,
101
+ "requireUpstream": false
102
+ },
100
103
  "npm": {
101
104
  "publish": true,
102
105
  "publishArgs": "--access public"
@@ -1,7 +1,9 @@
1
1
  import type { HybridObject } from 'react-native-nitro-modules';
2
2
 
3
- export interface PluginManager
4
- extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> {
3
+ export interface PluginManager extends HybridObject<{
4
+ ios: 'swift';
5
+ android: 'kotlin';
6
+ }> {
5
7
  enable(): void;
6
8
  disable(): void;
7
9
  readonly isEnabled: boolean;