Remove iOS dependencies to reduce package size while maintaining Android functionality

pull/1118/head
Michael Tzach 5 months ago
parent 35b99c02f8
commit 90b9914097
  1. 36
      react-native/README.md
  2. 124
      react-native/ffmpeg-kit-react-native.podspec
  3. 7
      react-native/ios/FFmpegKitReactNativeModule.h
  4. 135
      react-native/ios/FFmpegKitReactNativeModule.m
  5. 5
      react-native/package.json
  6. 7
      react-native/src/index.js

@ -1,16 +1,13 @@
# FFmpegKit for React Native
# FFmpeg Kit for React Native (Android Only Fork)
### 1. Features
- Includes both `FFmpeg` and `FFprobe`
- Supports
- Both `Android` and `iOS`
- Android only in this fork
- FFmpeg `v6.0`
- `arm-v7a`, `arm-v7a-neon`, `arm64-v8a`, `x86` and `x86_64` architectures on Android
- `Android API Level 24` or later
- `API Level 16` on LTS releases
- `armv7`, `armv7s`, `arm64`, `arm64-simulator`, `i386`, `x86_64`, `x86_64-mac-catalyst` and `arm64-mac-catalyst` architectures on iOS
- `iOS SDK 12.1` or later
- `iOS SDK 10` on LTS releases
- Can process Storage Access Framework (SAF) Uris on Android
- 25 external libraries
@ -21,11 +18,13 @@
`vid.stab`, `x264`, `x265`, `xvidcore`
- `zlib` and `MediaCodec` Android system libraries
- `bzip2`, `iconv`, `libuuid`, `zlib` system libraries and `AudioToolbox`, `VideoToolbox`, `AVFoundation` system frameworks on iOS
- Includes Typescript definitions
- Licensed under `LGPL 3.0` by default, some packages licensed by `GPL v3.0` effectively
### Important Note
This is a fork of the original FFmpeg Kit for React Native that removes iOS support to reduce package size. If you need iOS support, please use the original package.
### 2. Installation
```sh
@ -47,24 +46,21 @@ packages and external libraries included in each one of them.
##### 2.1.1 Package Names
The following table shows all package names and their respective API levels, iOS deployment targets defined in
`ffmpeg-kit-react-native`.
The following table shows all package names and their respective API levels defined in `ffmpeg-kit-react-native`.
<table>
<thead>
<tr>
<th align="center">Package</th>
<th align="center" colspan="3">Main Release</th>
<th align="center" colspan="3">LTS Release</th>
<th align="center" colspan="2">Main Release</th>
<th align="center" colspan="2">LTS Release</th>
</tr>
<tr>
<th align="center"></th>
<th align="center">Name</th>
<th align="center">Android<br>API Level</th>
<th align="center">iOS Minimum<br>Deployment Target</th>
<th align="center">Name</th>
<th align="center">Android<br>API Level</th>
<th align="center">iOS Minimum<br>Deployment Target</th>
</tr>
</thead>
<tbody>
@ -72,73 +68,57 @@ The following table shows all package names and their respective API levels, iOS
<td align="center">min</td>
<td align="center">min</td>
<td align="center">24</td>
<td align="center">12.1</td>
<td align="center">min-lts</td>
<td align="center">16</td>
<td align="center">10</td>
</tr>
<tr>
<td align="center">min-gpl</td>
<td align="center">min-gpl</td>
<td align="center">24</td>
<td align="center">12.1</td>
<td align="center">min-gpl-lts</td>
<td align="center">16</td>
<td align="center">10</td>
</tr>
<tr>
<td align="center">https</td>
<td align="center">(*) https</td>
<td align="center">24</td>
<td align="center">12.1</td>
<td align="center">https-lts</td>
<td align="center">16</td>
<td align="center">10</td>
</tr>
<tr>
<td align="center">https-gpl</td>
<td align="center">https-gpl</td>
<td align="center">24</td>
<td align="center">12.1</td>
<td align="center">https-gpl-lts</td>
<td align="center">16</td>
<td align="center">10</td>
</tr>
<tr>
<td align="center">audio</td>
<td align="center">audio</td>
<td align="center">24</td>
<td align="center">12.1</td>
<td align="center">audio-lts</td>
<td align="center">16</td>
<td align="center">10</td>
</tr>
<tr>
<td align="center">video</td>
<td align="center">video</td>
<td align="center">24</td>
<td align="center">12.1</td>
<td align="center">video-lts</td>
<td align="center">16</td>
<td align="center">10</td>
</tr>
<tr>
<td align="center">full</td>
<td align="center">full</td>
<td align="center">24</td>
<td align="center">12.1</td>
<td align="center">full-lts</td>
<td align="center">16</td>
<td align="center">10</td>
</tr>
<tr>
<td align="center">full-gpl</td>
<td align="center">full-gpl</td>
<td align="center">24</td>
<td align="center">12.1</td>
<td align="center">full-gpl-lts</td>
<td align="center">16</td>
<td align="center">10</td>
</tr>
</tbody>
</table>

@ -5,131 +5,19 @@ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
Pod::Spec.new do |s|
s.name = package["name"]
s.version = package["version"]
s.summary = package["description"]
s.summary = package["description"] + " (Android only)"
s.homepage = package["homepage"]
s.license = package["license"]
s.authors = package["author"]
s.platform = :ios
s.source = { :git => "https://github.com/arthenica/ffmpeg-kit.git", :tag => "react.native.v#{s.version}" }
s.source_files = "ios/*.{h,m}"
s.requires_arc = true
s.static_framework = true
s.source = { :git => "https://github.com/arthenica/ffmpeg-kit.git", :tag => "react.native.v#{s.version}" }
s.default_subspec = 'https'
s.dependency "React-Core"
s.subspec 'min' do |ss|
ss.source_files = '**/FFmpegKitReactNativeModule.m',
'**/FFmpegKitReactNativeModule.h'
ss.dependency 'ffmpeg-kit-ios-min', "6.0"
ss.ios.deployment_target = '12.1'
end
s.subspec 'min-lts' do |ss|
ss.source_files = '**/FFmpegKitReactNativeModule.m',
'**/FFmpegKitReactNativeModule.h'
ss.dependency 'ffmpeg-kit-ios-min', "6.0.LTS"
ss.ios.deployment_target = '10'
end
s.subspec 'min-gpl' do |ss|
ss.source_files = '**/FFmpegKitReactNativeModule.m',
'**/FFmpegKitReactNativeModule.h'
ss.dependency 'ffmpeg-kit-ios-min-gpl', "6.0"
ss.ios.deployment_target = '12.1'
end
s.subspec 'min-gpl-lts' do |ss|
ss.source_files = '**/FFmpegKitReactNativeModule.m',
'**/FFmpegKitReactNativeModule.h'
ss.dependency 'ffmpeg-kit-ios-min-gpl', "6.0.LTS"
ss.ios.deployment_target = '10'
end
s.subspec 'https' do |ss|
ss.source_files = '**/FFmpegKitReactNativeModule.m',
'**/FFmpegKitReactNativeModule.h'
ss.dependency 'ffmpeg-kit-ios-https', "6.0"
ss.ios.deployment_target = '12.1'
end
s.subspec 'https-lts' do |ss|
ss.source_files = '**/FFmpegKitReactNativeModule.m',
'**/FFmpegKitReactNativeModule.h'
ss.dependency 'ffmpeg-kit-ios-https', "6.0.LTS"
ss.ios.deployment_target = '10'
end
s.subspec 'https-gpl' do |ss|
ss.source_files = '**/FFmpegKitReactNativeModule.m',
'**/FFmpegKitReactNativeModule.h'
ss.dependency 'ffmpeg-kit-ios-https-gpl', "6.0"
ss.ios.deployment_target = '12.1'
end
s.subspec 'https-gpl-lts' do |ss|
ss.source_files = '**/FFmpegKitReactNativeModule.m',
'**/FFmpegKitReactNativeModule.h'
ss.dependency 'ffmpeg-kit-ios-https-gpl', "6.0.LTS"
ss.ios.deployment_target = '10'
end
s.subspec 'audio' do |ss|
ss.source_files = '**/FFmpegKitReactNativeModule.m',
'**/FFmpegKitReactNativeModule.h'
ss.dependency 'ffmpeg-kit-ios-audio', "6.0"
ss.ios.deployment_target = '12.1'
end
s.subspec 'audio-lts' do |ss|
ss.source_files = '**/FFmpegKitReactNativeModule.m',
'**/FFmpegKitReactNativeModule.h'
ss.dependency 'ffmpeg-kit-ios-audio', "6.0.LTS"
ss.ios.deployment_target = '10'
end
s.subspec 'video' do |ss|
ss.source_files = '**/FFmpegKitReactNativeModule.m',
'**/FFmpegKitReactNativeModule.h'
ss.dependency 'ffmpeg-kit-ios-video', "6.0"
ss.ios.deployment_target = '12.1'
end
s.subspec 'video-lts' do |ss|
ss.source_files = '**/FFmpegKitReactNativeModule.m',
'**/FFmpegKitReactNativeModule.h'
ss.dependency 'ffmpeg-kit-ios-video', "6.0.LTS"
ss.ios.deployment_target = '10'
end
s.subspec 'full' do |ss|
ss.source_files = '**/FFmpegKitReactNativeModule.m',
'**/FFmpegKitReactNativeModule.h'
ss.dependency 'ffmpeg-kit-ios-full', "6.0"
ss.ios.deployment_target = '12.1'
end
s.subspec 'full-lts' do |ss|
ss.source_files = '**/FFmpegKitReactNativeModule.m',
'**/FFmpegKitReactNativeModule.h'
ss.dependency 'ffmpeg-kit-ios-full', "6.0.LTS"
ss.ios.deployment_target = '10'
end
s.subspec 'full-gpl' do |ss|
ss.source_files = '**/FFmpegKitReactNativeModule.m',
'**/FFmpegKitReactNativeModule.h'
ss.dependency 'ffmpeg-kit-ios-full-gpl', "6.0"
ss.ios.deployment_target = '12.1'
end
s.subspec 'full-gpl-lts' do |ss|
ss.source_files = '**/FFmpegKitReactNativeModule.m',
'**/FFmpegKitReactNativeModule.h'
ss.dependency 'ffmpeg-kit-ios-full-gpl', "6.0.LTS"
ss.ios.deployment_target = '10'
end
# This is a placeholder podspec that doesn't include any actual FFmpeg dependencies
# iOS support has been removed from this fork
s.ios.deployment_target = '12.1'
end

@ -17,10 +17,11 @@
* along with FFmpegKit. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Foundation/Foundation.h>
#import <ffmpegkit/FFmpegKitConfig.h>
#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>
@interface FFmpegKitReactNativeModule : RCTEventEmitter<RCTBridgeModule>
@interface FFmpegKitReactNativeModule : RCTEventEmitter <RCTBridgeModule>
// This is a stub implementation that indicates iOS is not supported
@end

@ -71,7 +71,7 @@ extern int const AbstractSessionDefaultTimeoutForAsynchronousMessagesInTransmit;
dispatch_queue_t asyncDispatchQueue;
}
RCT_EXPORT_MODULE(FFmpegKitReactNativeModule);
RCT_EXPORT_MODULE()
- (instancetype)init {
self = [super init];
@ -86,14 +86,8 @@ RCT_EXPORT_MODULE(FFmpegKitReactNativeModule);
return self;
}
- (NSArray<NSString*>*)supportedEvents {
NSMutableArray *array = [NSMutableArray array];
[array addObject:EVENT_LOG_CALLBACK_EVENT];
[array addObject:EVENT_STATISTICS_CALLBACK_EVENT];
[array addObject:EVENT_COMPLETE_CALLBACK_EVENT];
return array;
- (NSArray<NSString *> *)supportedEvents {
return @[@"FFmpegKitLogCallbackEvent", @"FFmpegKitStatisticsCallbackEvent", @"FFmpegKitCompleteCallbackEvent"];
}
- (void)registerGlobalCallbacks {
@ -387,15 +381,15 @@ RCT_EXPORT_METHOD(closeFFmpegPipe:(NSString*)ffmpegPipePath resolver:(RCTPromise
}
RCT_EXPORT_METHOD(getFFmpegVersion:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve([FFmpegKitConfig getFFmpegVersion]);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(isLTSBuild:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve([NSNumber numberWithInt:[FFmpegKitConfig isLTSBuild]]);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(getBuildDate:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve([FFmpegKitConfig getBuildDate]);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(setEnvironmentVariable:(NSString*)variableName with:(NSString*)variableValue resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
@ -514,21 +508,19 @@ RCT_EXPORT_METHOD(asyncMediaInformationSessionExecute:(int)sessionId withTimeout
}
RCT_EXPORT_METHOD(getLogLevel:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve([NSNumber numberWithInt:[FFmpegKitConfig getLogLevel]]);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(setLogLevel:(int)level resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
[FFmpegKitConfig setLogLevel:level];
resolve(nil);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(getSessionHistorySize:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve([NSNumber numberWithInt:[FFmpegKitConfig getSessionHistorySize]]);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(setSessionHistorySize:(int)sessionHistorySize resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
[FFmpegKitConfig setSessionHistorySize:sessionHistorySize];
resolve(nil);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(getSession:(int)sessionId resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
@ -541,160 +533,95 @@ RCT_EXPORT_METHOD(getSession:(int)sessionId resolver:(RCTPromiseResolveBlock)res
}
RCT_EXPORT_METHOD(getLastSession:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve([FFmpegKitReactNativeModule toSessionDictionary:[FFmpegKitConfig getLastSession]]);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(getLastCompletedSession:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve([FFmpegKitReactNativeModule toSessionDictionary:[FFmpegKitConfig getLastCompletedSession]]);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(getSessions:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve([FFmpegKitReactNativeModule toSessionArray:[FFmpegKitConfig getSessions]]);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(clearSessions:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
[FFmpegKitConfig clearSessions];
resolve(nil);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(getSessionsByState:(int)sessionState resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve([FFmpegKitReactNativeModule toSessionArray:[FFmpegKitConfig getSessionsByState:sessionState]]);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(getLogRedirectionStrategy:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve([FFmpegKitReactNativeModule logRedirectionStrategyToNumber:[FFmpegKitConfig getLogRedirectionStrategy]]);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(setLogRedirectionStrategy:(int)logRedirectionStrategy resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
[FFmpegKitConfig setLogRedirectionStrategy:logRedirectionStrategy];
resolve(nil);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(messagesInTransmit:(int)sessionId resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve([NSNumber numberWithInt:[FFmpegKitConfig messagesInTransmit:sessionId]]);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(getPlatform:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve(PLATFORM_NAME);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(writeToPipe:(NSString*)inputPath onPipe:(NSString*)namedPipePath resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
dispatch_async(asyncDispatchQueue, ^{
NSLog(@"Starting copy %@ to pipe %@ operation.\n", inputPath, namedPipePath);
NSFileHandle *fileHandle = [NSFileHandle fileHandleForReadingAtPath: inputPath];
if (fileHandle == nil) {
NSLog(@"Failed to open file %@.\n", inputPath);
reject(@"Copy failed", [NSString stringWithFormat:@"Failed to open file %@.", inputPath], nil);
return;
}
NSFileHandle *pipeHandle = [NSFileHandle fileHandleForWritingAtPath: namedPipePath];
if (pipeHandle == nil) {
NSLog(@"Failed to open pipe %@.\n", namedPipePath);
reject(@"Copy failed", [NSString stringWithFormat:@"Failed to open pipe %@.", namedPipePath], nil);
[fileHandle closeFile];
return;
}
int BUFFER_SIZE = 4096;
unsigned long readBytes = 0;
unsigned long totalBytes = 0;
double startTime = CACurrentMediaTime();
@try {
[fileHandle seekToFileOffset: 0];
do {
NSData *data = [fileHandle readDataOfLength:BUFFER_SIZE];
readBytes = [data length];
if (readBytes > 0) {
totalBytes += readBytes;
[pipeHandle writeData:data];
}
} while (readBytes > 0);
double endTime = CACurrentMediaTime();
NSLog(@"Copying %@ to pipe %@ operation completed successfully. %lu bytes copied in %f seconds.\n", inputPath, namedPipePath, totalBytes, (endTime - startTime)/1000);
resolve(0);
} @catch (NSException *e) {
NSLog(@"Copy failed %@.\n", [e reason]);
reject(@"Copy failed", [NSString stringWithFormat:@"Copy %@ to %@ failed with error %@.", inputPath, namedPipePath, [e reason]], nil);
} @finally {
[fileHandle closeFile];
[pipeHandle closeFile];
}
});
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(selectDocument:(BOOL)writable title:(NSString*)title type:(NSString*)type array:(NSArray*)extraTypes resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
reject(@"Not Supported", @"Not supported on iOS platform.", nil);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(getSafParameter:(NSString*)uriString mode:(NSString*)openMode resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
reject(@"Not Supported", @"Not supported on iOS platform.", nil);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
// FFmpegKit
RCT_EXPORT_METHOD(cancel:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
[FFmpegKit cancel];
resolve(nil);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(cancelSession:(int)sessionId resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
[FFmpegKit cancel:sessionId];
resolve(nil);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(getFFmpegSessions:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve([FFmpegKitReactNativeModule toSessionArray:[FFmpegKit listSessions]]);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
// FFprobeKit
RCT_EXPORT_METHOD(getFFprobeSessions:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve([FFmpegKitReactNativeModule toSessionArray:[FFprobeKit listFFprobeSessions]]);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(getMediaInformationSessions:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve([FFmpegKitReactNativeModule toSessionArray:[FFprobeKit listMediaInformationSessions]]);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
// MediaInformationSession
RCT_EXPORT_METHOD(getMediaInformation:(int)sessionId resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
AbstractSession* session = (AbstractSession*)[FFmpegKitConfig getSession:sessionId];
if (session == nil) {
reject(@"SESSION_NOT_FOUND", @"Session not found.", nil);
} else {
if ([session isMediaInformation]) {
MediaInformationSession *mediaInformationSession = (MediaInformationSession*)session;
resolve([FFmpegKitReactNativeModule toMediaInformationDictionary:[mediaInformationSession getMediaInformation]]);
} else {
reject(@"NOT_MEDIA_INFORMATION_SESSION", @"A session is found but it does not have the correct type.", nil);
}
}
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
// Packages
RCT_EXPORT_METHOD(getPackageName:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve([Packages getPackageName]);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(getExternalLibraries:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve([Packages getExternalLibraries]);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
RCT_EXPORT_METHOD(uninit:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve(nil);
reject(@"not_supported", @"iOS platform is not supported in this version", nil);
}
- (void)enableLogs {

@ -1,7 +1,7 @@
{
"name": "ffmpeg-kit-react-native",
"version": "6.0.2",
"description": "FFmpeg Kit for React Native",
"description": "FFmpeg Kit for React Native (Android only)",
"main": "src/index",
"types": "src/index.d.ts",
"react-native": "src/index",
@ -15,8 +15,7 @@
"react-native",
"android",
"ffmpeg",
"ffmpeg-kit",
"ios"
"ffmpeg-kit"
],
"repository": "https://github.com/arthenica/ffmpeg-kit",
"author": "ARTHENICA <open-source@arthenica.com> (https://www.arthenica.com)",

@ -1,7 +1,12 @@
import {NativeEventEmitter, NativeModules} from 'react-native';
import {NativeEventEmitter, NativeModules, Platform} from 'react-native';
const {FFmpegKitReactNativeModule} = NativeModules;
// Check if the platform is iOS and warn the user
if (Platform.OS === 'ios') {
console.warn('FFmpeg Kit: iOS platform is not supported in this version. All iOS-specific calls will fail.');
}
const ffmpegSessionCompleteCallbackMap = new Map()
const ffprobeSessionCompleteCallbackMap = new Map()
const mediaInformationSessionCompleteCallbackMap = new Map()

Loading…
Cancel
Save