react-native-audio-browser 0.2.0-next.4 → 0.2.0-next.6
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.
- package/android/src/main/java/com/audiobrowser/model/PlayerUpdateOptions.kt +11 -11
- package/android/src/main/java/com/audiobrowser/player/CapabilityControls.kt +111 -58
- package/android/src/main/java/com/audiobrowser/player/MediaSessionCallback.kt +9 -5
- package/android/src/main/java/com/audiobrowser/player/MediaSessionCommandManager.kt +218 -252
- package/android/src/main/java/com/audiobrowser/player/Player.kt +19 -8
- package/android/src/test/java/com/audiobrowser/player/CapabilityControlsTest.kt +100 -56
- package/android/src/test/java/com/audiobrowser/player/MediaSessionSlotMappingTest.kt +45 -0
- package/lib/commonjs/features/player/options.js +45 -15
- package/lib/commonjs/features/player/options.js.map +1 -1
- package/lib/commonjs/features/player/setup.js +13 -6
- package/lib/commonjs/features/player/setup.js.map +1 -1
- package/lib/module/features/player/options.js +45 -15
- package/lib/module/features/player/options.js.map +1 -1
- package/lib/module/features/player/setup.js +13 -6
- package/lib/module/features/player/setup.js.map +1 -1
- package/lib/typescript/src/features/player/options.d.ts +86 -36
- package/lib/typescript/src/features/player/options.d.ts.map +1 -1
- package/lib/typescript/src/features/player/setup.d.ts +10 -3
- package/lib/typescript/src/features/player/setup.d.ts.map +1 -1
- package/nitrogen/generated/android/AudioBrowser+autolinking.cmake +1 -1
- package/nitrogen/generated/android/c++/JAndroidOptions.hpp +10 -10
- package/nitrogen/generated/android/c++/JFunc_void_Options.hpp +5 -5
- package/nitrogen/generated/android/c++/JHybridAudioBrowserSpec.cpp +9 -9
- package/nitrogen/generated/android/c++/JNativeSetupPlayerOptions.hpp +5 -5
- package/nitrogen/generated/android/c++/JNativeUpdateOptions.hpp +5 -5
- package/nitrogen/generated/android/c++/JNitroAndroidUpdateOptions.hpp +10 -10
- package/nitrogen/generated/android/c++/JOptions.hpp +5 -5
- package/nitrogen/generated/android/c++/{JNotificationButton.hpp → JRemoteButton.hpp} +19 -19
- package/nitrogen/generated/android/c++/JRemoteButtonLayout.hpp +86 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_RemoteButtonLayout.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_RemoteButtonLayout.hpp +75 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/AndroidOptions.kt +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/NitroAndroidUpdateOptions.kt +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/{NotificationButton.kt → RemoteButton.kt} +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/RemoteButtonLayout.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/{Variant_NullType_NotificationButtonLayout.kt → Variant_NullType_RemoteButtonLayout.kt} +9 -9
- package/nitrogen/generated/ios/AudioBrowser-Swift-Cxx-Bridge.hpp +36 -51
- package/nitrogen/generated/ios/AudioBrowser-Swift-Cxx-Umbrella.hpp +6 -6
- package/nitrogen/generated/ios/c++/HybridAudioBrowserSpecSwift.hpp +6 -6
- package/nitrogen/generated/ios/swift/AndroidOptions.swift +12 -12
- package/nitrogen/generated/ios/swift/NitroAndroidUpdateOptions.swift +12 -12
- package/nitrogen/generated/ios/swift/{NotificationButton.swift → RemoteButton.swift} +6 -6
- package/nitrogen/generated/ios/swift/RemoteButtonLayout.swift +57 -0
- package/nitrogen/generated/ios/swift/{Variant_NullType_NotificationButtonLayout.swift → Variant_NullType_RemoteButtonLayout.swift} +3 -3
- package/nitrogen/generated/shared/c++/AndroidOptions.hpp +8 -8
- package/nitrogen/generated/shared/c++/NitroAndroidUpdateOptions.hpp +8 -8
- package/nitrogen/generated/shared/c++/{NotificationButton.hpp → RemoteButton.hpp} +19 -19
- package/nitrogen/generated/shared/c++/RemoteButtonLayout.hpp +94 -0
- package/package.json +1 -1
- package/src/features/player/options.ts +97 -37
- package/src/features/player/setup.test.ts +12 -4
- package/src/features/player/setup.ts +14 -7
- package/nitrogen/generated/android/c++/JNotificationButtonLayout.hpp +0 -94
- package/nitrogen/generated/android/c++/JVariant_NullType_NotificationButtonLayout.cpp +0 -26
- package/nitrogen/generated/android/c++/JVariant_NullType_NotificationButtonLayout.hpp +0 -75
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/NotificationButtonLayout.kt +0 -50
- package/nitrogen/generated/ios/swift/NotificationButtonLayout.swift +0 -92
- package/nitrogen/generated/shared/c++/NotificationButtonLayout.hpp +0 -102
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// NotificationButtonLayout.swift
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
import NitroModules
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Represents an instance of `NotificationButtonLayout`, backed by a C++ struct.
|
|
12
|
-
*/
|
|
13
|
-
public typealias NotificationButtonLayout = margelo.nitro.audiobrowser.NotificationButtonLayout
|
|
14
|
-
|
|
15
|
-
public extension NotificationButtonLayout {
|
|
16
|
-
private typealias bridge = margelo.nitro.audiobrowser.bridge.swift
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Create a new instance of `NotificationButtonLayout`.
|
|
20
|
-
*/
|
|
21
|
-
init(back: NotificationButton?, forward: NotificationButton?, backSecondary: NotificationButton?, forwardSecondary: NotificationButton?, overflow: [NotificationButton]?) {
|
|
22
|
-
self.init({ () -> bridge.std__optional_NotificationButton_ in
|
|
23
|
-
if let __unwrappedValue = back {
|
|
24
|
-
return bridge.create_std__optional_NotificationButton_(__unwrappedValue)
|
|
25
|
-
} else {
|
|
26
|
-
return .init()
|
|
27
|
-
}
|
|
28
|
-
}(), { () -> bridge.std__optional_NotificationButton_ in
|
|
29
|
-
if let __unwrappedValue = forward {
|
|
30
|
-
return bridge.create_std__optional_NotificationButton_(__unwrappedValue)
|
|
31
|
-
} else {
|
|
32
|
-
return .init()
|
|
33
|
-
}
|
|
34
|
-
}(), { () -> bridge.std__optional_NotificationButton_ in
|
|
35
|
-
if let __unwrappedValue = backSecondary {
|
|
36
|
-
return bridge.create_std__optional_NotificationButton_(__unwrappedValue)
|
|
37
|
-
} else {
|
|
38
|
-
return .init()
|
|
39
|
-
}
|
|
40
|
-
}(), { () -> bridge.std__optional_NotificationButton_ in
|
|
41
|
-
if let __unwrappedValue = forwardSecondary {
|
|
42
|
-
return bridge.create_std__optional_NotificationButton_(__unwrappedValue)
|
|
43
|
-
} else {
|
|
44
|
-
return .init()
|
|
45
|
-
}
|
|
46
|
-
}(), { () -> bridge.std__optional_std__vector_NotificationButton__ in
|
|
47
|
-
if let __unwrappedValue = overflow {
|
|
48
|
-
return bridge.create_std__optional_std__vector_NotificationButton__({ () -> bridge.std__vector_NotificationButton_ in
|
|
49
|
-
var __vector = bridge.create_std__vector_NotificationButton_(__unwrappedValue.count)
|
|
50
|
-
for __item in __unwrappedValue {
|
|
51
|
-
__vector.push_back(__item)
|
|
52
|
-
}
|
|
53
|
-
return __vector
|
|
54
|
-
}())
|
|
55
|
-
} else {
|
|
56
|
-
return .init()
|
|
57
|
-
}
|
|
58
|
-
}())
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@inline(__always)
|
|
62
|
-
var back: NotificationButton? {
|
|
63
|
-
return self.__back.value
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@inline(__always)
|
|
67
|
-
var forward: NotificationButton? {
|
|
68
|
-
return self.__forward.value
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
@inline(__always)
|
|
72
|
-
var backSecondary: NotificationButton? {
|
|
73
|
-
return self.__backSecondary.value
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
@inline(__always)
|
|
77
|
-
var forwardSecondary: NotificationButton? {
|
|
78
|
-
return self.__forwardSecondary.value
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
@inline(__always)
|
|
82
|
-
var overflow: [NotificationButton]? {
|
|
83
|
-
return { () -> [NotificationButton]? in
|
|
84
|
-
if bridge.has_value_std__optional_std__vector_NotificationButton__(self.__overflow) {
|
|
85
|
-
let __unwrapped = bridge.get_std__optional_std__vector_NotificationButton__(self.__overflow)
|
|
86
|
-
return __unwrapped.map({ __item in __item })
|
|
87
|
-
} else {
|
|
88
|
-
return nil
|
|
89
|
-
}
|
|
90
|
-
}()
|
|
91
|
-
}
|
|
92
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// NotificationButtonLayout.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
-
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
-
#else
|
|
18
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
-
#endif
|
|
20
|
-
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
-
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
-
#else
|
|
23
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
-
#endif
|
|
25
|
-
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
-
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
-
#else
|
|
28
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
-
#endif
|
|
30
|
-
|
|
31
|
-
// Forward declaration of `NotificationButton` to properly resolve imports.
|
|
32
|
-
namespace margelo::nitro::audiobrowser { enum class NotificationButton; }
|
|
33
|
-
|
|
34
|
-
#include "NotificationButton.hpp"
|
|
35
|
-
#include <optional>
|
|
36
|
-
#include <vector>
|
|
37
|
-
|
|
38
|
-
namespace margelo::nitro::audiobrowser {
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* A struct which can be represented as a JavaScript object (NotificationButtonLayout).
|
|
42
|
-
*/
|
|
43
|
-
struct NotificationButtonLayout final {
|
|
44
|
-
public:
|
|
45
|
-
std::optional<NotificationButton> back SWIFT_PRIVATE;
|
|
46
|
-
std::optional<NotificationButton> forward SWIFT_PRIVATE;
|
|
47
|
-
std::optional<NotificationButton> backSecondary SWIFT_PRIVATE;
|
|
48
|
-
std::optional<NotificationButton> forwardSecondary SWIFT_PRIVATE;
|
|
49
|
-
std::optional<std::vector<NotificationButton>> overflow SWIFT_PRIVATE;
|
|
50
|
-
|
|
51
|
-
public:
|
|
52
|
-
NotificationButtonLayout() = default;
|
|
53
|
-
explicit NotificationButtonLayout(std::optional<NotificationButton> back, std::optional<NotificationButton> forward, std::optional<NotificationButton> backSecondary, std::optional<NotificationButton> forwardSecondary, std::optional<std::vector<NotificationButton>> overflow): back(back), forward(forward), backSecondary(backSecondary), forwardSecondary(forwardSecondary), overflow(overflow) {}
|
|
54
|
-
|
|
55
|
-
public:
|
|
56
|
-
friend bool operator==(const NotificationButtonLayout& lhs, const NotificationButtonLayout& rhs) = default;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
} // namespace margelo::nitro::audiobrowser
|
|
60
|
-
|
|
61
|
-
namespace margelo::nitro {
|
|
62
|
-
|
|
63
|
-
// C++ NotificationButtonLayout <> JS NotificationButtonLayout (object)
|
|
64
|
-
template <>
|
|
65
|
-
struct JSIConverter<margelo::nitro::audiobrowser::NotificationButtonLayout> final {
|
|
66
|
-
static inline margelo::nitro::audiobrowser::NotificationButtonLayout fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
67
|
-
jsi::Object obj = arg.asObject(runtime);
|
|
68
|
-
return margelo::nitro::audiobrowser::NotificationButtonLayout(
|
|
69
|
-
JSIConverter<std::optional<margelo::nitro::audiobrowser::NotificationButton>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "back"))),
|
|
70
|
-
JSIConverter<std::optional<margelo::nitro::audiobrowser::NotificationButton>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "forward"))),
|
|
71
|
-
JSIConverter<std::optional<margelo::nitro::audiobrowser::NotificationButton>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "backSecondary"))),
|
|
72
|
-
JSIConverter<std::optional<margelo::nitro::audiobrowser::NotificationButton>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "forwardSecondary"))),
|
|
73
|
-
JSIConverter<std::optional<std::vector<margelo::nitro::audiobrowser::NotificationButton>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "overflow")))
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::audiobrowser::NotificationButtonLayout& arg) {
|
|
77
|
-
jsi::Object obj(runtime);
|
|
78
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "back"), JSIConverter<std::optional<margelo::nitro::audiobrowser::NotificationButton>>::toJSI(runtime, arg.back));
|
|
79
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "forward"), JSIConverter<std::optional<margelo::nitro::audiobrowser::NotificationButton>>::toJSI(runtime, arg.forward));
|
|
80
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "backSecondary"), JSIConverter<std::optional<margelo::nitro::audiobrowser::NotificationButton>>::toJSI(runtime, arg.backSecondary));
|
|
81
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "forwardSecondary"), JSIConverter<std::optional<margelo::nitro::audiobrowser::NotificationButton>>::toJSI(runtime, arg.forwardSecondary));
|
|
82
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "overflow"), JSIConverter<std::optional<std::vector<margelo::nitro::audiobrowser::NotificationButton>>>::toJSI(runtime, arg.overflow));
|
|
83
|
-
return obj;
|
|
84
|
-
}
|
|
85
|
-
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
86
|
-
if (!value.isObject()) {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
jsi::Object obj = value.getObject(runtime);
|
|
90
|
-
if (!nitro::isPlainObject(runtime, obj)) {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
if (!JSIConverter<std::optional<margelo::nitro::audiobrowser::NotificationButton>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "back")))) return false;
|
|
94
|
-
if (!JSIConverter<std::optional<margelo::nitro::audiobrowser::NotificationButton>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "forward")))) return false;
|
|
95
|
-
if (!JSIConverter<std::optional<margelo::nitro::audiobrowser::NotificationButton>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "backSecondary")))) return false;
|
|
96
|
-
if (!JSIConverter<std::optional<margelo::nitro::audiobrowser::NotificationButton>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "forwardSecondary")))) return false;
|
|
97
|
-
if (!JSIConverter<std::optional<std::vector<margelo::nitro::audiobrowser::NotificationButton>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "overflow")))) return false;
|
|
98
|
-
return true;
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
} // namespace margelo::nitro
|