Skip to content

Commit

Permalink
release react-native plugin v5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tanersener committed Oct 2, 2022
1 parent 80dc3ae commit b3379ce
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Please also include the context and motivation about the changes introduced.
- Documentation

## Checks
- [ ] Changes support all platforms (`Android`, `iOS`, `Linux`, macOS`, `tvOS`)
- [ ] Changes support all platforms (`Android`, `iOS`, `Linux`, `macOS`, `tvOS`)
- [ ] Breaks existing functionality
- [ ] Implementation is completed, not half-done
- [ ] Is there another PR already created for this feature/bug fix
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,12 @@ the same `FFmpeg` release branch.
`dev` part in the version string indicates that `FFmpeg` source code is cloned from the `FFmpeg` `master` branch and
the exact version number of `FFmpeg` is obtained using the `git describe --tags` command.

| Platforms | FFmpegKit Version | FFmpeg Version | Release Date |
|:----------------:|:----------------------------------------------------------------------------------:|:--------------:|:------------:|
| Platforms | FFmpegKit Version | FFmpeg Version | Release Date |
|:----------------:|:---------------------------------------------------------------------------------:|:--------------:|:------------:|
| React Native | [5.1.0](https://github.com/arthenica/ffmpeg-kit/releases/tag/react.native.v5.1.0) | 5.1.2 | Oct 02, 2022 |
| Flutter | [5.1.0](https://github.com/arthenica/ffmpeg-kit/releases/tag/flutter.v5.1.0) | 5.1.2 | Oct 02, 2022 |
| Android | [5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/v5.1) | 5.1.2 | Sep 29, 2022 |
| Apple | [5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/v5.1) | 5.1.2 | Sep 29, 2022 |
| Apple | [5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/v5.1) | 5.1.2 | Sep 29, 2022 |
| React Native | [4.5.2](https://github.com/arthenica/ffmpeg-kit/releases/tag/react.native.v4.5.2) | 4.5-dev-3393 | May 25, 2022 |
| Flutter | [4.5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/flutter.v4.5.1) | 4.5-dev-3393 | Jan 02, 2022 |
| React Native | [4.5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/react.native.v4.5.1) | 4.5-dev-3393 | Jan 02, 2022 |
Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ the exact version number of `FFmpeg` is obtained using the `git describe --tags`

| Platforms | FFmpegKit Version | FFmpeg Version | Release Date |
|:----------------:|:---------------------------------------------------------------------------------:|:--------------:|:------------:|
| React Native | [5.1.0](https://github.com/arthenica/ffmpeg-kit/releases/tag/react.native.v5.1.0) | 5.1.2 | Oct 02, 2022 |
| Flutter | [5.1.0](https://github.com/arthenica/ffmpeg-kit/releases/tag/flutter.v5.1.0) | 5.1.2 | Oct 02, 2022 |
| Android | [5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/v5.1) | 5.1.2 | Sep 29, 2022 |
| Apple | [5.1](https://github.com/arthenica/ffmpeg-kit/releases/tag/v5.1) | 5.1.2 | Sep 29, 2022 |
Expand Down
28 changes: 15 additions & 13 deletions react-native/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
- Includes both `FFmpeg` and `FFprobe`
- Supports
- Both `Android` and `iOS`
- FFmpeg `v4.5-dev` releases
- FFmpeg `v5.1.2`
- `arm-v7a`, `arm-v7a-neon`, `arm64-v8a`, `x86` and `x86_64` architectures on Android
- `Android API Level 16` or later
- `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 10` or later
- `iOS SDK 12.1` or later
- `iOS SDK 10` on LTS releases
- Can process Storage Access Framework (SAF) Uris on Android
- 25 external libraries

Expand All @@ -22,7 +24,7 @@
- `bzip2`, `iconv`, `libuuid`, `zlib` system libraries and `AudioToolbox`, `VideoToolbox`, `AVFoundation` system frameworks on iOS

- Includes Typescript definitions
- Licensed under LGPL 3.0, can be customized to support GPL v3.0
- Licensed under `LGPL 3.0` by default, some packages licensed by `GPL v3.0` effectively

### 2. Installation

Expand All @@ -32,16 +34,16 @@ yarn add ffmpeg-kit-react-native

#### 2.1 Packages

`ffmpeg` includes built-in encoders for some popular formats. However, there are certain external libraries that needs
`FFmpeg` includes built-in encoders for some popular formats. However, there are certain external libraries that needs
to be enabled in order to encode specific formats/codecs. For example, to encode an `mp3` file you need `lame` or
`shine` library enabled. You have to install a `ffmpeg-kit-react-native` package that has at least one of them inside.
To encode an `h264` video, you need to install a package with `x264` inside. To encode `vp8` or `vp9` videos, you need
a `ffmpeg-kit-react-native` package with `libvpx` inside.

`ffmpeg-kit` provides eight packages that include different sets of external libraries. These packages are
named according to the external libraries included in them. Refer to
[Packages](https://github.com/arthenica/ffmpeg-kit#9-packages) section of the project README to see the names
of those packages and external libraries included in each of them.
`ffmpeg-kit` provides eight packages that include different sets of external libraries. These packages are named
according to the external libraries included. Refer to the
[Packages](https://github.com/arthenica/ffmpeg-kit/wiki/Packages) wiki page to see the names of those
packages and external libraries included in each one of them.

##### 2.1.1 Package Names

Expand Down Expand Up @@ -184,10 +186,10 @@ the package name you are using.
#### 2.4 LTS Releases
`ffmpeg-kit-react-native` is published in two different variants: `Main Release` and `LTS Release`. Both releases
share the same source code but is built with different settings (Architectures, API Level, iOS Min SDK, etc.). Refer to
[LTS Releases](https://github.com/arthenica/ffmpeg-kit#11-lts-releases) section of the project README to see how they
compare to each other.
`ffmpeg-kit-react-native` is published in two variants: `Main Release` and `LTS Release`. Both releases share the
same source code but is built with different settings (Architectures, API Level, iOS Min SDK, etc.). Refer to the
[LTS Releases](https://github.com/arthenica/ffmpeg-kit/wiki/LTS-Releases) wiki page to see how they differ from each
other.
### 3. Using
Expand Down
17 changes: 8 additions & 9 deletions react-native/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.android.tools.build:gradle:7.3.0'
}
}

Expand All @@ -26,13 +26,13 @@ def safeExtGet(String prop, String fallback) {
}

android {
compileSdkVersion 30
compileSdkVersion 31

defaultConfig {
minSdkVersion safeExtGet('ffmpegKitPackage', 'https').contains("-lts") ? 16 : 24
targetSdkVersion 30
versionCode 452
versionName "4.5.2"
targetSdkVersion 31
versionCode 510
versionName "5.1.0"
}

buildTypes {
Expand All @@ -44,14 +44,13 @@ android {
disable 'GradleCompatible'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}

repositories {
mavenCentral()
jcenter()
google()

def found = false
Expand Down
4 changes: 2 additions & 2 deletions react-native/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
android.useAndroidX=true
ffmpegKit.android.main.version=4.5.1-1
ffmpegKit.android.lts.version=4.5.1-1
ffmpegKit.android.main.version=5.1
ffmpegKit.android.lts.version=5.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
32 changes: 16 additions & 16 deletions react-native/ffmpeg-kit-react-native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,112 +23,112 @@ Pod::Spec.new do |s|
s.subspec 'min' do |ss|
ss.source_files = '**/FFmpegKitReactNativeModule.m',
'**/FFmpegKitReactNativeModule.h'
ss.dependency 'ffmpeg-kit-ios-min', "4.5.1"
ss.dependency 'ffmpeg-kit-ios-min', "5.1"
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', "4.5.1.LTS"
ss.dependency 'ffmpeg-kit-ios-min', "5.1.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', "4.5.1"
ss.dependency 'ffmpeg-kit-ios-min-gpl', "5.1"
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', "4.5.1.LTS"
ss.dependency 'ffmpeg-kit-ios-min-gpl', "5.1.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', "4.5.1"
ss.dependency 'ffmpeg-kit-ios-https', "5.1"
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', "4.5.1.LTS"
ss.dependency 'ffmpeg-kit-ios-https', "5.1.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', "4.5.1"
ss.dependency 'ffmpeg-kit-ios-https-gpl', "5.1"
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', "4.5.1.LTS"
ss.dependency 'ffmpeg-kit-ios-https-gpl', "5.1.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', "4.5.1"
ss.dependency 'ffmpeg-kit-ios-audio', "5.1"
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', "4.5.1.LTS"
ss.dependency 'ffmpeg-kit-ios-audio', "5.1.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', "4.5.1"
ss.dependency 'ffmpeg-kit-ios-video', "5.1"
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', "4.5.1.LTS"
ss.dependency 'ffmpeg-kit-ios-video', "5.1.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', "4.5.1"
ss.dependency 'ffmpeg-kit-ios-full', "5.1"
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', "4.5.1.LTS"
ss.dependency 'ffmpeg-kit-ios-full', "5.1.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', "4.5.1"
ss.dependency 'ffmpeg-kit-ios-full-gpl', "5.1"
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', "4.5.1.LTS"
ss.dependency 'ffmpeg-kit-ios-full-gpl', "5.1.LTS"
ss.ios.deployment_target = '10'
end

Expand Down
18 changes: 8 additions & 10 deletions react-native/ios/FFmpegKitReactNativeModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -299,23 +299,21 @@ - (void)registerGlobalCallbacks {
// MediaInformationJsonParser

RCT_EXPORT_METHOD(mediaInformationJsonParserFrom:(NSString*)ffprobeJsonOutput resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
NSError *error;
MediaInformation* mediaInformation = [MediaInformationJsonParser from:ffprobeJsonOutput with:error];
if (error == nil) {
@try {
MediaInformation* mediaInformation = [MediaInformationJsonParser fromWithError:ffprobeJsonOutput];
resolve([FFmpegKitReactNativeModule toMediaInformationDictionary:mediaInformation]);
} else {
NSLog(@"MediaInformation parsing failed: %@.\n", error);
} @catch (NSException *exception) {
NSLog(@"Parsing MediaInformation failed: %@.\n", [NSString stringWithFormat:@"%@\n%@", [exception userInfo], [exception callStackSymbols]]);
resolve(nil);
}
}

RCT_EXPORT_METHOD(mediaInformationJsonParserFromWithError:(NSString*)ffprobeJsonOutput resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
NSError *error;
MediaInformation* mediaInformation = [MediaInformationJsonParser from:ffprobeJsonOutput with:error];
if (error == nil) {
@try {
MediaInformation* mediaInformation = [MediaInformationJsonParser fromWithError:ffprobeJsonOutput];
resolve([FFmpegKitReactNativeModule toMediaInformationDictionary:mediaInformation]);
} else {
NSLog(@"MediaInformation parsing failed: %@.\n", error);
} @catch (NSException *exception) {
NSLog(@"Parsing MediaInformation failed: %@.\n", [NSString stringWithFormat:@"%@\n%@", [exception userInfo], [exception callStackSymbols]]);
reject(@"PARSE_FAILED", @"Parsing MediaInformation failed with JSON error.", nil);
}
}
Expand Down
4 changes: 2 additions & 2 deletions react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ffmpeg-kit-react-native",
"version": "4.5.2",
"version": "5.1.0",
"description": "FFmpeg Kit for React Native",
"main": "src/index",
"types": "src/index.d.ts",
Expand All @@ -19,7 +19,7 @@
"ios"
],
"repository": "https://github.com/arthenica/ffmpeg-kit",
"author": "ARTHENICA <[email protected]> (https://github.com/arthenica)",
"author": "ARTHENICA <[email protected]> (https://www.arthenica.com)",
"license": "LGPL-3.0",
"bugs": {
"url": "https://github.com/arthenica/ffmpeg-kit/issues"
Expand Down
22 changes: 11 additions & 11 deletions react-native/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1611,7 +1611,7 @@ class FFmpegKitFactory {
}

static getVersion() {
return "4.5.2";
return "5.1.0";
}

static getLogRedirectionStrategy(sessionId) {
Expand Down Expand Up @@ -3091,7 +3091,7 @@ export class StreamInformation {
* @return tags object
*/
getTags() {
return this.getProperties(StreamInformation.KEY_TAGS);
return this.getProperty(StreamInformation.KEY_TAGS);
}

/**
Expand Down Expand Up @@ -3123,12 +3123,12 @@ export class StreamInformation {
}

/**
* Returns the stream properties associated with the key.
* Returns the stream property associated with the key.
*
* @param key properties key
* @return stream properties as an object or undefined if the key is not found
* @param key property key
* @return stream property as an object or undefined if the key is not found
*/
getProperties(key) {
getProperty(key) {
if (this.#allProperties !== undefined) {
return this.#allProperties[key];
} else {
Expand Down Expand Up @@ -3225,7 +3225,7 @@ export class Chapter {
* @return tags object
*/
getTags() {
return this.getProperties(StreamInformation.KEY_TAGS);
return this.getProperty(StreamInformation.KEY_TAGS);
}

/**
Expand Down Expand Up @@ -3257,12 +3257,12 @@ export class Chapter {
}

/**
* Returns the chapter properties associated with the key.
* Returns the chapter property associated with the key.
*
* @param key properties key
* @return chapter properties as an object or undefined if the key is not found
* @param key property key
* @return chapter property as an object or undefined if the key is not found
*/
getProperties(key) {
getProperty(key) {
if (this.#allProperties !== undefined) {
return this.#allProperties[key];
} else {
Expand Down

0 comments on commit b3379ce

Please sign in to comment.