Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

C-1606 C-1609 C-1610 Share to IG Story QA #2359

Merged
merged 2 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion
flavorDimensions "default"

packagingOptions {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wild, whats the tldr here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh this was just to fix this issue where two of our packages included libc++_shared.so

pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
targetSdkVersion = 31
castFrameworkVersion = "21.0.0"
ndkVersion = "21.4.7075529"
ffmpegKitPackage = "https-lts"
ffmpegKitPackage = "https-gpl-lts"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess this too? need GPL version for android?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah so we needed to use the libx264 encoder to produce the properly formatted video with H.264/AAC, which is included in the GPL version but not the regular one. then i also needed to add file:// (for some reason it was working without this in iOS, it's like a small print thing in the react-native-share docs)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome finds, wow

}
repositories {
google()
Expand Down
16 changes: 8 additions & 8 deletions packages/mobile/ios/AudiusReactNative.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -376,14 +376,14 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-AudiusReactNative/Pods-AudiusReactNative-frameworks.sh",
"${PODS_ROOT}/ffmpeg-kit-ios-https/ffmpegkit.framework",
"${PODS_ROOT}/ffmpeg-kit-ios-https/libavcodec.framework",
"${PODS_ROOT}/ffmpeg-kit-ios-https/libavdevice.framework",
"${PODS_ROOT}/ffmpeg-kit-ios-https/libavfilter.framework",
"${PODS_ROOT}/ffmpeg-kit-ios-https/libavformat.framework",
"${PODS_ROOT}/ffmpeg-kit-ios-https/libavutil.framework",
"${PODS_ROOT}/ffmpeg-kit-ios-https/libswresample.framework",
"${PODS_ROOT}/ffmpeg-kit-ios-https/libswscale.framework",
"${PODS_ROOT}/ffmpeg-kit-ios-https-gpl/ffmpegkit.framework",
"${PODS_ROOT}/ffmpeg-kit-ios-https-gpl/libavcodec.framework",
"${PODS_ROOT}/ffmpeg-kit-ios-https-gpl/libavdevice.framework",
"${PODS_ROOT}/ffmpeg-kit-ios-https-gpl/libavfilter.framework",
"${PODS_ROOT}/ffmpeg-kit-ios-https-gpl/libavformat.framework",
"${PODS_ROOT}/ffmpeg-kit-ios-https-gpl/libavutil.framework",
"${PODS_ROOT}/ffmpeg-kit-ios-https-gpl/libswresample.framework",
"${PODS_ROOT}/ffmpeg-kit-ios-https-gpl/libswscale.framework",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/FingerprintPro/FingerprintPro.framework/FingerprintPro",
);
name = "[CP] Embed Pods Frameworks";
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ target 'AudiusReactNative' do
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'RCT-Folly', :podspec => '../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec'
pod 'boost', :podspec => '../node_modules/react-native/third-party-podspecs/boost.podspec'
pod 'ffmpeg-kit-react-native', :subspecs => ['https-lts'], :podspec => '../node_modules/ffmpeg-kit-react-native/ffmpeg-kit-react-native.podspec'
pod 'ffmpeg-kit-react-native', :subspecs => ['https-gpl-lts'], :podspec => '../node_modules/ffmpeg-kit-react-native/ffmpeg-kit-react-native.podspec'

