@imgly/editor-react-native 1.79.0 → 1.80.0-rc.1
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/android/build.gradle +1 -1
- package/android/src/main/kotlin/ly/img/editor/configuration/video/callback/OnExport.kt +4 -0
- package/android/src/main/kotlin/ly/img/editor/reactnative/module/builder/EditorBuilder.kt +1 -1
- package/android/src/main/kotlin/ly/img/editor/reactnative/module/model/EditorSourceType.kt +1 -1
- package/ios/Helper/ExportHelper.swift +3 -1
- package/ios/StarterKits/Video/callbacks/OnExport+Video.swift +6 -1
- package/package.json +1 -1
- package/src/NativeIMGLYEditor.ts +2 -2
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,9 @@ package ly.img.editor.configuration.video.callback
|
|
|
3
3
|
import kotlinx.coroutines.CancellationException
|
|
4
4
|
import ly.img.editor.configuration.video.VideoConfigurationBuilder
|
|
5
5
|
import ly.img.editor.configuration.video.model.ExportStatus
|
|
6
|
+
import ly.img.engine.ExportVideoOptions
|
|
6
7
|
import ly.img.engine.MimeType
|
|
8
|
+
import ly.img.engine.VideoBitrate
|
|
7
9
|
import java.nio.ByteBuffer
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -63,6 +65,8 @@ suspend fun VideoConfigurationBuilder.onExportByteBuffer(): ByteBuffer {
|
|
|
63
65
|
exportStatus = ExportStatus.Loading(progress = newProgress)
|
|
64
66
|
}
|
|
65
67
|
},
|
|
68
|
+
// videoBitrate: VideoBitrate.Auto derives a bounded bitrate from the resolution/framerate.
|
|
69
|
+
options = ExportVideoOptions(videoBitrate = VideoBitrate.Auto),
|
|
66
70
|
)
|
|
67
71
|
}
|
|
68
72
|
// highlight-starter-kit-on-export-byte-buffer
|
|
@@ -435,7 +435,7 @@ object EditorBuilderDefaults {
|
|
|
435
435
|
}
|
|
436
436
|
|
|
437
437
|
private suspend fun saveScene(scene: String): Uri = withContext(Dispatchers.IO) {
|
|
438
|
-
val file = File.createTempFile("cesdk_export_scene_" + UUID.randomUUID().toString(), ".
|
|
438
|
+
val file = File.createTempFile("cesdk_export_scene_" + UUID.randomUUID().toString(), ".imgly")
|
|
439
439
|
file.writeText(scene)
|
|
440
440
|
Uri.fromFile(file)
|
|
441
441
|
}
|
|
@@ -22,7 +22,9 @@ class ExportHelper {
|
|
|
22
22
|
/// - Returns: The file `URL`.
|
|
23
23
|
func saveScene(_ scene: String) throws -> URL? {
|
|
24
24
|
let fileName = "cesdk_export_scene_" + UUID().uuidString
|
|
25
|
-
let url = FileManager.default.temporaryDirectory
|
|
25
|
+
let url = FileManager.default.temporaryDirectory
|
|
26
|
+
.appendingPathComponent(fileName)
|
|
27
|
+
.appendingPathExtension("imgly")
|
|
26
28
|
if let data = scene.data(using: .utf8) {
|
|
27
29
|
try data.write(to: url, options: [.atomic])
|
|
28
30
|
return url
|
|
@@ -16,7 +16,12 @@ extension VideoEditorConfiguration {
|
|
|
16
16
|
}
|
|
17
17
|
eventHandler.send(.exportProgress(.relative(0)))
|
|
18
18
|
let mimeType: MIMEType = .mp4
|
|
19
|
-
|
|
19
|
+
// videoBitrate: .auto derives a bounded bitrate from the resolution/framerate.
|
|
20
|
+
let stream = try await engine.block.exportVideo(
|
|
21
|
+
page,
|
|
22
|
+
mimeType: mimeType,
|
|
23
|
+
options: VideoExportOptions(videoBitrate: .auto),
|
|
24
|
+
) { _ in }
|
|
20
25
|
|
|
21
26
|
var lastReportedProgress = 0
|
|
22
27
|
for try await export in stream {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imgly/editor-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.80.0-rc.1",
|
|
4
4
|
"description": "CreativeEditor SDK for React Native - enable photo, video and design editing for your users on iOS and Android.",
|
|
5
5
|
"react-native": "index.js",
|
|
6
6
|
"source": "index.js",
|
package/src/NativeIMGLYEditor.ts
CHANGED
|
@@ -96,7 +96,7 @@ export class EditorSettingsModel implements EditorSettings {
|
|
|
96
96
|
* sources (stickers, filters, and more).
|
|
97
97
|
*/
|
|
98
98
|
baseUri: string =
|
|
99
|
-
'https://cdn.img.ly/packages/imgly/cesdk-react-native/1.
|
|
99
|
+
'https://cdn.img.ly/packages/imgly/cesdk-react-native/1.80.0-rc.1/assets';
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* Unique ID tied to your application's user.
|
|
@@ -115,7 +115,7 @@ export class EditorSettingsModel implements EditorSettings {
|
|
|
115
115
|
* loaded into the editor.
|
|
116
116
|
*/
|
|
117
117
|
export enum SourceType {
|
|
118
|
-
/** A `.scene`
|
|
118
|
+
/** A scene file (`.imgly` or the legacy `.scene`). */
|
|
119
119
|
SCENE = 'scene',
|
|
120
120
|
|
|
121
121
|
/** An image, e.g. `.png`. */
|