Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32981518
D7478.1768322192.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D7478.1768322192.diff
View Options
diff --git a/native/media/ffmpeg.js b/native/media/ffmpeg.js
--- a/native/media/ffmpeg.js
+++ b/native/media/ffmpeg.js
@@ -81,19 +81,21 @@
transcodeVideo(
ffmpegCommand: string,
inputVideoDuration: number,
- onTranscodingProgress: (percent: number) => void,
+ onTranscodingProgress?: (percent: number) => void,
): Promise<{ rc: number, lastStats: ?FFmpegStatistics }> {
const duration = inputVideoDuration > 0 ? inputVideoDuration : 0.001;
const wrappedCommand = async () => {
RNFFmpegConfig.resetStatistics();
let lastStats;
- RNFFmpegConfig.enableStatisticsCallback(
- (statisticsData: FFmpegStatistics) => {
- lastStats = statisticsData;
- const { time } = statisticsData;
- onTranscodingProgress(time / 1000 / duration);
- },
- );
+ if (onTranscodingProgress) {
+ RNFFmpegConfig.enableStatisticsCallback(
+ (statisticsData: FFmpegStatistics) => {
+ lastStats = statisticsData;
+ const { time } = statisticsData;
+ onTranscodingProgress(time / 1000 / duration);
+ },
+ );
+ }
const ffmpegResult = await RNFFmpeg.execute(ffmpegCommand);
return { ...ffmpegResult, lastStats };
};
diff --git a/native/media/media-utils.js b/native/media/media-utils.js
--- a/native/media/media-utils.js
+++ b/native/media/media-utils.js
@@ -20,7 +20,7 @@
+hasWiFi: boolean,
// Blocks return until we can confirm result has the correct MIME
+finalFileHeaderCheck?: boolean,
- +onTranscodingProgress: (percent: number) => void,
+ +onTranscodingProgress?: (percent: number) => void,
};
type SharedMediaResult = {
+success: true,
diff --git a/native/media/video-utils.js b/native/media/video-utils.js
--- a/native/media/video-utils.js
+++ b/native/media/video-utils.js
@@ -38,7 +38,7 @@
};
type VideoProcessConfig = {
- +onTranscodingProgress: (percent: number) => void,
+ +onTranscodingProgress?: (percent: number) => void,
};
type ProcessVideoResponse = {
@@ -200,7 +200,7 @@
async function transcodeVideo(
plan: ProcessPlan,
duration: number,
- onProgressCallback: number => void,
+ onProgressCallback?: number => void,
): Promise<TranscodeVideoMediaMissionStep> {
const transcodeStart = Date.now();
let returnCode,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 13, 4:36 PM (5 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5928441
Default Alt Text
D7478.1768322192.diff (2 KB)
Attached To
Mode
D7478: [native] Make `onTranscodingProgress` field of `MediaProcessConfig` optional
Attached
Detach File
Event Timeline
Log In to Comment