@technotoil/image-video-editor 0.1.4 → 0.1.5
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@technotoil/image-video-editor",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "A high-performance React Native image and video editor featuring video trimming, filters, photo overlay frames, and camera/gallery integration.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -1727,10 +1727,9 @@ export function EditorScreen({
|
|
|
1727
1727
|
cumulativeMusicOffsetMs += newDuration;
|
|
1728
1728
|
}
|
|
1729
1729
|
} else {
|
|
1730
|
-
if (
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
outUri = await trimVideo(targetItem.uri, {
|
|
1730
|
+
if (targetItem.type === 'image') {
|
|
1731
|
+
if (selectedMusic) {
|
|
1732
|
+
const outUri = await trimVideo(targetItem.uri, {
|
|
1734
1733
|
isImage: true,
|
|
1735
1734
|
musicUri: selectedMusic.url,
|
|
1736
1735
|
musicOffsetMs: cumulativeMusicOffsetMs,
|
|
@@ -1743,9 +1742,17 @@ export function EditorScreen({
|
|
|
1743
1742
|
grayscale: false,
|
|
1744
1743
|
});
|
|
1745
1744
|
cumulativeMusicOffsetMs += 10000;
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1745
|
+
updatedItems[i] = {
|
|
1746
|
+
...targetItem,
|
|
1747
|
+
uri: outUri,
|
|
1748
|
+
thumbnailUri: outUri,
|
|
1749
|
+
};
|
|
1750
|
+
}
|
|
1751
|
+
} else {
|
|
1752
|
+
const needsTrim = selectedMusic || (maxVideoDurationMs && (!targetItem.durationMs || targetItem.durationMs > maxVideoDurationMs));
|
|
1753
|
+
if (needsTrim) {
|
|
1754
|
+
const safeEndMs = maxVideoDurationMs ? Math.min(targetItem.durationMs || 10000, maxVideoDurationMs) : (targetItem.durationMs || 10000);
|
|
1755
|
+
const outUri = await trimVideo(targetItem.uri, {
|
|
1749
1756
|
startMs: 0,
|
|
1750
1757
|
endMs: safeEndMs,
|
|
1751
1758
|
mute: isMuted,
|
|
@@ -1758,13 +1765,24 @@ export function EditorScreen({
|
|
|
1758
1765
|
saturation: 1,
|
|
1759
1766
|
grayscale: false,
|
|
1760
1767
|
});
|
|
1768
|
+
|
|
1769
|
+
let newThumb = undefined;
|
|
1770
|
+
try {
|
|
1771
|
+
newThumb = await captureFrame(outUri, { timeMs: 0 });
|
|
1772
|
+
} catch (e) {
|
|
1773
|
+
console.warn('Could not generate filtered thumb', e);
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
updatedItems[i] = {
|
|
1777
|
+
...targetItem,
|
|
1778
|
+
uri: outUri,
|
|
1779
|
+
thumbnailUri: newThumb ? newThumb : targetItem.thumbnailUri,
|
|
1780
|
+
durationMs: safeEndMs,
|
|
1781
|
+
};
|
|
1761
1782
|
cumulativeMusicOffsetMs += safeEndMs;
|
|
1783
|
+
} else {
|
|
1784
|
+
cumulativeMusicOffsetMs += targetItem.durationMs || 10000;
|
|
1762
1785
|
}
|
|
1763
|
-
updatedItems[i] = {
|
|
1764
|
-
...targetItem,
|
|
1765
|
-
uri: outUri,
|
|
1766
|
-
thumbnailUri: targetItem.type === 'image' ? outUri : targetItem.thumbnailUri,
|
|
1767
|
-
};
|
|
1768
1786
|
}
|
|
1769
1787
|
}
|
|
1770
1788
|
}
|