mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Use the same subdomain for connect media
Preventing count as cache miss
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import Button from '@components/Button'
|
||||
import GracefullyImage from '@components/GracefullyImage'
|
||||
import { Slider } from '@sharcoux/slider'
|
||||
import { connectMedia } from '@utils/api/helpers/connect'
|
||||
import { StyleConstants } from '@utils/styles/constants'
|
||||
import { useTheme } from '@utils/styles/ThemeManager'
|
||||
import { Audio } from 'expo-av'
|
||||
@ -26,7 +27,7 @@ const AttachmentAudio: React.FC<Props> = ({ total, index, sensitiveShown, audio
|
||||
const playAudio = useCallback(async () => {
|
||||
if (!audioPlayer) {
|
||||
const { sound } = await Audio.Sound.createAsync(
|
||||
{ uri: audio.url },
|
||||
connectMedia({ uri: audio.url }) as { uri: string },
|
||||
{},
|
||||
// @ts-ignore
|
||||
props => setAudioPosition(props.positionMillis)
|
||||
|
@ -1,5 +1,6 @@
|
||||
import Button from '@components/Button'
|
||||
import { useAccessibility } from '@utils/accessibility/AccessibilityManager'
|
||||
import { connectMedia } from '@utils/api/helpers/connect'
|
||||
import { useAccountStorage, useGlobalStorage } from '@utils/storage/actions'
|
||||
import { StyleConstants } from '@utils/styles/constants'
|
||||
import { ResizeMode, Video, VideoFullscreenUpdate } from 'expo-av'
|
||||
@ -41,7 +42,7 @@ const AttachmentVideo: React.FC<Props> = ({
|
||||
const playOnPress = async () => {
|
||||
setVideoLoading(true)
|
||||
if (!videoLoaded) {
|
||||
await videoPlayer.current?.loadAsync({ uri: video.url })
|
||||
await videoPlayer.current?.loadAsync(connectMedia({ uri: video.url }) as { uri: string })
|
||||
}
|
||||
setVideoLoading(false)
|
||||
|
||||
@ -71,10 +72,10 @@ const AttachmentVideo: React.FC<Props> = ({
|
||||
shouldPlay: reduceMotionEnabled || !shouldAutoplayGifv ? false : true,
|
||||
isMuted: true,
|
||||
isLooping: true,
|
||||
source: { uri: video.url }
|
||||
source: connectMedia({ uri: video.url }) as { uri: string }
|
||||
}
|
||||
: {
|
||||
posterSource: { uri: video.preview_url },
|
||||
posterSource: connectMedia({ uri: video.preview_url }),
|
||||
posterStyle: { resizeMode: ResizeMode.COVER }
|
||||
})}
|
||||
useNativeControls={false}
|
||||
|
Reference in New Issue
Block a user