react-native-tpstreams 0.2.18 → 0.2.20

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 (52) hide show
  1. package/TPStreamsRNPlayerView.podspec +8 -2
  2. package/android/build.gradle +1 -1
  3. package/android/gradle.properties +1 -1
  4. package/android/src/main/java/com/tpstreams/TPStreamsDownloadsModule.kt +143 -0
  5. package/android/src/main/java/com/tpstreams/TPStreamsRNPackage.kt +1 -0
  6. package/android/src/main/java/com/tpstreams/TPStreamsRNPlayerView.kt +16 -1
  7. package/ios/TPStreamsDownloadsModule.mm +32 -0
  8. package/ios/TPStreamsDownloadsModule.swift +92 -0
  9. package/ios/TPStreamsModule.swift +17 -12
  10. package/ios/TPStreamsRNPlayerView.swift +242 -0
  11. package/ios/TPStreamsRNPlayerViewManager.m +38 -0
  12. package/ios/TPStreamsRNPlayerViewManager.swift +109 -0
  13. package/lib/module/TPStreamsPlayer.js +2 -2
  14. package/lib/module/TPStreamsPlayer.js.map +1 -1
  15. package/lib/module/index.js +6 -2
  16. package/lib/module/index.js.map +1 -1
  17. package/lib/typescript/spec/NativeTPStreams.d.ts +7 -0
  18. package/lib/typescript/spec/NativeTPStreams.d.ts.map +1 -0
  19. package/lib/typescript/spec/NativeTPStreamsDownloads.d.ts +24 -0
  20. package/lib/typescript/spec/NativeTPStreamsDownloads.d.ts.map +1 -0
  21. package/lib/typescript/spec/TPStreamsPlayerViewNativeComponent.d.ts.map +1 -0
  22. package/lib/typescript/src/TPStreamsPlayer.d.ts.map +1 -1
  23. package/lib/typescript/src/index.d.ts +4 -2
  24. package/lib/typescript/src/index.d.ts.map +1 -1
  25. package/package.json +3 -3
  26. package/src/TPStreamsPlayer.tsx +6 -3
  27. package/src/index.tsx +7 -2
  28. package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/TPStreamsRNPlayerViewManagerDelegate.java +0 -78
  29. package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/TPStreamsRNPlayerViewManagerInterface.java +0 -31
  30. package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -36
  31. package/android/app/build/generated/source/codegen/jni/TPStreamsPlayerViewSpec-generated.cpp +0 -22
  32. package/android/app/build/generated/source/codegen/jni/TPStreamsPlayerViewSpec.h +0 -24
  33. package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/ComponentDescriptors.cpp +0 -22
  34. package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/ComponentDescriptors.h +0 -24
  35. package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/EventEmitters.cpp +0 -98
  36. package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/EventEmitters.h +0 -75
  37. package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/Props.cpp +0 -30
  38. package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/Props.h +0 -32
  39. package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/ShadowNodes.cpp +0 -17
  40. package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/ShadowNodes.h +0 -32
  41. package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/States.cpp +0 -16
  42. package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/States.h +0 -29
  43. package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/TPStreamsPlayerViewSpecJSI-generated.cpp +0 -17
  44. package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/TPStreamsPlayerViewSpecJSI.h +0 -19
  45. package/ios/TPStreamsRNPlayerView.h +0 -14
  46. package/ios/TPStreamsRNPlayerView.mm +0 -52
  47. package/ios/TPStreamsRNPlayerViewManager.mm +0 -18
  48. package/lib/module/TPStreamsPlayerViewNativeComponent.ts +0 -82
  49. package/lib/typescript/src/TPStreamsPlayerViewNativeComponent.d.ts.map +0 -1
  50. package/src/TPStreamsPlayerViewNativeComponent.ts +0 -82
  51. /package/ios/{TPStreamsModule.mm → TPStreamsModule.m} +0 -0
  52. /package/lib/typescript/{src → spec}/TPStreamsPlayerViewNativeComponent.d.ts +0 -0
