Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

[Video] Bundle of minor tweaks (#4904)

* fix bg color

* unique video urls for debug

* improve controls slightly

* mute until fullscreen

---------

Co-authored-by: Samuel Newman <10959775+mozzius@users.noreply.github.com>

authored by

Samuel Newman
Samuel Newman
and committed by
GitHub
4350dbc8 e782db33

+45 -31
+15 -5
src/view/com/posts/FeedItem.tsx
··· 1 - import React, {memo, useMemo, useState} from 'react' 1 + import React, {memo, useId, useMemo, useState} from 'react' 2 2 import {StyleSheet, View} from 'react-native' 3 3 import { 4 4 AppBskyActorDefs, ··· 137 137 const {openComposer} = useComposerControls() 138 138 const pal = usePalette('default') 139 139 const {_} = useLingui() 140 - const gate = useGate() 141 140 142 141 const href = useMemo(() => { 143 142 const urip = new AtUri(post.uri) ··· 356 355 postAuthor={post.author} 357 356 onOpenEmbed={onOpenEmbed} 358 357 /> 359 - {gate('video_debug') && ( 360 - <VideoEmbed source="https://lumi.jazco.dev/watch/did:plc:q6gjnaw2blty4crticxkmujt/Qmc8w93UpTa2adJHg4ZhnDPrBs1EsbzrekzPcqF5SwusuZ/playlist.m3u8" /> 361 - )} 358 + <VideoDebug /> 362 359 <PostCtrls 363 360 post={post} 364 361 record={record} ··· 498 495 {label} 499 496 </Text> 500 497 </View> 498 + ) 499 + } 500 + 501 + function VideoDebug() { 502 + const gate = useGate() 503 + const id = useId() 504 + 505 + if (!gate('video_debug')) return null 506 + 507 + return ( 508 + <VideoEmbed 509 + source={`https://lumi.jazco.dev/watch/did:plc:q6gjnaw2blty4crticxkmujt/Qmc8w93UpTa2adJHg4ZhnDPrBs1EsbzrekzPcqF5SwusuZ/playlist.m3u8?ignore_me_just_testing_frontend_stuff=${id}`} 510 + /> 501 511 ) 502 512 } 503 513
+29 -26
src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx
··· 1 1 import React, {useEffect, useRef, useState} from 'react' 2 2 import {Pressable, View} from 'react-native' 3 + import Animated, {FadeIn} from 'react-native-reanimated' 3 4 import {VideoPlayer, VideoView} from 'expo-video' 4 5 5 6 import {useVideoPlayer} from 'view/com/util/post-embeds/VideoPlayerContext' ··· 20 21 /> 21 22 <Controls 22 23 player={player} 23 - enterFullscreen={() => ref.current?.enterFullscreen()} 24 + enterFullscreen={() => { 25 + player.muted = false 26 + ref.current?.enterFullscreen() 27 + }} 24 28 /> 25 29 </View> 26 30 ) ··· 56 60 } 57 61 }, [player]) 58 62 59 - if (isNaN(timeRemaining)) { 60 - return null 61 - } 62 - 63 63 return ( 64 64 <View style={[a.absolute, a.inset_0]}> 65 - <View 66 - style={[ 67 - { 68 - backgroundColor: 'rgba(0, 0, 0, 0.75', 69 - borderRadius: 6, 70 - paddingHorizontal: 6, 71 - paddingVertical: 3, 72 - position: 'absolute', 73 - left: 5, 74 - bottom: 5, 75 - }, 76 - ]} 77 - pointerEvents="none"> 78 - <Text 65 + {!isNaN(timeRemaining) && ( 66 + <Animated.View 67 + entering={FadeIn.duration(100)} 79 68 style={[ 80 - {color: 'white', fontSize: 12}, 81 - a.font_bold, 82 - android({lineHeight: 1.25}), 83 - ]}> 84 - {minutes}:{seconds} 85 - </Text> 86 - </View> 69 + { 70 + backgroundColor: 'rgba(0, 0, 0, 0.75)', 71 + borderRadius: 6, 72 + paddingHorizontal: 6, 73 + paddingVertical: 3, 74 + position: 'absolute', 75 + left: 5, 76 + bottom: 5, 77 + }, 78 + ]} 79 + pointerEvents="none"> 80 + <Text 81 + style={[ 82 + {color: 'white', fontSize: 12}, 83 + a.font_bold, 84 + android({lineHeight: 1.25}), 85 + ]}> 86 + {minutes}:{seconds} 87 + </Text> 88 + </Animated.View> 89 + )} 87 90 <Pressable 88 91 onPress={enterFullscreen} 89 92 style={a.flex_1}
+1
src/view/com/util/post-embeds/VideoPlayerContext.tsx
··· 14 14 // eslint-disable-next-line @typescript-eslint/no-shadow 15 15 const player = useExpoVideoPlayer(source, player => { 16 16 player.loop = true 17 + player.muted = true 17 18 player.play() 18 19 }) 19 20