Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Video] Remove expo-video, use bluesky-video #5282

Merged
merged 73 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
47a4e08
remove expo video, test new lib
haileyok Sep 11, 2024
5850562
rm context
haileyok Sep 11, 2024
68eb6d6
blegh
haileyok Sep 12, 2024
5c325c4
working mutes and timestamps
haileyok Sep 12, 2024
3539375
tweaks
haileyok Sep 12, 2024
309bbfc
bump
haileyok Sep 12, 2024
cec5c47
bump
haileyok Sep 12, 2024
82508df
bump
haileyok Sep 12, 2024
298748c
npm pack
haileyok Sep 12, 2024
ca28d51
fix imports
haileyok Sep 12, 2024
00f2dc5
fix loading states
haileyok Sep 12, 2024
e63814e
wooo!
haileyok Sep 12, 2024
2b06574
Merge remote-tracking branch 'origin/main' into hailey/drop-expo-video
haileyok Sep 12, 2024
4b21701
onre more bump
haileyok Sep 12, 2024
f895b3b
bumps
haileyok Sep 12, 2024
f247129
play/pause button when autoplay disabled
mozzius Sep 12, 2024
485c778
tweaks
haileyok Sep 12, 2024
bea5fb2
add forward ref
haileyok Sep 13, 2024
020892c
bump
haileyok Sep 13, 2024
d6b14fd
no autoloading
haileyok Sep 13, 2024
4cd428b
bump
haileyok Sep 13, 2024
93b36c2
bump
haileyok Sep 13, 2024
872caf3
make play icon smaller
haileyok Sep 13, 2024
211f699
remove bg from spinner
haileyok Sep 13, 2024
ccf282f
final bumps
haileyok Sep 13, 2024
8b7a578
Merge remote-tracking branch 'origin/main' into hailey/drop-expo-video
haileyok Sep 13, 2024
52c0918
bump
haileyok Sep 13, 2024
3931da6
bump
haileyok Sep 13, 2024
2315c86
dont show overlay when paused and still active
haileyok Sep 13, 2024
315ff7c
dont show overlay when paused and still active
haileyok Sep 13, 2024
13db5eb
fix preview
haileyok Sep 13, 2024
78bf759
fix preview
haileyok Sep 13, 2024
29cc75e
add accessibility back
haileyok Sep 13, 2024
f81a5b0
bump to release
haileyok Sep 13, 2024
c55fb33
Merge remote-tracking branch 'origin/main' into hailey/drop-expo-video
haileyok Sep 13, 2024
6c3f723
rm audio switch on launch
haileyok Sep 13, 2024
fe94fbe
move import up
haileyok Sep 13, 2024
e5b8aec
remove expo video, test new lib
haileyok Sep 11, 2024
c00693b
rm context
haileyok Sep 11, 2024
2c5470e
blegh
haileyok Sep 12, 2024
6d7c59e
working mutes and timestamps
haileyok Sep 12, 2024
1022248
tweaks
haileyok Sep 12, 2024
e9aad11
bump
haileyok Sep 12, 2024
b613b07
bump
haileyok Sep 12, 2024
0f44798
bump
haileyok Sep 12, 2024
7c47ff2
npm pack
haileyok Sep 12, 2024
436bc07
fix imports
haileyok Sep 12, 2024
afcb4da
fix loading states
haileyok Sep 12, 2024
88ba15f
wooo!
haileyok Sep 12, 2024
fd17c7b
onre more bump
haileyok Sep 12, 2024
0d26b69
bumps
haileyok Sep 12, 2024
5e1c9d3
play/pause button when autoplay disabled
mozzius Sep 12, 2024
7d3b891
tweaks
haileyok Sep 12, 2024
ac68b58
add forward ref
haileyok Sep 13, 2024
f3f0474
bump
haileyok Sep 13, 2024
c59201c
no autoloading
haileyok Sep 13, 2024
23f1527
bump
haileyok Sep 13, 2024
c8c0b2d
bump
haileyok Sep 13, 2024
52b6f63
make play icon smaller
haileyok Sep 13, 2024
c03327d
remove bg from spinner
haileyok Sep 13, 2024
93627e9
final bumps
haileyok Sep 13, 2024
a6b023e
bump
haileyok Sep 13, 2024
cf214cc
bump
haileyok Sep 13, 2024
7455616
dont show overlay when paused and still active
haileyok Sep 13, 2024
7293cf1
dont show overlay when paused and still active
haileyok Sep 13, 2024
29ff0fa
fix preview
haileyok Sep 13, 2024
86e96fb
fix preview
haileyok Sep 13, 2024
b093f6f
add accessibility back
haileyok Sep 13, 2024
535c240
bump to release
haileyok Sep 13, 2024
ac8694c
rm audio switch on launch
haileyok Sep 13, 2024
ae4644d
move import up
haileyok Sep 13, 2024
8118ac9
Merge branch 'hailey/drop-expo-video' of github.com:bluesky-social/so…
haileyok Sep 13, 2024
eb8768a
tweaks
haileyok Sep 13, 2024
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
1 change: 0 additions & 1 deletion app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ module.exports = function (config) {
sounds: PLATFORM === 'ios' ? ['assets/dm.aiff'] : ['assets/dm.mp3'],
},
],
'expo-video',
'react-native-compressor',
'./plugins/starterPackAppClipExtension/withStarterPackAppClip.js',
'./plugins/withAndroidManifestPlugin.js',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bsky.app",
"version": "1.91.0",
"version": "1.91.1",
"private": true,
"engines": {
"node": ">=18"
Expand Down Expand Up @@ -68,6 +68,7 @@
"@fortawesome/free-regular-svg-icons": "^6.1.1",
"@fortawesome/free-solid-svg-icons": "^6.1.1",
"@fortawesome/react-native-fontawesome": "^0.3.2",
"@haileyok/bluesky-video": "0.1.2",
"@lingui/react": "^4.5.0",
"@mattermost/react-native-paste-input": "^0.7.1",
"@miblanchard/react-native-slider": "^2.3.1",
Expand Down Expand Up @@ -139,7 +140,6 @@
"expo-system-ui": "~3.0.4",
"expo-task-manager": "~11.8.1",
"expo-updates": "~0.25.14",
"expo-video": "https://github.com/bluesky-social/expo/raw/expo-video-1.2.4-patch/packages/expo-video/expo-video-v1.2.4-2.tgz",
"expo-web-browser": "~13.0.3",
"fast-text-encoding": "^1.0.6",
"history": "^5.3.0",
Expand Down
79 changes: 36 additions & 43 deletions src/App.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import {Provider as SelectedFeedProvider} from '#/state/shell/selected-feed'
import {Provider as StarterPackProvider} from '#/state/shell/starter-pack'
import {Provider as HiddenRepliesProvider} from '#/state/threadgate-hidden-replies'
import {TestCtrls} from '#/view/com/testing/TestCtrls'
import {Provider as ActiveVideoProvider} from '#/view/com/util/post-embeds/ActiveVideoNativeContext'
import * as Toast from '#/view/com/util/Toast'
import {Shell} from '#/view/shell'
import {ThemeProvider as Alf} from '#/alf'
Expand All @@ -63,7 +62,6 @@ import {Provider as IntentDialogProvider} from '#/components/intents/IntentDialo
import {Provider as PortalProvider} from '#/components/Portal'
import {Splash} from '#/Splash'
import {BackgroundNotificationPreferencesProvider} from '../modules/expo-background-notification-handler/src/BackgroundNotificationHandlerProvider'
import {AudioCategory, PlatformInfo} from '../modules/expo-bluesky-swiss-army'

SplashScreen.preventAutoHideAsync()

Expand Down Expand Up @@ -110,45 +108,42 @@ function InnerApp() {
<Alf theme={theme}>
<ThemeProvider theme={theme}>
<Splash isReady={isReady && hasCheckedReferrer}>
<ActiveVideoProvider>
<RootSiblingParent>
<React.Fragment
// Resets the entire tree below when it changes:
key={currentAccount?.did}>
<QueryProvider currentDid={currentAccount?.did}>
<StatsigProvider>
<MessagesProvider>
{/* LabelDefsProvider MUST come before ModerationOptsProvider */}
<LabelDefsProvider>
<ModerationOptsProvider>
<LoggedOutViewProvider>
<SelectedFeedProvider>
<HiddenRepliesProvider>
<UnreadNotifsProvider>
<BackgroundNotificationPreferencesProvider>
<MutedThreadsProvider>
<ProgressGuideProvider>
<GestureHandlerRootView
style={s.h100pct}>
<TestCtrls />
<Shell />
<NuxDialogs />
</GestureHandlerRootView>
</ProgressGuideProvider>
</MutedThreadsProvider>
</BackgroundNotificationPreferencesProvider>
</UnreadNotifsProvider>
</HiddenRepliesProvider>
</SelectedFeedProvider>
</LoggedOutViewProvider>
</ModerationOptsProvider>
</LabelDefsProvider>
</MessagesProvider>
</StatsigProvider>
</QueryProvider>
</React.Fragment>
</RootSiblingParent>
</ActiveVideoProvider>
<RootSiblingParent>
<React.Fragment
// Resets the entire tree below when it changes:
key={currentAccount?.did}>
<QueryProvider currentDid={currentAccount?.did}>
<StatsigProvider>
<MessagesProvider>
{/* LabelDefsProvider MUST come before ModerationOptsProvider */}
<LabelDefsProvider>
<ModerationOptsProvider>
<LoggedOutViewProvider>
<SelectedFeedProvider>
<HiddenRepliesProvider>
<UnreadNotifsProvider>
<BackgroundNotificationPreferencesProvider>
<MutedThreadsProvider>
<ProgressGuideProvider>
<GestureHandlerRootView style={s.h100pct}>
<TestCtrls />
<Shell />
<NuxDialogs />
</GestureHandlerRootView>
</ProgressGuideProvider>
</MutedThreadsProvider>
</BackgroundNotificationPreferencesProvider>
</UnreadNotifsProvider>
</HiddenRepliesProvider>
</SelectedFeedProvider>
</LoggedOutViewProvider>
</ModerationOptsProvider>
</LabelDefsProvider>
</MessagesProvider>
</StatsigProvider>
</QueryProvider>
</React.Fragment>
</RootSiblingParent>
</Splash>
</ThemeProvider>
</Alf>
Expand All @@ -159,8 +154,6 @@ function App() {
const [isReady, setReady] = useState(false)

React.useEffect(() => {
PlatformInfo.setAudioCategory(AudioCategory.Ambient)
PlatformInfo.setAudioActive(false)
initPersistedState().then(() => setReady(true))
}, [])

Expand Down
2 changes: 1 addition & 1 deletion src/components/video/PlayButtonIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {View} from 'react-native'
import {atoms as a, useTheme} from '#/alf'
import {Play_Filled_Corner0_Rounded as PlayIcon} from '#/components/icons/Play'

export function PlayButtonIcon({size = 36}: {size?: number}) {
export function PlayButtonIcon({size = 32}: {size?: number}) {
const t = useTheme()
const bg = t.name === 'light' ? t.palette.contrast_25 : t.palette.contrast_975
const fg = t.name === 'light' ? t.palette.contrast_975 : t.palette.contrast_25
Expand Down
24 changes: 8 additions & 16 deletions src/view/com/composer/videos/VideoPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/no-shadow */
import React from 'react'
import {View} from 'react-native'
import {ImagePickerAsset} from 'expo-image-picker'
import {useVideoPlayer, VideoView} from 'expo-video'
import {BlueskyVideoView} from '@haileyok/bluesky-video'

import {CompressedVideo} from '#/lib/media/video/types'
import {clamp} from '#/lib/numbers'
Expand All @@ -22,15 +21,8 @@ export function VideoPreview({
clear: () => void
}) {
const t = useTheme()
const playerRef = React.useRef<BlueskyVideoView>(null)
const autoplayDisabled = useAutoplayDisabled()
const player = useVideoPlayer(video.uri, player => {
player.loop = true
player.muted = true
if (!autoplayDisabled) {
player.play()
}
})

let aspectRatio = asset.width / asset.height

if (isNaN(aspectRatio)) {
Expand All @@ -50,12 +42,12 @@ export function VideoPreview({
t.atoms.border_contrast_low,
{backgroundColor: 'black'},
]}>
<VideoView
player={player}
style={a.flex_1}
allowsPictureInPicture={false}
nativeControls={false}
contentFit="contain"
<BlueskyVideoView
url={video.uri}
autoplay={autoplayDisabled}
beginMuted={true}
forceTakeover={true}
ref={playerRef}
/>
<ExternalEmbedRemoveBtn onRemove={clear} />
{autoplayDisabled && (
Expand Down
8 changes: 4 additions & 4 deletions src/view/com/util/List.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React, {memo} from 'react'
import {FlatListProps, RefreshControl, ViewToken} from 'react-native'
import {runOnJS, useSharedValue} from 'react-native-reanimated'
import {updateActiveVideoViewAsync} from '@haileyok/bluesky-video'

import {useAnimatedScrollHandler} from '#/lib/hooks/useAnimatedScrollHandler_FIXED'
import {usePalette} from '#/lib/hooks/usePalette'
import {useScrollHandlers} from '#/lib/ScrollContext'
import {useDedupe} from 'lib/hooks/useDedupe'
import {addStyle} from 'lib/styles'
import {isIOS} from 'platform/detection'
import {updateActiveViewAsync} from '../../../../modules/expo-bluesky-swiss-army/src/VisibilityView'
import {FlatList_INTERNAL} from './Views'

export type ListMethods = FlatList_INTERNAL
Expand Down Expand Up @@ -69,7 +69,7 @@ function ListImpl<ItemT>(
onBeginDragFromContext?.(e, ctx)
},
onEndDrag(e, ctx) {
runOnJS(updateActiveViewAsync)()
runOnJS(updateActiveVideoViewAsync)()
onEndDragFromContext?.(e, ctx)
},
onScroll(e, ctx) {
Expand All @@ -84,13 +84,13 @@ function ListImpl<ItemT>(
}

if (isIOS) {
runOnJS(dedupe)(updateActiveViewAsync)
runOnJS(dedupe)(updateActiveVideoViewAsync)
}
},
// Note: adding onMomentumBegin here makes simulator scroll
// lag on Android. So either don't add it, or figure out why.
onMomentumEnd(e, ctx) {
runOnJS(updateActiveViewAsync)()
runOnJS(updateActiveVideoViewAsync)()
onMomentumEndFromContext?.(e, ctx)
},
})
Expand Down
65 changes: 0 additions & 65 deletions src/view/com/util/post-embeds/ActiveVideoNativeContext.tsx

This file was deleted.

Loading
Loading