Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[APP-2037] add bsky video (#10281)

Co-authored-by: Samuel Newman <mozzius@protonmail.com>

authored by

Spence Pope
Samuel Newman
and committed by
GitHub
444c5787 2798e98c

+9 -145
+1 -1
package.json
··· 91 91 "@bsky.app/react-native-mmkv": "2.12.5", 92 92 "@bsky.app/sift": "^0.3.3", 93 93 "@bsky.app/tapper": "^0.5.1", 94 + "@bsky.app/video": "0.3.4", 94 95 "@discord/bottom-sheet": "bluesky-social/react-native-bottom-sheet", 95 96 "@emoji-mart/data": "^1.2.1", 96 97 "@emoji-mart/react": "^1.1.1", ··· 108 109 "@fortawesome/react-native-fontawesome": "^0.3.2", 109 110 "@growthbook/growthbook": "^1.6.5", 110 111 "@growthbook/growthbook-react": "^1.6.5", 111 - "@haileyok/bluesky-video": "0.3.2", 112 112 "@ipld/dag-cbor": "^9.2.0", 113 113 "@lingui/core": "^5.9.2", 114 114 "@lingui/react": "^5.9.2",
-136
patches/@haileyok+bluesky-video+0.3.2.patch
··· 1 - diff --git a/node_modules/@haileyok/bluesky-video/android/build.gradle b/node_modules/@haileyok/bluesky-video/android/build.gradle 2 - index b988d3f..7743421 100644 3 - --- a/node_modules/@haileyok/bluesky-video/android/build.gradle 4 - +++ b/node_modules/@haileyok/bluesky-video/android/build.gradle 5 - @@ -36,6 +36,7 @@ android { 6 - defaultConfig { 7 - versionCode 1 8 - versionName "0.1.0" 9 - + consumerProguardFiles 'proguard-rules.pro' 10 - } 11 - lintOptions { 12 - abortOnError false 13 - diff --git a/node_modules/@haileyok/bluesky-video/android/proguard-rules.pro b/node_modules/@haileyok/bluesky-video/android/proguard-rules.pro 14 - new file mode 100644 15 - index 0000000..3b5b864 16 - --- /dev/null 17 - +++ b/node_modules/@haileyok/bluesky-video/android/proguard-rules.pro 18 - @@ -0,0 +1,2 @@ 19 - +# Keep FullscreenActivity from being stripped by R8/ProGuard 20 - +-keep class expo.modules.blueskyvideo.FullscreenActivity { *; } 21 - diff --git a/node_modules/@haileyok/bluesky-video/android/src/main/java/expo/modules/blueskyvideo/BlueskyVideoView.kt b/node_modules/@haileyok/bluesky-video/android/src/main/java/expo/modules/blueskyvideo/BlueskyVideoView.kt 22 - index fdabd84..eda8c7c 100644 23 - --- a/node_modules/@haileyok/bluesky-video/android/src/main/java/expo/modules/blueskyvideo/BlueskyVideoView.kt 24 - +++ b/node_modules/@haileyok/bluesky-video/android/src/main/java/expo/modules/blueskyvideo/BlueskyVideoView.kt 25 - @@ -1,8 +1,11 @@ 26 - package expo.modules.blueskyvideo 27 - 28 - +import android.app.Activity 29 - import android.content.Context 30 - import android.content.Intent 31 - import android.graphics.Color 32 - +import android.os.Build 33 - +import android.util.Log 34 - import android.graphics.Rect 35 - import android.net.Uri 36 - import android.view.ViewGroup 37 - @@ -237,9 +240,44 @@ class BlueskyVideoView( 38 - // Fullscreen handling 39 - 40 - fun enterFullscreen(keepDisplayOn: Boolean) { 41 - - val currentActivity = this.appContext.currentActivity ?: return 42 - + val tag = "BlueskyVideo" 43 - + 44 - + Log.d(tag, "enterFullscreen() called - keepDisplayOn=$keepDisplayOn") 45 - + Log.d(tag, " isFullscreen=$isFullscreen, isPlaying=$isPlaying, isMuted=$isMuted") 46 - + Log.d(tag, " player=${player != null}, url=$url") 47 - + Log.d(tag, " isAttachedToWindow=$isAttachedToWindow, isShown=$isShown") 48 - + Log.d(tag, " Android SDK: ${Build.VERSION.SDK_INT}, Device: ${Build.MANUFACTURER} ${Build.MODEL}") 49 - + 50 - + val currentActivity = this.appContext.currentActivity 51 - + if (currentActivity == null) { 52 - + Log.e(tag, "enterFullscreen() FAILED: currentActivity is null") 53 - + Log.e(tag, " appContext=$appContext") 54 - + onError(mapOf("error" to "Cannot enter fullscreen: no current activity")) 55 - + return 56 - + } 57 - + 58 - + Log.d(tag, " currentActivity=$currentActivity") 59 - + Log.d(tag, " activity.isFinishing=${currentActivity.isFinishing}") 60 - + Log.d(tag, " activity.isDestroyed=${currentActivity.isDestroyed}") 61 - + Log.d(tag, " activity.lifecycle=${(currentActivity as? androidx.lifecycle.LifecycleOwner)?.lifecycle?.currentState}") 62 - + Log.d(tag, " activity.hasWindowFocus=${currentActivity.hasWindowFocus()}") 63 - + Log.d(tag, " activity.window.isActive=${currentActivity.window?.isActive}") 64 - + 65 - + // Check if activity is in a valid state to start another activity 66 - + if (currentActivity.isFinishing) { 67 - + Log.e(tag, "enterFullscreen() FAILED: currentActivity is finishing") 68 - + onError(mapOf("error" to "Cannot enter fullscreen: activity is finishing")) 69 - + return 70 - + } 71 - + 72 - + if (currentActivity.isDestroyed) { 73 - + Log.e(tag, "enterFullscreen() FAILED: currentActivity is destroyed") 74 - + onError(mapOf("error" to "Cannot enter fullscreen: activity is destroyed")) 75 - + return 76 - + } 77 - 78 - this.enteredFullscreenMuteState = this.isMuted 79 - + Log.d(tag, " saved enteredFullscreenMuteState=$enteredFullscreenMuteState") 80 - 81 - // We always want to start with unmuted state and playing. Fire those from here so the 82 - // event dispatcher gets called 83 - @@ -247,18 +285,51 @@ class BlueskyVideoView( 84 - if (!this.isPlaying) { 85 - this.play() 86 - } 87 - + Log.d(tag, " after unmute/play: isPlaying=$isPlaying, isMuted=$isMuted") 88 - 89 - // Remove the player from this view, but don't null the player! 90 - this.playerView.player = null 91 - + Log.d(tag, " detached player from playerView") 92 - 93 - // create the intent and give it a view 94 - val intent = Intent(context, FullscreenActivity::class.java) 95 - intent.putExtra("keepDisplayOn", keepDisplayOn) 96 - FullscreenActivity.asscVideoView = WeakReference(this) 97 - 98 - + Log.d(tag, " intent created: $intent") 99 - + Log.d(tag, " intent.component=${intent.component}") 100 - + Log.d(tag, " intent.flags=${intent.flags} (0x${Integer.toHexString(intent.flags)})") 101 - + Log.d(tag, " context for intent=$context") 102 - + Log.d(tag, " FullscreenActivity.asscVideoView set to WeakReference(this)") 103 - + 104 - // fire the fullscreen event and launch the intent 105 - - this.isFullscreen = true 106 - - currentActivity.startActivity(intent) 107 - + try { 108 - + Log.d(tag, " calling startActivity()...") 109 - + currentActivity.startActivity(intent) 110 - + this.isFullscreen = true 111 - + Log.d(tag, " startActivity() SUCCESS - isFullscreen set to true") 112 - + } catch (e: Exception) { 113 - + Log.e(tag, "enterFullscreen() FAILED: startActivity() threw exception", e) 114 - + Log.e(tag, " exception class: ${e.javaClass.name}") 115 - + Log.e(tag, " exception message: ${e.message}") 116 - + Log.e(tag, " exception cause: ${e.cause}") 117 - + e.printStackTrace() 118 - + 119 - + // Restore state since fullscreen failed 120 - + this.playerView.player = this.player 121 - + Log.d(tag, " restored player to playerView after failure") 122 - + 123 - + if (this.enteredFullscreenMuteState) { 124 - + this.mute() 125 - + Log.d(tag, " restored mute state after failure") 126 - + } 127 - + 128 - + onError(mapOf( 129 - + "error" to "Failed to enter fullscreen: ${e.message}", 130 - + "exceptionClass" to e.javaClass.name, 131 - + "exceptionMessage" to (e.message ?: "unknown") 132 - + )) 133 - + } 134 - } 135 - 136 - fun onExitFullscreen() {
+1 -1
src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerNative.tsx
··· 1 1 import {useImperativeHandle, useRef, useState} from 'react' 2 2 import {Pressable, type StyleProp, View, type ViewStyle} from 'react-native' 3 3 import {type AppBskyEmbedVideo} from '@atproto/api' 4 - import {BlueskyVideoView} from '@haileyok/bluesky-video' 4 + import {BlueskyVideoView} from '@bsky.app/video' 5 5 import {msg} from '@lingui/core/macro' 6 6 import {useLingui} from '@lingui/react' 7 7
+1 -1
src/view/com/composer/videos/VideoPreview.tsx
··· 2 2 import {View} from 'react-native' 3 3 import {Image} from 'expo-image' 4 4 import {type ImagePickerAsset} from 'expo-image-picker' 5 - import {BlueskyVideoView} from '@haileyok/bluesky-video' 5 + import {BlueskyVideoView} from '@bsky.app/video' 6 6 7 7 import {type CompressedVideo} from '#/lib/media/video/types' 8 8 import {clamp} from '#/lib/numbers'
+1 -1
src/view/com/util/List.tsx
··· 6 6 useAnimatedScrollHandler, 7 7 useSharedValue, 8 8 } from 'react-native-reanimated' 9 - import {updateActiveVideoViewAsync} from '@haileyok/bluesky-video' 9 + import {updateActiveVideoViewAsync} from '@bsky.app/video' 10 10 11 11 import {useDedupe} from '#/lib/hooks/useDedupe' 12 12 import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
+5 -5
yarn.lock
··· 2454 2454 resolved "https://registry.yarnpkg.com/@bsky.app/tapper/-/tapper-0.5.1.tgz#7c72e1903435290a29be9f33fe0fcba95bbfa554" 2455 2455 integrity sha512-roGmW6Fk9qE8N0u9d74XzX9+MUIr04PElOhfIg0pXtZ1buaORpasLBBC+i6WytxDP2p29CuFdzBXDaBhmcI/ow== 2456 2456 2457 + "@bsky.app/video@0.3.4": 2458 + version "0.3.4" 2459 + resolved "https://registry.yarnpkg.com/@bsky.app/video/-/video-0.3.4.tgz#68c626d025f0005313a8320120540f51bed58da7" 2460 + integrity sha512-BTHfdS5hWlpBvMSNhYhsAoBnWtu4BCXYyK/DZ1wA/akXquJP3SuzEGL6B2V0Xdtg2E0rhjJD2njlTj69E64reg== 2461 + 2457 2462 "@crowdin/cli@^4.14.1": 2458 2463 version "4.14.1" 2459 2464 resolved "https://registry.yarnpkg.com/@crowdin/cli/-/cli-4.14.1.tgz#1239922681235b6b14bcacd4fd622bc2217dd6c5" ··· 3371 3376 integrity sha512-mUaMsgeUTpRIUOTn33EUXHRK6j7pxBjwqH4WpQyq+pukjd1AIzWlEa6w7i6bInJUcweGgP2beXZmaP6b6UPn7A== 3372 3377 dependencies: 3373 3378 dom-mutator "^0.6.0" 3374 - 3375 - "@haileyok/bluesky-video@0.3.2": 3376 - version "0.3.2" 3377 - resolved "https://registry.yarnpkg.com/@haileyok/bluesky-video/-/bluesky-video-0.3.2.tgz#44dc3974750a9619a4d72e97a0f1678f335028cd" 3378 - integrity sha512-CJIS/4HW+x6xqONDZaUljQgMqaaZQnlFjt0afdCSO6VtFk5Fd/ocW+Tc4UulQ6zcCNiL6Y8HJR8sl/EIWHgPDw== 3379 3379 3380 3380 "@humanfs/core@^0.19.1": 3381 3381 version "0.19.1"