shakebug-react-native 2.4.9 → 2.4.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.
- package/README.md +0 -12
- package/VideoPlayer/PlayVideo.tsx +4 -46
- package/VideoPlayer/index.js +6 -43
- package/android/src/main/java/com/shakebug/BaseUtils.java +7 -19
- package/android/src/main/java/com/shakebug/DeviceUtil.java +34 -21
- package/android/src/main/java/com/shakebug/ShakebugPackage.java +3 -3
- package/android/src/main/java/com/shakebug/UnitConverter.java +8 -8
- package/android/src/main/java/com/shakebug/VideoPlayerModule.java +81 -0
- package/android/src/main/java/com/shakebug/VideoTrimModule.java +387 -0
- package/android/src/main/java/com/shakebug/VideoTrimUtil.java +133 -0
- package/android/src/main/java/com/shakebug/adapters/VideoTrimmerAdapter.java +53 -0
- package/android/src/main/java/com/shakebug/callback/SingleCallback.java +0 -6
- package/android/src/main/java/com/shakebug/thread/BackgroundExecutor.java +1 -93
- package/android/src/main/java/com/shakebug/thread/UiThreadExecutor.java +0 -37
- package/android/src/main/java/com/shakebug/utils/StorageUtil.java +135 -0
- package/android/src/main/java/com/shakebug/utils/VideoTrimmerUtil.java +70 -0
- package/android/src/main/java/com/shakebug/widgets/RangeSeekBarView.java +534 -0
- package/android/src/main/java/com/shakebug/widgets/SpacesItemDecoration2.java +1 -2
- package/android/src/main/java/com/shakebug/widgets/VideoPlayerView.java +317 -0
- package/android/src/main/java/com/shakebug/widgets/VideoTrimmerView.java +520 -0
- package/android/src/main/res/drawable/ic_volume_off.xml +10 -0
- package/android/src/main/res/drawable/ic_volume_on.xml +10 -0
- package/android/src/main/res/layout/{video_player_view.xml → shakebug_video_player_view.xml} +29 -9
- package/ios/TrimVideo/ShakebugSDKVideoTrim.swift +389 -0
- package/ios/TrimVideo/VideoTrim-Bridging-Header.h +10 -0
- package/ios/TrimVideo/VideoTrim.m +23 -0
- package/ios/TrimVideo/VideoTrimmer.swift +810 -0
- package/ios/TrimVideo/VideoTrimmerThumb.swift +119 -0
- package/ios/TrimVideo/VideoTrimmerViewController.swift +322 -0
- package/ios/VideoPlayer/VideoPlayerModule.m +23 -7
- package/package.json +1 -1
- package/src/APIs/AddIssue.js +7 -5
- package/src/APIs/AddReview.js +5 -2
- package/src/APIs/CustomUserId.js +5 -2
- package/src/APIs/EndSession.js +3 -2
- package/src/APIs/Event.js +5 -2
- package/src/APIs/FetchRemoteCodeAPI.js +5 -2
- package/src/APIs/MatchKey.js +3 -2
- package/src/APIs/StartSession.js +44 -23
- package/src/Componanats/LoadingModal.js +59 -0
- package/src/Componanats/ShakeFunction.js +32 -14
- package/src/Screens/AddDetailsScreen.js +28 -31
- package/src/Screens/FirstScreen.js +15 -18
- package/src/Screens/Shakebug.js +11 -6
- package/src/Screens/TrimVideoScreen.js +37 -22
- package/src/index.tsx +7 -6
- package/trimVideo/src/index.tsx +12 -48
- package/Volumes:.fileloc +0 -8
- package/shakebug-react-native-2.4.8.tgz +0 -0
- /package/android/src/main/res/layout/{video_thumb_item_layout.xml → shakebug_video_thumb_item_layout.xml} +0 -0
- /package/android/src/main/res/layout/{video_trimmer_view.xml → shakebug_video_trimmer_view.xml} +0 -0
package/src/index.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Shakebug, { AddEvent } from '../src/Screens/Shakebug';
|
|
3
3
|
import { getLocales } from '../GetLocals/src';
|
|
4
|
-
import { NativeModules, Text, View, findNodeHandle } from 'react-native';
|
|
4
|
+
import { NativeModules, Text, View, findNodeHandle, DeviceEventEmitter } from 'react-native';
|
|
5
5
|
import { useGlobalState } from './Componanats/GlobalStateContext'
|
|
6
6
|
import { CustomUserIdApi } from './APIs/CustomUserId'
|
|
7
7
|
import { FetchRemoteCodeAPI } from './APIs/FetchRemoteCodeAPI';
|
|
@@ -22,10 +22,10 @@ export interface ShakebugViewProps {
|
|
|
22
22
|
changeSDKScreenTitle?: string[];
|
|
23
23
|
allowToReportBugByShakingMobile?: boolean;
|
|
24
24
|
allowToReportBugByScreenCapture?: boolean;
|
|
25
|
-
allowCrashReport
|
|
26
|
-
makeLogEnabled
|
|
27
|
-
ShakebugLanguage
|
|
28
|
-
setShakebugSDKEndPointURL
|
|
25
|
+
allowCrashReport?: boolean;
|
|
26
|
+
makeLogEnabled?: boolean;
|
|
27
|
+
ShakebugLanguage?: 'ENGLISH' | 'HINDI' | 'GUJARATI' | 'ARABIC' | 'CHINESE' | 'DUTCH' | 'FRENCH' | 'GERMAN' | 'GREEK' | 'INDONESIAN' | 'ITALIAN' | 'JAPANESE' | 'KOREAN' | 'RUSSIAN' | 'SPANISH' | 'TURKISH' | 'UKRAINIAN' | 'MARATHI' | 'TAMIL' | 'TELUGU';
|
|
28
|
+
setShakebugSDKEndPointURL?: string[];
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
|
|
@@ -42,7 +42,7 @@ const ShakebugView: React.FC<ShakebugViewProps> = ({
|
|
|
42
42
|
allowCrashReport = true,
|
|
43
43
|
makeLogEnabled = false,
|
|
44
44
|
ShakebugLanguage = LocalLanguage != -1 ? Languages[LocalLanguage] : "ENGLISH",
|
|
45
|
-
setShakebugSDKEndPointURL = ["https://www.shakebug.com/api/v1.
|
|
45
|
+
setShakebugSDKEndPointURL = ["https://www.shakebug.com/api/v1.6/webservice.php/", "MarchShake2022", ""]
|
|
46
46
|
}) => {
|
|
47
47
|
|
|
48
48
|
return (
|
|
@@ -75,6 +75,7 @@ export const triggerBugReporting = (): void => {
|
|
|
75
75
|
}
|
|
76
76
|
global.isShakebugOpen = false;
|
|
77
77
|
global.isTrigger = true;
|
|
78
|
+
DeviceEventEmitter.emit('TriggerBugReportingEvent');
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
export const ShakebugSdkProtectedView = ({ children }) => {
|
package/trimVideo/src/index.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { NativeModules, PermissionsAndroid, Platform } from 'react-native';
|
|
2
2
|
|
|
3
3
|
const LINKING_ERROR =
|
|
4
|
-
`The
|
|
4
|
+
`The native module 'ShakebugSDKVideoTrim' is not linked. Make sure: \n\n` +
|
|
5
5
|
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
6
6
|
'- You rebuilt the app after installing the package\n' +
|
|
7
7
|
'- You are not using Expo Go\n';
|
|
8
8
|
|
|
9
|
-
const VideoTrim = NativeModules.ShakebugSDKVideoTrim
|
|
10
|
-
? NativeModules.ShakebugSDKVideoTrim
|
|
9
|
+
const VideoTrim = NativeModules.ShakebugSDKVideoTrim || NativeModules.VideoTrim
|
|
10
|
+
? (NativeModules.ShakebugSDKVideoTrim || NativeModules.VideoTrim)
|
|
11
11
|
: new Proxy(
|
|
12
12
|
{},
|
|
13
13
|
{
|
|
@@ -21,6 +21,7 @@ export interface EditorConfig {
|
|
|
21
21
|
saveToPhoto?: boolean;
|
|
22
22
|
removeAfterSavedToPhoto?: boolean;
|
|
23
23
|
maxDuration?: number;
|
|
24
|
+
minDuration?: number;
|
|
24
25
|
cancelButtonText?: string;
|
|
25
26
|
saveButtonText?: string;
|
|
26
27
|
enableCancelDialog?: boolean;
|
|
@@ -34,15 +35,9 @@ export interface EditorConfig {
|
|
|
34
35
|
saveDialogCancelText?: string;
|
|
35
36
|
saveDialogConfirmText?: string;
|
|
36
37
|
trimmingText?: string;
|
|
38
|
+
fullScreenModalIOS?: boolean;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
/**
|
|
40
|
-
* Delete a file
|
|
41
|
-
*
|
|
42
|
-
* @param {string} videoPath: absolute non-empty file path to edit
|
|
43
|
-
* @param {EditorConfig} config: editor configuration
|
|
44
|
-
* @returns {void} A **Promise** which resolves `void`
|
|
45
|
-
*/
|
|
46
41
|
export async function showEditor(
|
|
47
42
|
filePath: string,
|
|
48
43
|
config: EditorConfig = {}
|
|
@@ -54,19 +49,17 @@ export async function showEditor(
|
|
|
54
49
|
const { saveToPhoto = true } = config;
|
|
55
50
|
const outputPath = await VideoTrim.showEditor(filePath, config);
|
|
56
51
|
|
|
57
|
-
if (Platform.OS === 'android') {
|
|
52
|
+
if (Platform.OS === 'android' && outputPath) {
|
|
58
53
|
if (saveToPhoto) {
|
|
59
54
|
try {
|
|
60
55
|
if (Platform.Version >= 33) {
|
|
61
|
-
// since android 13 it's not needed to request permission for write storage: https://github.com/facebook/react-native/issues/36714#issuecomment-1491338276
|
|
62
56
|
await VideoTrim.saveVideo(outputPath);
|
|
63
|
-
|
|
64
57
|
if (config.removeAfterSavedToPhoto) {
|
|
65
58
|
deleteFile(outputPath);
|
|
66
59
|
}
|
|
67
60
|
} else {
|
|
68
61
|
const granted = await PermissionsAndroid.request(
|
|
69
|
-
PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE
|
|
62
|
+
PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE,
|
|
70
63
|
{
|
|
71
64
|
title: 'Video Trimmer Photos Access Required',
|
|
72
65
|
message: 'Grant access to your Photos to write output Video',
|
|
@@ -77,65 +70,36 @@ export async function showEditor(
|
|
|
77
70
|
);
|
|
78
71
|
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
|
79
72
|
await VideoTrim.saveVideo(outputPath);
|
|
80
|
-
|
|
81
73
|
if (config.removeAfterSavedToPhoto) {
|
|
82
74
|
deleteFile(outputPath);
|
|
83
75
|
}
|
|
84
|
-
} else {
|
|
85
|
-
throw new Error('Photos Library permission denied');
|
|
86
76
|
}
|
|
87
77
|
}
|
|
88
78
|
} catch (err) {
|
|
89
|
-
|
|
79
|
+
console.warn(err);
|
|
90
80
|
} finally {
|
|
91
81
|
VideoTrim.hideDialog();
|
|
92
82
|
}
|
|
93
|
-
} else {
|
|
94
|
-
VideoTrim.hideDialog();
|
|
95
83
|
}
|
|
96
84
|
}
|
|
97
85
|
}
|
|
98
86
|
|
|
99
|
-
/**
|
|
100
|
-
* Delete a file
|
|
101
|
-
*
|
|
102
|
-
* @param {string} filePath: absolute non-empty file path to check if editable
|
|
103
|
-
* @returns {Promise} A **Promise** which resolves `true` if editable
|
|
104
|
-
*/
|
|
105
87
|
export function isValidVideo(filePath: string): Promise<boolean> {
|
|
106
|
-
if (!filePath?.trim().length) {
|
|
107
|
-
throw new Error('File path cannot be empty!');
|
|
108
|
-
}
|
|
109
88
|
return VideoTrim.isValidVideo(filePath);
|
|
110
89
|
}
|
|
111
90
|
|
|
112
|
-
/**
|
|
113
|
-
* Clean output files generated at all time
|
|
114
|
-
*
|
|
115
|
-
* @returns {Promise<string[]>} A **Promise** which resolves to array of files
|
|
116
|
-
*/
|
|
117
91
|
export function listFiles(): Promise<string[]> {
|
|
118
92
|
return VideoTrim.listFiles();
|
|
119
93
|
}
|
|
120
94
|
|
|
121
|
-
/**
|
|
122
|
-
* Clean output files generated at all time
|
|
123
|
-
*
|
|
124
|
-
* @returns {Promise} A **Promise** which resolves to number of deleted files
|
|
125
|
-
*/
|
|
126
95
|
export function cleanFiles(): Promise<number> {
|
|
127
96
|
return VideoTrim.cleanFiles();
|
|
128
97
|
}
|
|
129
98
|
|
|
130
|
-
/**
|
|
131
|
-
* Delete a file
|
|
132
|
-
*
|
|
133
|
-
* @param {string} filePath: absolute non-empty file path to delete
|
|
134
|
-
* @returns {Promise} A **Promise** which resolves `true` if successful
|
|
135
|
-
*/
|
|
136
99
|
export function deleteFile(filePath: string): Promise<boolean> {
|
|
137
|
-
if (!filePath?.trim().length) {
|
|
138
|
-
throw new Error('File path cannot be empty!');
|
|
139
|
-
}
|
|
140
100
|
return VideoTrim.deleteFile(filePath);
|
|
141
101
|
}
|
|
102
|
+
|
|
103
|
+
export function closeEditor(): void {
|
|
104
|
+
return VideoTrim.hideDialog();
|
|
105
|
+
}
|
package/Volumes:.fileloc
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>URL</key>
|
|
6
|
-
<string>file:///Volumes/Data/React-Native/expenzo/node_modules/shakebug-react-native/src</string>
|
|
7
|
-
</dict>
|
|
8
|
-
</plist>
|
|
Binary file
|
|
File without changes
|
/package/android/src/main/res/layout/{video_trimmer_view.xml → shakebug_video_trimmer_view.xml}
RENAMED
|
File without changes
|