config = use_native_modules!
use_react_native!(
Expand Down
14 changes: 7 additions & 7 deletions packages/mobile/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ PODS:
- React-Core (= 0.66.5)
- React-jsi (= 0.66.5)
- ReactCommon/turbomodule/core (= 0.66.5)
- ffmpeg-kit-ios-https (4.5.1.LTS)
- ffmpeg-kit-react-native/https-lts (4.5.2):
- ffmpeg-kit-ios-https (= 4.5.1.LTS)
- ffmpeg-kit-ios-https-gpl (4.5.1.LTS)
- ffmpeg-kit-react-native/https-gpl-lts (4.5.2):
- ffmpeg-kit-ios-https-gpl (= 4.5.1.LTS)
- React-Core
- FingerprintPro (2.1.3)
- Firebase/Analytics (8.12.1):
Expand Down Expand Up @@ -518,7 +518,7 @@ DEPENDENCIES:
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
- ffmpeg-kit-react-native/https-lts (from `../node_modules/ffmpeg-kit-react-native/ffmpeg-kit-react-native.podspec`)
- ffmpeg-kit-react-native/https-gpl-lts (from `../node_modules/ffmpeg-kit-react-native/ffmpeg-kit-react-native.podspec`)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- lottie-ios (from `../node_modules/lottie-ios`)
- lottie-react-native (from `../node_modules/lottie-react-native`)
Expand Down Expand Up @@ -597,7 +597,7 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- Amplitude
- ffmpeg-kit-ios-https
- ffmpeg-kit-ios-https-gpl
- FingerprintPro
- Firebase
- FirebaseAnalytics
Expand Down Expand Up @@ -784,7 +784,7 @@ SPEC CHECKSUMS:
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
FBLazyVector: a926a9aaa3596b181972abf0f47eff3dee796222
FBReactNativeSpec: f1141d5407f4a27c397bca5db03cc03919357b0d
ffmpeg-kit-ios-https: c95f1d49599efd796a7cfb433f4500a7c953cc9c
ffmpeg-kit-ios-https-gpl: fb9fc0617a646209f8f4a62b5581000dc4ee6a67
ffmpeg-kit-react-native: a0a2e03ca2bb95fc95dfa88e254f412aa03a94d1
FingerprintPro: 4c5fafa1f42648a6d0fb8eda63fa4a9e0eed8229
Firebase: 580d09e8edafc3073ebf09c03fd42e4d80d35fe9
Expand Down Expand Up @@ -876,6 +876,6 @@ SPEC CHECKSUMS:
SRSRadialGradient: 71378a83e52b616c40367c37ee7cb6865f9f7c6e
Yoga: b316a990bb6d115afa1b436b5626ac7c61717d17

PODFILE CHECKSUM: c9b95587012acb2b0b533d3c6d6b8cd587bc5b55
PODFILE CHECKSUM: 86c7e909196d7920299e68babc12fcaf4882d3e8

COCOAPODS: 1.11.3
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,12 @@ export const useShareToStory = ({

try {
session = await FFmpegKit.execute(
`${audioStartOffsetConfig}-i ${streamMp3Url} -filter_complex "gradients=s=720x1280:c0=${dominantColorHex1}:c1=${dominantColorHex2}:x0=360:y0=0:x1=360:y1=1280:duration=10:speed=0.042:rate=30[bg];[0:a]aformat=channel_layouts=mono,showwaves=mode=cline:n=1:s=720x135:scale=cbrt:colors=#ffffff[fg];[bg][fg]overlay=format=auto:x=0:y=H-h-100" -vb 5M -t 10 ${storyVideoPath}`
`${audioStartOffsetConfig}-i ${streamMp3Url} -filter_complex "gradients=s=540x960:x0=270:y0=2:x1=270:y1=958:c0=${dominantColorHex1}:c1=${dominantColorHex2}:duration=10:speed=0.042:rate=30[bg];[0:a]aformat=channel_layouts=mono,showfreqs=s=540x80:fscale=log:colors=#ffffff[fg];[bg][fg]overlay=format=auto:x=0:y=H-h-80" -pix_fmt yuv420p -c:v libx264 -preset ultrafast -c:a aac -t 10 ${storyVideoPath}`
)
} catch (e) {
handleError(e, 'Share to IG Story error')
return
}

if (cancelRef.current) {
// The job was cancelled.
cleanup()
Expand All @@ -274,7 +273,7 @@ export const useShareToStory = ({

// Step 4: Put everything together and push to IG
const shareOptions = {
backgroundVideo: storyVideoPath,
backgroundVideo: `file://${storyVideoPath}`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

stickerImage: stickerUri,
attributionURL: Config.AUDIUS_URL,
social: Share.Social.INSTAGRAM_STORIES,
Expand Down