@@ -1,98 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateEventEmitterCpp.js
9
- */
10
-
11
- #include <react/renderer/components/TPStreamsPlayerViewSpec/EventEmitters.h>
12
-
13
-
14
- namespace facebook::react {
15
-
16
- void TPStreamsRNPlayerViewEventEmitter::onCurrentPosition(OnCurrentPosition $event) const {
17
- dispatchEvent("currentPosition", [$event=std::move($event)](jsi::Runtime &runtime) {
18
- auto $payload = jsi::Object(runtime);
19
- $payload.setProperty(runtime, "position", $event.position);
20
- return $payload;
21
- });
22
- }
23
-
24
-
25
- void TPStreamsRNPlayerViewEventEmitter::onDuration(OnDuration $event) const {
26
- dispatchEvent("duration", [$event=std::move($event)](jsi::Runtime &runtime) {
27
- auto $payload = jsi::Object(runtime);
28
- $payload.setProperty(runtime, "duration", $event.duration);
29
- return $payload;
30
- });
31
- }
32
-
33
-
34
- void TPStreamsRNPlayerViewEventEmitter::onIsPlaying(OnIsPlaying $event) const {
35
- dispatchEvent("isPlaying", [$event=std::move($event)](jsi::Runtime &runtime) {
36
- auto $payload = jsi::Object(runtime);
37
- $payload.setProperty(runtime, "isPlaying", $event.isPlaying);
38
- return $payload;
39
- });
40
- }
41
-
42
-
43
- void TPStreamsRNPlayerViewEventEmitter::onPlaybackSpeed(OnPlaybackSpeed $event) const {
44
- dispatchEvent("playbackSpeed", [$event=std::move($event)](jsi::Runtime &runtime) {
45
- auto $payload = jsi::Object(runtime);
46
- $payload.setProperty(runtime, "speed", $event.speed);
47
- return $payload;
48
- });
49
- }
50
-
51
-
52
- void TPStreamsRNPlayerViewEventEmitter::onPlayerStateChanged(OnPlayerStateChanged $event) const {
53
- dispatchEvent("playerStateChanged", [$event=std::move($event)](jsi::Runtime &runtime) {
54
- auto $payload = jsi::Object(runtime);
55
- $payload.setProperty(runtime, "playbackState", $event.playbackState);
56
- return $payload;
57
- });
58
- }
59
-
60
-
61
- void TPStreamsRNPlayerViewEventEmitter::onIsPlayingChanged(OnIsPlayingChanged $event) const {
62
- dispatchEvent("isPlayingChanged", [$event=std::move($event)](jsi::Runtime &runtime) {
63
- auto $payload = jsi::Object(runtime);
64
- $payload.setProperty(runtime, "isPlaying", $event.isPlaying);
65
- return $payload;
66
- });
67
- }
68
-
69
-
70
- void TPStreamsRNPlayerViewEventEmitter::onPlaybackSpeedChanged(OnPlaybackSpeedChanged $event) const {
71
- dispatchEvent("playbackSpeedChanged", [$event=std::move($event)](jsi::Runtime &runtime) {
72
- auto $payload = jsi::Object(runtime);
73
- $payload.setProperty(runtime, "speed", $event.speed);
74
- return $payload;
75
- });
76
- }
77
-
78
-
79
- void TPStreamsRNPlayerViewEventEmitter::onIsLoadingChanged(OnIsLoadingChanged $event) const {
80
- dispatchEvent("isLoadingChanged", [$event=std::move($event)](jsi::Runtime &runtime) {
81
- auto $payload = jsi::Object(runtime);
82
- $payload.setProperty(runtime, "isLoading", $event.isLoading);
83
- return $payload;
84
- });
85
- }
86
-
87
-
88
- void TPStreamsRNPlayerViewEventEmitter::onError(OnError $event) const {
89
- dispatchEvent("error", [$event=std::move($event)](jsi::Runtime &runtime) {
90
- auto $payload = jsi::Object(runtime);
91
- $payload.setProperty(runtime, "message", $event.message);
92
- $payload.setProperty(runtime, "code", $event.code);
93
- $payload.setProperty(runtime, "details", $event.details);
94
- return $payload;
95
- });
96
- }
97
-
98
- } // namespace facebook::react
@@ -1,75 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateEventEmitterH.js
9
- */
10
- #pragma once
11
-
12
- #include <react/renderer/components/view/ViewEventEmitter.h>
13
-
14
-
15
- namespace facebook::react {
16
- class TPStreamsRNPlayerViewEventEmitter : public ViewEventEmitter {
17
- public:
18
- using ViewEventEmitter::ViewEventEmitter;
19
-
20
- struct OnCurrentPosition {
21
- double position;
22
- };
23
-
24
- struct OnDuration {
25
- double duration;
26
- };
27
-
28
- struct OnIsPlaying {
29
- bool isPlaying;
30
- };
31
-
32
- struct OnPlaybackSpeed {
33
- Float speed;
34
- };
35
-
36
- struct OnPlayerStateChanged {
37
- int playbackState;
38
- };
39
-
40
- struct OnIsPlayingChanged {
41
- bool isPlaying;
42
- };
43
-
44
- struct OnPlaybackSpeedChanged {
45
- double speed;
46
- };
47
-
48
- struct OnIsLoadingChanged {
49
- bool isLoading;
50
- };
51
-
52
- struct OnError {
53
- std::string message;
54
- int code;
55
- std::string details;
56
- };
57
- void onCurrentPosition(OnCurrentPosition value) const;
58
-
59
- void onDuration(OnDuration value) const;
60
-
61
- void onIsPlaying(OnIsPlaying value) const;
62
-
63
- void onPlaybackSpeed(OnPlaybackSpeed value) const;
64
-
65
- void onPlayerStateChanged(OnPlayerStateChanged value) const;
66
-
67
- void onIsPlayingChanged(OnIsPlayingChanged value) const;
68
-
69
- void onPlaybackSpeedChanged(OnPlaybackSpeedChanged value) const;
70
-
71
- void onIsLoadingChanged(OnIsLoadingChanged value) const;
72
-
73
- void onError(OnError value) const;
74
- };
75
- } // namespace facebook::react
@@ -1,30 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GeneratePropsCpp.js
9
- */
10
-
11
- #include <react/renderer/components/TPStreamsPlayerViewSpec/Props.h>
12
- #include <react/renderer/core/PropsParserContext.h>
13
- #include <react/renderer/core/propsConversions.h>
14
-
15
- namespace facebook::react {
16
-
17
- TPStreamsRNPlayerViewProps::TPStreamsRNPlayerViewProps(
18
- const PropsParserContext &context,
19
- const TPStreamsRNPlayerViewProps &sourceProps,
20
- const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
21
-
22
- videoId(convertRawProp(context, rawProps, "videoId", sourceProps.videoId, {})),
23
- accessToken(convertRawProp(context, rawProps, "accessToken", sourceProps.accessToken, {})),
24
- shouldAutoPlay(convertRawProp(context, rawProps, "shouldAutoPlay", sourceProps.shouldAutoPlay, {false})),
25
- startAt(convertRawProp(context, rawProps, "startAt", sourceProps.startAt, {0.0})),
26
- enableDownload(convertRawProp(context, rawProps, "enableDownload", sourceProps.enableDownload, {false})),
27
- showDefaultCaptions(convertRawProp(context, rawProps, "showDefaultCaptions", sourceProps.showDefaultCaptions, {false}))
28
- {}
29
-
30
- } // namespace facebook::react
@@ -1,32 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GeneratePropsH.js
9
- */
10
- #pragma once
11
-
12
- #include <react/renderer/components/view/ViewProps.h>
13
- #include <react/renderer/core/PropsParserContext.h>
14
-
15
- namespace facebook::react {
16
-
17
- class TPStreamsRNPlayerViewProps final : public ViewProps {
18
- public:
19
- TPStreamsRNPlayerViewProps() = default;
20
- TPStreamsRNPlayerViewProps(const PropsParserContext& context, const TPStreamsRNPlayerViewProps &sourceProps, const RawProps &rawProps);
21
-
22
- #pragma mark - Props
23
-
24
- std::string videoId{};
25
- std::string accessToken{};
26
- bool shouldAutoPlay{false};
27
- double startAt{0.0};
28
- bool enableDownload{false};
29
- bool showDefaultCaptions{false};
30
- };
31
-
32
- } // namespace facebook::react
@@ -1,17 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateShadowNodeCpp.js
9
- */
10
-
11
- #include <react/renderer/components/TPStreamsPlayerViewSpec/ShadowNodes.h>
12
-
13
- namespace facebook::react {
14
-
15
- extern const char TPStreamsRNPlayerViewComponentName[] = "TPStreamsRNPlayerView";
16
-
17
- } // namespace facebook::react
@@ -1,32 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateShadowNodeH.js
9
- */
10
-
11
- #pragma once
12
-
13
- #include <react/renderer/components/TPStreamsPlayerViewSpec/EventEmitters.h>
14
- #include <react/renderer/components/TPStreamsPlayerViewSpec/Props.h>
15
- #include <react/renderer/components/TPStreamsPlayerViewSpec/States.h>
16
- #include <react/renderer/components/view/ConcreteViewShadowNode.h>
17
- #include <jsi/jsi.h>
18
-
19
- namespace facebook::react {
20
-
21
- JSI_EXPORT extern const char TPStreamsRNPlayerViewComponentName[];
22
-
23
- /*
24
- * `ShadowNode` for <TPStreamsRNPlayerView> component.
25
- */
26
- using TPStreamsRNPlayerViewShadowNode = ConcreteViewShadowNode<
27
- TPStreamsRNPlayerViewComponentName,
28
- TPStreamsRNPlayerViewProps,
29
- TPStreamsRNPlayerViewEventEmitter,
30
- TPStreamsRNPlayerViewState>;
31
-
32
- } // namespace facebook::react
@@ -1,16 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateStateCpp.js
9
- */
10
- #include <react/renderer/components/TPStreamsPlayerViewSpec/States.h>
11
-
12
- namespace facebook::react {
13
-
14
-
15
-
16
- } // namespace facebook::react
@@ -1,29 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GenerateStateH.js
8
- */
9
- #pragma once
10
-
11
- #ifdef ANDROID
12
- #include <folly/dynamic.h>
13
- #endif
14
-
15
- namespace facebook::react {
16
-
17
- class TPStreamsRNPlayerViewState {
18
- public:
19
- TPStreamsRNPlayerViewState() = default;
20
-
21
- #ifdef ANDROID
22
- TPStreamsRNPlayerViewState(TPStreamsRNPlayerViewState const &previousState, folly::dynamic data){};
23
- folly::dynamic getDynamic() const {
24
- return {};
25
- };
26
- #endif
27
- };
28
-
29
- } // namespace facebook::react
@@ -1,17 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GenerateModuleCpp.js
8
- */
9
-
10
- #include "TPStreamsPlayerViewSpecJSI.h"
11
-
12
- namespace facebook::react {
13
-
14
-
15
-
16
-
17
- } // namespace facebook::react
@@ -1,19 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GenerateModuleH.js
8
- */
9
-
10
- #pragma once
11
-
12
- #include <ReactCommon/TurboModule.h>
13
- #include <react/bridging/Bridging.h>
14
-
15
- namespace facebook::react {
16
-
17
-
18
-
19
- } // namespace facebook::react
@@ -1,14 +0,0 @@
1
- #import <React/RCTViewComponentView.h>
2
- #import <UIKit/UIKit.h>
3
-
4
- #ifndef TPStreamsRNPlayerViewNativeComponent_h
5
- #define TPStreamsRNPlayerViewNativeComponent_h
6
-
7
- NS_ASSUME_NONNULL_BEGIN
8
-
9
- @interface TPStreamsRNPlayerView : RCTViewComponentView
10
- @end
11
-
12
- NS_ASSUME_NONNULL_END
13
-
14
- #endif /* TPStreamsRNPlayerViewNativeComponent_h */
@@ -1,52 +0,0 @@
1
- #import "TPStreamsRNPlayerView.h"
2
-
3
- #import <react/renderer/components/TPStreamsPlayerViewSpec/ComponentDescriptors.h>
4
- #import <react/renderer/components/TPStreamsPlayerViewSpec/EventEmitters.h>
5
- #import <react/renderer/components/TPStreamsPlayerViewSpec/Props.h>
6
- #import <react/renderer/components/TPStreamsPlayerViewSpec/RCTComponentViewHelpers.h>
7
-
8
- #import "RCTFabricComponentsPlugins.h"
9
-
10
- using namespace facebook::react;
11
-
12
- @interface TPStreamsRNPlayerView () <RCTTPStreamsRNPlayerViewViewProtocol>
13
- @end
14
-
15
- @implementation TPStreamsRNPlayerView {
16
- UIView * _view;
17
- }
18
-
19
- + (ComponentDescriptorProvider)componentDescriptorProvider
20
- {
21
- return concreteComponentDescriptorProvider<TPStreamsRNPlayerViewComponentDescriptor>();
22
- }
23
-
24
- - (instancetype)initWithFrame:(CGRect)frame
25
- {
26
- if (self = [super initWithFrame:frame]) {
27
- static const auto defaultProps = std::make_shared<const TPStreamsRNPlayerViewProps>();
28
- _props = defaultProps;
29
-
30
- _view = [[UIView alloc] init];
31
- self.contentView = _view;
32
- }
33
-
34
- return self;
35
- }
36
-
37
- - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
38
- {
39
- const auto &oldViewProps = *std::static_pointer_cast<TPStreamsRNPlayerViewProps const>(_props);
40
- const auto &newViewProps = *std::static_pointer_cast<TPStreamsRNPlayerViewProps const>(props);
41
-
42
- // Process props update here when needed
43
-
44
- [super updateProps:props oldProps:oldProps];
45
- }
46
-
47
- Class<RCTComponentViewProtocol> TPStreamsRNPlayerViewCls(void)
48
- {
49
- return TPStreamsRNPlayerView.class;
50
- }
51
-
52
- @end
@@ -1,18 +0,0 @@
1
- #import <React/RCTViewManager.h>
2
- #import <React/RCTUIManager.h>
3
- #import "RCTBridge.h"
4
- #import "TPStreamsRNPlayerView.h"
5
-
6
- @interface TPStreamsRNPlayerViewManager : RCTViewManager
7
- @end
8
-
9
- @implementation TPStreamsRNPlayerViewManager
10
-
11
- RCT_EXPORT_MODULE(TPStreamsRNPlayerView)
12
-
13
- - (UIView *)view
14
- {
15
- return [TPStreamsRNPlayerView new];
16
- }
17
-
18
- @end
@@ -1,82 +0,0 @@
1
- import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2
- import type { ViewProps } from 'react-native';
3
- import type {
4
- Double,
5
- Float,
6
- Int32,
7
- } from 'react-native/Libraries/Types/CodegenTypes';
8
- import type { HostComponent } from 'react-native';
9
- import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
10
- import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
11
-
12
- export interface ErrorEvent {
13
- message: string;
14
- code: Int32;
15
- details?: string;
16
- }
17
-
18
- export interface NativeProps extends ViewProps {
19
- videoId?: string;
20
- accessToken?: string;
21
- shouldAutoPlay?: boolean;
22
- startAt?: Double;
23
- enableDownload?: boolean;
24
- offlineLicenseExpireTime?: Double;
25
- showDefaultCaptions?: boolean;
26
- downloadMetadata?: string;
27
-
28
- // Event props for receiving data from native methods
29
- onCurrentPosition?: DirectEventHandler<{ position: Double }>;
30
- onDuration?: DirectEventHandler<{ duration: Double }>;
31
- onIsPlaying?: DirectEventHandler<{ isPlaying: boolean }>;
32
- onPlaybackSpeed?: DirectEventHandler<{ speed: Float }>;
33
-
34
- // Player event props
35
- onPlayerStateChanged?: DirectEventHandler<{ playbackState: Int32 }>;
36
- onIsPlayingChanged?: DirectEventHandler<{ isPlaying: boolean }>;
37
- onPlaybackSpeedChanged?: DirectEventHandler<{ speed: Double }>;
38
- onIsLoadingChanged?: DirectEventHandler<{ isLoading: boolean }>;
39
- onError?: DirectEventHandler<ErrorEvent>;
40
- onAccessTokenExpired?: DirectEventHandler<{ videoId: string }>;
41
- }
42
-
43
- interface TPStreamsPlayerViewCommands {
44
- play: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
45
- pause: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
46
- seekTo: (
47
- viewRef: React.ElementRef<HostComponent<NativeProps>>,
48
- positionMs: Double
49
- ) => void;
50
- setPlaybackSpeed: (
51
- viewRef: React.ElementRef<HostComponent<NativeProps>>,
52
- speed: Float
53
- ) => void;
54
- getCurrentPosition: (
55
- viewRef: React.ElementRef<HostComponent<NativeProps>>
56
- ) => void;
57
- getDuration: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
58
- isPlaying: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
59
- getPlaybackSpeed: (
60
- viewRef: React.ElementRef<HostComponent<NativeProps>>
61
- ) => void;
62
- setNewAccessToken: (
63
- viewRef: React.ElementRef<HostComponent<NativeProps>>,
64
- newToken: string
65
- ) => void;
66
- }
67
-
68
- export const Commands = codegenNativeCommands<TPStreamsPlayerViewCommands>({
69
- supportedCommands: [
70
- 'play',
71
- 'pause',
72
- 'seekTo',
73
- 'setPlaybackSpeed',
74
- 'getCurrentPosition',
75
- 'getDuration',
76
- 'isPlaying',
77
- 'getPlaybackSpeed',
78
- 'setNewAccessToken',
79
- ],
80
- });
81
-
82
- export default codegenNativeComponent<NativeProps>('TPStreamsRNPlayerView');
@@ -1 +0,0 @@
1
- {"version":3,"file":"TPStreamsPlayerViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/TPStreamsPlayerViewNativeComponent.ts"],"names":[],"mappings":";;AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EACV,MAAM,EACN,KAAK,EACL,KAAK,EACN,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,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AM,KACb,IAAI,CAAC;CACX;AAED,eAAO,MAAM,QAAQ,6BAYnB,CAAC;;AAEH,wBAA4E"}
@@ -1,82 +0,0 @@
1
- import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2
- import type { ViewProps } from 'react-native';
3
- import type {
4
- Double,
5
- Float,
6
- Int32,
7
- } from 'react-native/Libraries/Types/CodegenTypes';
8
- import type { HostComponent } from 'react-native';
9
- import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
10
- import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
11
-
12
- export interface ErrorEvent {
13
- message: string;
14
- code: Int32;
15
- details?: string;
16
- }
17
-
18
- export interface NativeProps extends ViewProps {
19
- videoId?: string;
20
- accessToken?: string;
21
- shouldAutoPlay?: boolean;
22
- startAt?: Double;
23
- enableDownload?: boolean;
24
- offlineLicenseExpireTime?: Double;
25
- showDefaultCaptions?: boolean;
26
- downloadMetadata?: string;
27
-
28
- // Event props for receiving data from native methods
29
- onCurrentPosition?: DirectEventHandler<{ position: Double }>;
30
- onDuration?: DirectEventHandler<{ duration: Double }>;
31
- onIsPlaying?: DirectEventHandler<{ isPlaying: boolean }>;
32
- onPlaybackSpeed?: DirectEventHandler<{ speed: Float }>;
33
-
34
- // Player event props
35
- onPlayerStateChanged?: DirectEventHandler<{ playbackState: Int32 }>;
36
- onIsPlayingChanged?: DirectEventHandler<{ isPlaying: boolean }>;
37
- onPlaybackSpeedChanged?: DirectEventHandler<{ speed: Double }>;
38
- onIsLoadingChanged?: DirectEventHandler<{ isLoading: boolean }>;
39
- onError?: DirectEventHandler<ErrorEvent>;
40
- onAccessTokenExpired?: DirectEventHandler<{ videoId: string }>;
41
- }
42
-
43
- interface TPStreamsPlayerViewCommands {
44
- play: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
45
- pause: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
46
- seekTo: (
47
- viewRef: React.ElementRef<HostComponent<NativeProps>>,
48
- positionMs: Double
49
- ) => void;
50
- setPlaybackSpeed: (
51
- viewRef: React.ElementRef<HostComponent<NativeProps>>,
52
- speed: Float
53
- ) => void;
54
- getCurrentPosition: (
55
- viewRef: React.ElementRef<HostComponent<NativeProps>>
56
- ) => void;
57
- getDuration: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
58
- isPlaying: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
59
- getPlaybackSpeed: (
60
- viewRef: React.ElementRef<HostComponent<NativeProps>>
61
- ) => void;
62
- setNewAccessToken: (
63
- viewRef: React.ElementRef<HostComponent<NativeProps>>,
64
- newToken: string
65
- ) => void;
66
- }
67
-
68
- export const Commands = codegenNativeCommands<TPStreamsPlayerViewCommands>({
69
- supportedCommands: [
70
- 'play',
71
- 'pause',
72
- 'seekTo',
73
- 'setPlaybackSpeed',
74
- 'getCurrentPosition',
75
- 'getDuration',
76
- 'isPlaying',
77
- 'getPlaybackSpeed',
78
- 'setNewAccessToken',
79
- ],
80
- });
81
-
82
- export default codegenNativeComponent<NativeProps>('TPStreamsRNPlayerView');
File without changes