react-native-spalla-player 0.13.3 → 1.0.0
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/LICENSE +2 -3
- package/SpallaPlayer.podspec +22 -0
- package/android/build.gradle +22 -58
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifest.xml +1 -2
- package/android/src/main/java/com/spallaplayer/RNSpallaPlayerEvent.kt +19 -0
- package/android/src/main/java/com/spallaplayer/SpallaPlayerModule.fabric.kt +103 -0
- package/android/src/main/java/com/spallaplayer/SpallaPlayerModule.kt +32 -21
- package/android/src/main/java/com/spallaplayer/SpallaPlayerPackage.kt +18 -4
- package/android/src/main/java/com/spallaplayer/SpallaPlayerView.kt +15 -0
- package/android/src/main/java/com/spallaplayer/SpallaPlayerViewManager.fabric.kt +289 -0
- package/android/src/main/java/com/spallaplayer/SpallaPlayerViewManager.kt +25 -27
- package/ios/SpallaPlayerModule.h +17 -0
- package/ios/SpallaPlayerModule.mm +59 -0
- package/ios/SpallaPlayerView.h +14 -0
- package/ios/SpallaPlayerView.mm +158 -0
- package/ios/SpallaPlayerWrapper.swift +12 -8
- package/lib/module/NativeSpallaPlayerModule.js +5 -0
- package/lib/module/NativeSpallaPlayerModule.js.map +1 -0
- package/lib/module/SpallaPlayerViewNativeComponent.js +11 -0
- package/lib/module/SpallaPlayerViewNativeComponent.js.map +1 -0
- package/lib/module/index.js +48 -55
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NativeSpallaPlayerModule.d.ts +13 -0
- package/lib/typescript/src/NativeSpallaPlayerModule.d.ts.map +1 -0
- package/lib/typescript/src/SpallaPlayerViewNativeComponent.d.ts +33 -0
- package/lib/typescript/src/SpallaPlayerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/components/CastButton.d.ts.map +1 -0
- package/lib/typescript/{module/src → src}/index.d.ts +9 -15
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +93 -103
- package/src/NativeSpallaPlayerModule.ts +14 -0
- package/src/SpallaPlayerViewNativeComponent.ts +61 -0
- package/src/index.tsx +71 -82
- package/android/src/main/AndroidManifestNew.xml +0 -2
- package/android/src/main/java/com/spallaplayer/SpallaPlayerContainerView.kt +0 -36
- package/ios/RNSpallaPlayer.m +0 -102
- package/ios/RNSpallaPlayer.swift +0 -11
- package/ios/SpallaPlayer-Bridging-Header.h +0 -1
- package/lib/commonjs/components/CastButton.js +0 -49
- package/lib/commonjs/components/CastButton.js.map +0 -1
- package/lib/commonjs/index.js +0 -81
- package/lib/commonjs/index.js.map +0 -1
- package/lib/typescript/commonjs/package.json +0 -1
- package/lib/typescript/commonjs/src/components/CastButton.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/index.d.ts +0 -61
- package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
- package/lib/typescript/module/src/components/CastButton.d.ts +0 -13
- package/lib/typescript/module/src/components/CastButton.d.ts.map +0 -1
- package/lib/typescript/module/src/index.d.ts.map +0 -1
- package/react-native-spalla-player.podspec +0 -44
- /package/lib/{typescript/module → module}/package.json +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/CastButton.d.ts +0 -0
|
@@ -13,50 +13,53 @@ import SpallaSDK
|
|
|
13
13
|
|
|
14
14
|
let viewController: SpallaPlayerViewController
|
|
15
15
|
|
|
16
|
-
@objc var contentId: String? {
|
|
16
|
+
@objc public var contentId: String? {
|
|
17
17
|
didSet {
|
|
18
18
|
print("Content id: \(contentId ?? "nil")")
|
|
19
19
|
// hacky! this needs to be delayed a bit so hideUI and startTime can be set first when comming from RN
|
|
20
|
+
// should replace with an object so all props are set at once
|
|
20
21
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [self] in
|
|
21
22
|
self.setupPlayer()
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
|
|
28
|
+
@objc public var muted: Bool = false {
|
|
27
29
|
didSet {
|
|
28
30
|
print("Mute called \(muted)")
|
|
29
31
|
updateMutedState()
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
@objc var hideUI: Bool = false {
|
|
35
|
+
@objc public var hideUI: Bool = false {
|
|
34
36
|
didSet {
|
|
35
37
|
print("Hide UI set to \(hideUI)")
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
|
|
40
|
-
@objc var startTime: NSNumber =
|
|
42
|
+
@objc public var startTime: NSNumber = 0.0 {
|
|
41
43
|
didSet {
|
|
42
44
|
print("Start time set \(startTime)")
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
47
|
|
|
46
|
-
@objc var subtitle: String? = nil {
|
|
48
|
+
@objc public var subtitle: String? = nil {
|
|
47
49
|
didSet {
|
|
48
50
|
print("Subtitle set \(subtitle ?? "nil")")
|
|
49
51
|
viewController.selectSubtitle(subtitle: subtitle)
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
@objc var playbackRate: NSNumber = 1.0 {
|
|
55
|
+
@objc public var playbackRate: NSNumber = 1.0 {
|
|
54
56
|
didSet {
|
|
55
57
|
viewController.setPlaybackRate(rate: playbackRate.doubleValue)
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
|
|
59
|
-
@objc var onPlayerEvent:
|
|
61
|
+
@objc public var onPlayerEvent: (([String: Any]) -> Void)?
|
|
62
|
+
|
|
60
63
|
|
|
61
64
|
convenience public init() {
|
|
62
65
|
self.init(frame: CGRect.zero)
|
|
@@ -129,8 +132,9 @@ import SpallaSDK
|
|
|
129
132
|
}
|
|
130
133
|
|
|
131
134
|
@objc public func unmount() {
|
|
135
|
+
print("Unmount called")
|
|
132
136
|
viewController.pause()
|
|
133
|
-
viewController.removeFromParent()
|
|
137
|
+
//viewController.removeFromParent()
|
|
134
138
|
}
|
|
135
139
|
|
|
136
140
|
deinit {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeSpallaPlayerModule.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAYlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,oBAAoB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { codegenNativeComponent, codegenNativeCommands } from 'react-native';
|
|
4
|
+
|
|
5
|
+
// Define a single comprehensive event payload interface
|
|
6
|
+
|
|
7
|
+
export const Commands = codegenNativeCommands({
|
|
8
|
+
supportedCommands: ['play', 'pause', 'seekTo', 'selectSubtitle', 'selectPlaybackRate', 'unmount']
|
|
9
|
+
});
|
|
10
|
+
export default codegenNativeComponent('SpallaPlayerView');
|
|
11
|
+
//# sourceMappingURL=SpallaPlayerViewNativeComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent","codegenNativeCommands","Commands","supportedCommands"],"sourceRoot":"../../src","sources":["SpallaPlayerViewNativeComponent.ts"],"mappings":";;AAAA,SACEA,sBAAsB,EAItBC,qBAAqB,QAChB,cAAc;;AAErB;;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":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,67 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { Commands } from "./SpallaPlayerViewNativeComponent.js";
|
|
5
|
+
|
|
6
|
+
// Import the appropriate component based on architecture
|
|
5
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
export const pause = ref => {
|
|
13
|
-
const handle = findNodeHandle(ref);
|
|
14
|
-
RNSpallaPlayerModule.pause(handle);
|
|
15
|
-
};
|
|
16
|
-
export const seekTo = (ref, time) => {
|
|
17
|
-
const handle = findNodeHandle(ref);
|
|
18
|
-
RNSpallaPlayerModule.seekTo(handle, time);
|
|
19
|
-
};
|
|
8
|
+
const isFabricEnabled = global?.nativeFabricUIManager != null;
|
|
9
|
+
const RNSpallaPlayer = isFabricEnabled ? require('./SpallaPlayerViewNativeComponent').default : require('react-native').requireNativeComponent('RNSpallaPlayer');
|
|
10
|
+
|
|
11
|
+
// Import the appropriate module
|
|
12
|
+
const RNSpallaPlayerModule = isFabricEnabled ? require('./NativeSpallaPlayerModule').default : require('react-native').NativeModules.RNSpallaPlayer;
|
|
20
13
|
|
|
21
|
-
//
|
|
14
|
+
// Event interfaces (keep these as they are)
|
|
22
15
|
|
|
23
|
-
class SpallaPlayer extends React.Component {
|
|
24
|
-
_player = null;
|
|
25
|
-
_setRef = ref => {
|
|
26
|
-
this._player = ref;
|
|
27
|
-
};
|
|
28
|
-
render() {
|
|
29
|
-
const {
|
|
30
|
-
style,
|
|
31
|
-
startTime,
|
|
32
|
-
playbackRate,
|
|
33
|
-
hideUI
|
|
34
|
-
} = this.props;
|
|
35
|
-
return /*#__PURE__*/_jsx(RNSpallaPlayer, {
|
|
36
|
-
...this.props,
|
|
37
|
-
ref: this._setRef,
|
|
38
|
-
style: style,
|
|
39
|
-
startTime: startTime ?? 0,
|
|
40
|
-
playbackRate: playbackRate ?? 1.0,
|
|
41
|
-
hideUI: hideUI ?? false,
|
|
42
|
-
children: this.props.children
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
play = () => {
|
|
46
|
-
const handle = findNodeHandle(this._player);
|
|
47
|
-
RNSpallaPlayerModule.play(handle);
|
|
48
|
-
};
|
|
49
|
-
pause = () => {
|
|
50
|
-
const handle = findNodeHandle(this._player);
|
|
51
|
-
RNSpallaPlayerModule.pause(handle);
|
|
52
|
-
};
|
|
53
|
-
seekTo = time => {
|
|
54
|
-
const handle = findNodeHandle(this._player);
|
|
55
|
-
RNSpallaPlayerModule.seekTo(handle, time);
|
|
56
|
-
};
|
|
57
|
-
componentWillUnmount() {
|
|
58
|
-
const handle = findNodeHandle(this._player);
|
|
59
|
-
RNSpallaPlayerModule.unmount(handle);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
16
|
export const initialize = (token, applicationId) => {
|
|
63
17
|
RNSpallaPlayerModule.initialize(token, applicationId);
|
|
64
18
|
};
|
|
19
|
+
const SpallaPlayer = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
20
|
+
const playerRef = React.useRef(null);
|
|
21
|
+
React.useImperativeHandle(ref, () => ({
|
|
22
|
+
play: () => {
|
|
23
|
+
if (playerRef.current) {
|
|
24
|
+
Commands.play(playerRef.current);
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
pause: () => {
|
|
28
|
+
console.log('Calling pause command');
|
|
29
|
+
if (playerRef.current) {
|
|
30
|
+
Commands.pause(playerRef.current);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
seekTo: time => {
|
|
34
|
+
if (playerRef.current) {
|
|
35
|
+
Commands.seekTo(playerRef.current, time);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}), []);
|
|
39
|
+
React.useEffect(() => {
|
|
40
|
+
const currentRef = playerRef.current;
|
|
41
|
+
return () => {
|
|
42
|
+
if (currentRef) {
|
|
43
|
+
Commands.unmount(currentRef);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}, []);
|
|
47
|
+
return /*#__PURE__*/_jsx(RNSpallaPlayer, {
|
|
48
|
+
...props,
|
|
49
|
+
ref: playerRef,
|
|
50
|
+
style: props.style,
|
|
51
|
+
startTime: props.startTime ?? 0,
|
|
52
|
+
playbackRate: props.playbackRate ?? 1.0,
|
|
53
|
+
hideUI: props.hideUI ?? false,
|
|
54
|
+
children: props.children
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
SpallaPlayer.displayName = 'SpallaPlayer';
|
|
65
58
|
export default SpallaPlayer;
|
|
66
59
|
export { default as SpallaCastButton } from "./components/CastButton.js";
|
|
67
60
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","Commands","jsx","_jsx","isFabricEnabled","global","nativeFabricUIManager","RNSpallaPlayer","require","default","requireNativeComponent","RNSpallaPlayerModule","NativeModules","initialize","token","applicationId","SpallaPlayer","forwardRef","props","ref","playerRef","useRef","useImperativeHandle","play","current","pause","console","log","seekTo","time","useEffect","currentRef","unmount","style","startTime","playbackRate","hideUI","children","displayName","SpallaCastButton"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,QAAQ,QAAQ,sCAAmC;;AAE5D;AAAA,SAAAC,GAAA,IAAAC,IAAA;AACA,MAAMC,eAAe,GAAIC,MAAM,EAAUC,qBAAqB,IAAI,IAAI;AAEtE,MAAMC,cAAc,GAAGH,eAAe,GAClCI,OAAO,CAAC,mCAAmC,CAAC,CAACC,OAAO,GACpDD,OAAO,CAAC,cAAc,CAAC,CAACE,sBAAsB,CAAC,gBAAgB,CAAC;;AAEpE;AACA,MAAMC,oBAAoB,GAAGP,eAAe,GACxCI,OAAO,CAAC,4BAA4B,CAAC,CAACC,OAAO,GAC7CD,OAAO,CAAC,cAAc,CAAC,CAACI,aAAa,CAACL,cAAc;;AAIxD;;AAmEA,OAAO,MAAMM,UAAU,GAAGA,CAACC,KAAa,EAAEC,aAA4B,KAAK;EACzEJ,oBAAoB,CAACE,UAAU,CAACC,KAAK,EAAEC,aAAa,CAAC;AACvD,CAAC;AAQD,MAAMC,YAAY,gBAAGhB,KAAK,CAACi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AAErB,CAAC,CAAC;AAEFrB,YAAY,CAACsB,WAAW,GAAG,cAAc;AAEzC,eAAetB,YAAY;AAC3B,SAASP,OAAO,IAAI8B,gBAAgB,QAAQ,4BAAyB","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TurboModule, CodegenTypes } from 'react-native';
|
|
2
|
+
export interface Spec extends TurboModule {
|
|
3
|
+
play(tag: CodegenTypes.Int32): void;
|
|
4
|
+
pause(tag: CodegenTypes.Int32): void;
|
|
5
|
+
seekTo(tag: CodegenTypes.Int32, time: number): void;
|
|
6
|
+
selectSubtitle(tag: CodegenTypes.Int32, subtitle: string | null): void;
|
|
7
|
+
selectPlaybackRate(tag: CodegenTypes.Int32, rate: number): void;
|
|
8
|
+
unmount(tag: CodegenTypes.Int32): void;
|
|
9
|
+
initialize(token: string, applicationId: string): void;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: Spec;
|
|
12
|
+
export default _default;
|
|
13
|
+
//# sourceMappingURL=NativeSpallaPlayerModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeSpallaPlayerModule.d.ts","sourceRoot":"","sources":["../../../src/NativeSpallaPlayerModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG9D,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,KAAK,GAAG,IAAI,CAAC;IACpC,KAAK,CAAC,GAAG,EAAE,YAAY,CAAC,KAAK,GAAG,IAAI,CAAC;IACrC,MAAM,CAAC,GAAG,EAAE,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpD,cAAc,CAAC,GAAG,EAAE,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACvE,kBAAkB,CAAC,GAAG,EAAE,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAChE,OAAO,CAAC,GAAG,EAAE,YAAY,CAAC,KAAK,GAAG,IAAI,CAAC;IACvC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CACxD;;AAED,wBAA4E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ViewProps, type CodegenTypes, type HostComponent } from 'react-native';
|
|
2
|
+
interface PlayerEventPayload {
|
|
3
|
+
event: string;
|
|
4
|
+
time?: CodegenTypes.Double;
|
|
5
|
+
duration?: CodegenTypes.Double;
|
|
6
|
+
isLive?: boolean;
|
|
7
|
+
subtitles?: string[];
|
|
8
|
+
subtitle?: string;
|
|
9
|
+
rate?: CodegenTypes.Float;
|
|
10
|
+
message?: string;
|
|
11
|
+
error?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface NativeProps extends ViewProps {
|
|
14
|
+
contentId?: string;
|
|
15
|
+
muted?: boolean;
|
|
16
|
+
startTime?: CodegenTypes.Double;
|
|
17
|
+
subtitle?: string | null;
|
|
18
|
+
playbackRate?: CodegenTypes.Float;
|
|
19
|
+
hideUI?: boolean;
|
|
20
|
+
onPlayerEvent?: CodegenTypes.BubblingEventHandler<PlayerEventPayload>;
|
|
21
|
+
}
|
|
22
|
+
export interface NativeCommands {
|
|
23
|
+
play: (viewRef: React.ElementRef<HostComponent<any>>) => void;
|
|
24
|
+
pause: (viewRef: React.ElementRef<HostComponent<any>>) => void;
|
|
25
|
+
seekTo: (viewRef: React.ElementRef<HostComponent<any>>, time: CodegenTypes.Double) => void;
|
|
26
|
+
selectSubtitle: (viewRef: React.ElementRef<HostComponent<any>>, subtitle: string | null) => void;
|
|
27
|
+
selectPlaybackRate: (viewRef: React.ElementRef<HostComponent<any>>, rate: CodegenTypes.Float) => void;
|
|
28
|
+
unmount: (viewRef: React.ElementRef<HostComponent<any>>) => void;
|
|
29
|
+
}
|
|
30
|
+
export declare const Commands: NativeCommands;
|
|
31
|
+
declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
|
|
32
|
+
export default _default;
|
|
33
|
+
//# sourceMappingURL=SpallaPlayerViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpallaPlayerViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/SpallaPlayerViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,aAAa,EAEnB,MAAM,cAAc,CAAC;AAGtB,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,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;CACvE;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,CAAC,OAAO,EAA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UAAU;;;eAAV,UAAU"}
|
|
@@ -38,24 +38,18 @@ interface Props {
|
|
|
38
38
|
autoplay?: boolean;
|
|
39
39
|
startTime?: number;
|
|
40
40
|
subtitle?: String | null;
|
|
41
|
-
playbackRate?:
|
|
41
|
+
playbackRate?: allowedPlaybackRates;
|
|
42
42
|
onPlayerEvent?: (event: {
|
|
43
|
-
nativeEvent:
|
|
43
|
+
nativeEvent: PlayerEvent | PlayerEventTimeUpdate | PlayerEventDurationUpdate | PlayerEventSubtitlesAvailable | PlayerEventSubtitleSelected | PlayerEventPlaybackRateSelected | PlayerEventMedataLoaded;
|
|
44
44
|
}) => void;
|
|
45
45
|
}
|
|
46
|
-
export declare const
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
play: () => void;
|
|
54
|
-
pause: () => void;
|
|
55
|
-
seekTo: (time: number) => void;
|
|
56
|
-
componentWillUnmount(): void;
|
|
57
|
-
}
|
|
58
|
-
export declare const initialize: (token: String, applicationId: String | null) => void;
|
|
46
|
+
export declare const initialize: (token: string, applicationId: string | null) => void;
|
|
47
|
+
export interface SpallaPlayerRef {
|
|
48
|
+
play(): void;
|
|
49
|
+
pause(): void;
|
|
50
|
+
seekTo(time: number): void;
|
|
51
|
+
}
|
|
52
|
+
declare const SpallaPlayer: React.ForwardRefExoticComponent<Props & React.RefAttributes<SpallaPlayerRef>>;
|
|
59
53
|
export default SpallaPlayer;
|
|
60
54
|
export { default as SpallaCastButton } from './components/CastButton';
|
|
61
55
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAe9C,KAAK,oBAAoB,GAAG,IAAI,GAAG,GAAG,GA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B,yBAAyB,GACzB,6BAA6B,GAC7B,2BAA2B,GAC3B,+BAA+B,GAC/B,uBAAuB,CAAC;KAC7B,KAAK,IAAI,CAAC;CACZ;AAED,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,EAAE,eAAe,MAAM,GAAG,IAAI,SAErE,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,IAAI,IAAI,IAAI,CAAC;IACb,KAAK,IAAI,IAAI,CAAC;IACd,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,QAAA,MAAM,YAAY,+EA+ChB,CAAC;AAIH,eAAe,YAAY,CAAC;AAC5B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-spalla-player",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Spalla
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"module": "./lib/module/index.js",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Spalla Player for React Native",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
8
7
|
"exports": {
|
|
9
8
|
".": {
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
16
|
-
"default": "./lib/commonjs/index.js"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
9
|
+
"source": "./src/index.tsx",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
19
14
|
},
|
|
20
15
|
"files": [
|
|
21
16
|
"src",
|
|
@@ -24,6 +19,7 @@
|
|
|
24
19
|
"ios",
|
|
25
20
|
"cpp",
|
|
26
21
|
"*.podspec",
|
|
22
|
+
"react-native.config.js",
|
|
27
23
|
"!ios/build",
|
|
28
24
|
"!android/build",
|
|
29
25
|
"!android/gradle",
|
|
@@ -37,12 +33,12 @@
|
|
|
37
33
|
],
|
|
38
34
|
"scripts": {
|
|
39
35
|
"example": "yarn workspace react-native-spalla-player-example",
|
|
40
|
-
"test": "jest",
|
|
41
|
-
"typecheck": "tsc",
|
|
42
|
-
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
43
36
|
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
44
37
|
"prepare": "bob build",
|
|
45
|
-
"
|
|
38
|
+
"typecheck": "tsc",
|
|
39
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
40
|
+
"test": "jest",
|
|
41
|
+
"release": "release-it --only-version"
|
|
46
42
|
},
|
|
47
43
|
"keywords": [
|
|
48
44
|
"react-native",
|
|
@@ -51,40 +47,41 @@
|
|
|
51
47
|
],
|
|
52
48
|
"repository": {
|
|
53
49
|
"type": "git",
|
|
54
|
-
"url": "git+https://github.com/
|
|
50
|
+
"url": "git+https://github.com/rojas/react-native-spalla-player.git"
|
|
55
51
|
},
|
|
56
52
|
"author": "Rogerio Shimizu <roja@bunker79.com> (https://github.com/rojas)",
|
|
57
53
|
"license": "MIT",
|
|
58
54
|
"bugs": {
|
|
59
|
-
"url": "https://github.com/
|
|
55
|
+
"url": "https://github.com/rojas/react-native-spalla-player/issues"
|
|
60
56
|
},
|
|
61
|
-
"homepage": "https://github.com/
|
|
57
|
+
"homepage": "https://github.com/rojas/react-native-spalla-player#readme",
|
|
62
58
|
"publishConfig": {
|
|
63
59
|
"registry": "https://registry.npmjs.org/"
|
|
64
60
|
},
|
|
65
61
|
"devDependencies": {
|
|
66
|
-
"@commitlint/config-conventional": "^
|
|
67
|
-
"@
|
|
68
|
-
"@
|
|
69
|
-
"@
|
|
70
|
-
"@
|
|
71
|
-
"@
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
62
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
63
|
+
"@eslint/compat": "^1.3.2",
|
|
64
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
65
|
+
"@eslint/js": "^9.35.0",
|
|
66
|
+
"@react-native/babel-preset": "0.83.0",
|
|
67
|
+
"@react-native/eslint-config": "0.83.0",
|
|
68
|
+
"@release-it/conventional-changelog": "^10.0.1",
|
|
69
|
+
"@types/jest": "^29.5.14",
|
|
70
|
+
"@types/react": "^19.2.0",
|
|
71
|
+
"commitlint": "^19.8.1",
|
|
72
|
+
"del-cli": "^6.0.0",
|
|
73
|
+
"eslint": "^9.35.0",
|
|
74
|
+
"eslint-config-prettier": "^10.1.8",
|
|
75
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
77
76
|
"jest": "^29.7.0",
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"react
|
|
81
|
-
"react-native
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
"resolutions": {
|
|
87
|
-
"@types/react": "^18.2.44"
|
|
77
|
+
"lefthook": "^2.0.3",
|
|
78
|
+
"prettier": "^2.8.8",
|
|
79
|
+
"react": "19.2.0",
|
|
80
|
+
"react-native": "0.83.0",
|
|
81
|
+
"react-native-builder-bob": "0.38.0",
|
|
82
|
+
"release-it": "^19.0.4",
|
|
83
|
+
"turbo": "^2.5.6",
|
|
84
|
+
"typescript": "^5.9.2"
|
|
88
85
|
},
|
|
89
86
|
"peerDependencies": {
|
|
90
87
|
"react": "*",
|
|
@@ -93,7 +90,48 @@
|
|
|
93
90
|
"workspaces": [
|
|
94
91
|
"example"
|
|
95
92
|
],
|
|
96
|
-
"packageManager": "yarn@
|
|
93
|
+
"packageManager": "yarn@4.11.0",
|
|
94
|
+
"react-native-builder-bob": {
|
|
95
|
+
"source": "src",
|
|
96
|
+
"output": "lib",
|
|
97
|
+
"targets": [
|
|
98
|
+
[
|
|
99
|
+
"module",
|
|
100
|
+
{
|
|
101
|
+
"esm": true
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
[
|
|
105
|
+
"typescript",
|
|
106
|
+
{
|
|
107
|
+
"project": "tsconfig.build.json"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"codegenConfig": {
|
|
113
|
+
"name": "SpallaPlayerViewSpec",
|
|
114
|
+
"type": "all",
|
|
115
|
+
"jsSrcsDir": "src",
|
|
116
|
+
"android": {
|
|
117
|
+
"javaPackageName": "com.spallaplayer"
|
|
118
|
+
},
|
|
119
|
+
"ios": {
|
|
120
|
+
"componentProvider": {
|
|
121
|
+
"SpallaPlayerView": "SpallaPlayerView"
|
|
122
|
+
},
|
|
123
|
+
"modulesProvider": {
|
|
124
|
+
"SpallaPlayerModule": "SpallaPlayerModule"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"prettier": {
|
|
129
|
+
"quoteProps": "consistent",
|
|
130
|
+
"singleQuote": true,
|
|
131
|
+
"tabWidth": 2,
|
|
132
|
+
"trailingComma": "es5",
|
|
133
|
+
"useTabs": false
|
|
134
|
+
},
|
|
97
135
|
"jest": {
|
|
98
136
|
"preset": "react-native",
|
|
99
137
|
"modulePathIgnorePatterns": [
|
|
@@ -119,69 +157,21 @@
|
|
|
119
157
|
},
|
|
120
158
|
"plugins": {
|
|
121
159
|
"@release-it/conventional-changelog": {
|
|
122
|
-
"preset":
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
"eslintConfig": {
|
|
127
|
-
"root": true,
|
|
128
|
-
"extends": [
|
|
129
|
-
"@react-native",
|
|
130
|
-
"prettier"
|
|
131
|
-
],
|
|
132
|
-
"rules": {
|
|
133
|
-
"react/react-in-jsx-scope": "off",
|
|
134
|
-
"prettier/prettier": [
|
|
135
|
-
"error",
|
|
136
|
-
{
|
|
137
|
-
"quoteProps": "consistent",
|
|
138
|
-
"singleQuote": true,
|
|
139
|
-
"tabWidth": 2,
|
|
140
|
-
"trailingComma": "es5",
|
|
141
|
-
"useTabs": false
|
|
160
|
+
"preset": {
|
|
161
|
+
"name": "angular"
|
|
142
162
|
}
|
|
143
|
-
|
|
163
|
+
}
|
|
144
164
|
}
|
|
145
165
|
},
|
|
146
|
-
"eslintIgnore": [
|
|
147
|
-
"node_modules/",
|
|
148
|
-
"lib/"
|
|
149
|
-
],
|
|
150
|
-
"prettier": {
|
|
151
|
-
"quoteProps": "consistent",
|
|
152
|
-
"singleQuote": true,
|
|
153
|
-
"tabWidth": 2,
|
|
154
|
-
"trailingComma": "es5",
|
|
155
|
-
"useTabs": false
|
|
156
|
-
},
|
|
157
|
-
"react-native-builder-bob": {
|
|
158
|
-
"source": "src",
|
|
159
|
-
"output": "lib",
|
|
160
|
-
"targets": [
|
|
161
|
-
[
|
|
162
|
-
"commonjs",
|
|
163
|
-
{
|
|
164
|
-
"esm": true
|
|
165
|
-
}
|
|
166
|
-
],
|
|
167
|
-
[
|
|
168
|
-
"module",
|
|
169
|
-
{
|
|
170
|
-
"esm": true
|
|
171
|
-
}
|
|
172
|
-
],
|
|
173
|
-
[
|
|
174
|
-
"typescript",
|
|
175
|
-
{
|
|
176
|
-
"project": "tsconfig.build.json",
|
|
177
|
-
"esm": true
|
|
178
|
-
}
|
|
179
|
-
]
|
|
180
|
-
]
|
|
181
|
-
},
|
|
182
166
|
"create-react-native-library": {
|
|
183
|
-
"type": "view
|
|
184
|
-
"languages": "kotlin-
|
|
185
|
-
"
|
|
167
|
+
"type": "fabric-view",
|
|
168
|
+
"languages": "kotlin-objc",
|
|
169
|
+
"tools": [
|
|
170
|
+
"eslint",
|
|
171
|
+
"jest",
|
|
172
|
+
"lefthook",
|
|
173
|
+
"release-it"
|
|
174
|
+
],
|
|
175
|
+
"version": "0.56.0"
|
|
186
176
|
}
|
|
187
177
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TurboModule, CodegenTypes } from 'react-native';
|
|
2
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export interface Spec extends TurboModule {
|
|
5
|
+
play(tag: CodegenTypes.Int32): void;
|
|
6
|
+
pause(tag: CodegenTypes.Int32): void;
|
|
7
|
+
seekTo(tag: CodegenTypes.Int32, time: number): void;
|
|
8
|
+
selectSubtitle(tag: CodegenTypes.Int32, subtitle: string | null): void;
|
|
9
|
+
selectPlaybackRate(tag: CodegenTypes.Int32, rate: number): void;
|
|
10
|
+
unmount(tag: CodegenTypes.Int32): void;
|
|
11
|
+
initialize(token: string, applicationId: string): void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('SpallaPlayerModule');
|