react-native-spalla-player 1.0.1 → 1.0.3
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/spallaplayer/SpallaPlayerPackage.kt +30 -14
- package/lib/module/SpallaPlayerViewNativeComponent.js +7 -1
- package/lib/module/SpallaPlayerViewNativeComponent.js.map +1 -1
- package/lib/typescript/src/SpallaPlayerViewNativeComponent.d.ts +10 -8
- package/lib/typescript/src/SpallaPlayerViewNativeComponent.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/SpallaPlayerViewNativeComponent.ts +15 -13
|
@@ -1,24 +1,40 @@
|
|
|
1
1
|
package com.spallaplayer
|
|
2
2
|
|
|
3
|
-
import com.facebook.react.
|
|
3
|
+
import com.facebook.react.BaseReactPackage
|
|
4
|
+
import com.facebook.react.bridge.ModuleSpec
|
|
4
5
|
import com.facebook.react.bridge.NativeModule
|
|
5
6
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
-
import com.facebook.react.
|
|
7
|
+
import com.facebook.react.module.model.ReactModuleInfo
|
|
8
|
+
import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
7
9
|
import com.spallaplayer.components.RNGoogleCastButtonManager
|
|
8
|
-
import java.util.ArrayList
|
|
9
10
|
|
|
10
|
-
class SpallaPlayerViewPackage :
|
|
11
|
-
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
|
12
|
-
val viewManagers: MutableList<ViewManager<*, *>> = ArrayList()
|
|
13
|
-
viewManagers.add(SpallaPlayerViewManager())
|
|
14
|
-
viewManagers.add(RNGoogleCastButtonManager())
|
|
15
|
-
return viewManagers
|
|
16
|
-
}
|
|
11
|
+
class SpallaPlayerViewPackage : BaseReactPackage() {
|
|
17
12
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
override fun getViewManagers(
|
|
14
|
+
reactContext: ReactApplicationContext
|
|
15
|
+
): List<ModuleSpec> =
|
|
16
|
+
listOf(
|
|
17
|
+
ModuleSpec.viewManagerSpec {
|
|
18
|
+
SpallaPlayerViewManager()
|
|
19
|
+
},
|
|
20
|
+
ModuleSpec.viewManagerSpec {
|
|
21
|
+
RNGoogleCastButtonManager()
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider =
|
|
26
|
+
ReactModuleInfoProvider {
|
|
27
|
+
mapOf(
|
|
28
|
+
SpallaPlayerModule.REACT_NAME to ReactModuleInfo(
|
|
29
|
+
SpallaPlayerModule.REACT_NAME,
|
|
30
|
+
className = SpallaPlayerModule::class.java.name,
|
|
31
|
+
canOverrideExistingModule = false,
|
|
32
|
+
needsEagerInit = false,
|
|
33
|
+
isCxxModule = false,
|
|
34
|
+
isTurboModule = false
|
|
35
|
+
)
|
|
36
|
+
)
|
|
37
|
+
}
|
|
22
38
|
|
|
23
39
|
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
24
40
|
return when (name) {
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// NOTE: codegenNativeComponent MUST be imported from RN internals for Fabric.
|
|
4
|
+
// Do not change this import to `from 'react-native'`.
|
|
5
|
+
/* eslint-disable @react-native/no-deep-imports */
|
|
6
|
+
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
7
|
+
|
|
8
|
+
/* eslint-disable @react-native/no-deep-imports */
|
|
9
|
+
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
4
10
|
|
|
5
11
|
// Define a single comprehensive event payload interface
|
|
6
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["codegenNativeComponent","codegenNativeCommands","Commands","supportedCommands"],"sourceRoot":"../../src","sources":["SpallaPlayerViewNativeComponent.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent","codegenNativeCommands","Commands","supportedCommands"],"sourceRoot":"../../src","sources":["SpallaPlayerViewNativeComponent.ts"],"mappings":";;AAEA;AACA;AACA;AACA,OAAOA,sBAAsB,MAAM,yDAAyD;;AAE5F;AACA,OAAOC,qBAAqB,MAAM,wDAAwD;;AAE1F;;AAyCA,OAAO,MAAMC,QAAwB,GAAGD,qBAAqB,CAAiB;EAC5EE,iBAAiB,EAAE,CACjB,MAAM,EACN,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,oBAAoB,EACpB,SAAS;AAEb,CAAC,CAAC;AAEF,eAAeH,sBAAsB,CAAc,kBAAkB,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ViewProps, CodegenTypes, HostComponent } from 'react-native';
|
|
2
2
|
interface PlayerEventPayload {
|
|
3
3
|
event: string;
|
|
4
4
|
time?: CodegenTypes.Double;
|
|
@@ -20,14 +20,16 @@ export interface NativeProps extends ViewProps {
|
|
|
20
20
|
onPlayerEvent?: CodegenTypes.BubblingEventHandler<PlayerEventPayload>;
|
|
21
21
|
}
|
|
22
22
|
export interface NativeCommands {
|
|
23
|
-
play: (viewRef: React.ElementRef<HostComponent<
|
|
24
|
-
pause: (viewRef: React.ElementRef<HostComponent<
|
|
25
|
-
seekTo: (viewRef: React.ElementRef<HostComponent<
|
|
26
|
-
selectSubtitle: (viewRef: React.ElementRef<HostComponent<
|
|
27
|
-
selectPlaybackRate: (viewRef: React.ElementRef<HostComponent<
|
|
28
|
-
unmount: (viewRef: React.ElementRef<HostComponent<
|
|
23
|
+
play: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
24
|
+
pause: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
25
|
+
seekTo: (viewRef: React.ElementRef<HostComponent<NativeProps>>, time: CodegenTypes.Double) => void;
|
|
26
|
+
selectSubtitle: (viewRef: React.ElementRef<HostComponent<NativeProps>>, subtitle: string | null) => void;
|
|
27
|
+
selectPlaybackRate: (viewRef: React.ElementRef<HostComponent<NativeProps>>, rate: CodegenTypes.Float) => void;
|
|
28
|
+
unmount: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
29
29
|
}
|
|
30
30
|
export declare const Commands: NativeCommands;
|
|
31
|
-
declare const _default:
|
|
31
|
+
declare const _default: (props: Omit<NativeProps, "ref"> & {
|
|
32
|
+
ref?: React.Ref<import("react-native").HostInstance>;
|
|
33
|
+
}) => React.ReactNode;
|
|
32
34
|
export default _default;
|
|
33
35
|
//# sourceMappingURL=SpallaPlayerViewNativeComponent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpallaPlayerViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/SpallaPlayerViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"SpallaPlayerViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/SpallaPlayerViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAW3E,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,O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3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Spalla Player for React Native",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"source": "./src/index.tsx",
|
|
10
|
+
"import": "./lib/module/index.js",
|
|
10
11
|
"types": "./lib/typescript/src/index.d.ts",
|
|
11
12
|
"default": "./lib/module/index.js"
|
|
12
13
|
},
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type { ViewProps, CodegenTypes, HostComponent } from 'react-native';
|
|
2
|
+
|
|
3
|
+
// NOTE: codegenNativeComponent MUST be imported from RN internals for Fabric.
|
|
4
|
+
// Do not change this import to `from 'react-native'`.
|
|
5
|
+
/* eslint-disable @react-native/no-deep-imports */
|
|
6
|
+
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
7
|
+
|
|
8
|
+
/* eslint-disable @react-native/no-deep-imports */
|
|
9
|
+
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
8
10
|
|
|
9
11
|
// Define a single comprehensive event payload interface
|
|
10
12
|
interface PlayerEventPayload {
|
|
@@ -30,21 +32,21 @@ export interface NativeProps extends ViewProps {
|
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
export interface NativeCommands {
|
|
33
|
-
play: (viewRef: React.ElementRef<HostComponent<
|
|
34
|
-
pause: (viewRef: React.ElementRef<HostComponent<
|
|
35
|
+
play: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
36
|
+
pause: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
35
37
|
seekTo: (
|
|
36
|
-
viewRef: React.ElementRef<HostComponent<
|
|
38
|
+
viewRef: React.ElementRef<HostComponent<NativeProps>>,
|
|
37
39
|
time: CodegenTypes.Double
|
|
38
40
|
) => void;
|
|
39
41
|
selectSubtitle: (
|
|
40
|
-
viewRef: React.ElementRef<HostComponent<
|
|
42
|
+
viewRef: React.ElementRef<HostComponent<NativeProps>>,
|
|
41
43
|
subtitle: string | null
|
|
42
44
|
) => void;
|
|
43
45
|
selectPlaybackRate: (
|
|
44
|
-
viewRef: React.ElementRef<HostComponent<
|
|
46
|
+
viewRef: React.ElementRef<HostComponent<NativeProps>>,
|
|
45
47
|
rate: CodegenTypes.Float
|
|
46
48
|
) => void;
|
|
47
|
-
unmount: (viewRef: React.ElementRef<HostComponent<
|
|
49
|
+
unmount: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|