mirror of
https://gh-proxy.org/https://github.com/tiajinsha/JKVideo
synced 2026-07-07 23:18:38 +08:00
1
This commit is contained in:
@@ -146,6 +146,8 @@ export function BigVideoCard({ item, isVisible, onPress }: Props) {
|
||||
PanResponder.create({
|
||||
onMoveShouldSetPanResponder: (_, gs) =>
|
||||
Math.abs(gs.dx) > SWIPE_THRESHOLD && Math.abs(gs.dx) > Math.abs(gs.dy),
|
||||
onMoveShouldSetPanResponderCapture: (_, gs) =>
|
||||
Math.abs(gs.dx) > SWIPE_THRESHOLD && Math.abs(gs.dx) > Math.abs(gs.dy),
|
||||
onPanResponderGrant: () => {
|
||||
seekingRef.current = true;
|
||||
swipeStartTime.current = currentTimeRef.current;
|
||||
@@ -255,23 +257,25 @@ export function BigVideoCard({ item, isVisible, onPress }: Props) {
|
||||
)}
|
||||
</View>
|
||||
|
||||
{/* Progress bar between video and info */}
|
||||
{videoUrl && duration > 0 && (
|
||||
<View style={styles.progressTrack}>
|
||||
<View
|
||||
style={[
|
||||
styles.progressLayer,
|
||||
{ width: `${bufferedRatio * 100}%` as any, backgroundColor: "rgba(0,174,236,0.25)" },
|
||||
]}
|
||||
/>
|
||||
<View
|
||||
style={[
|
||||
styles.progressLayer,
|
||||
{ width: `${progressRatio * 100}%` as any, backgroundColor: "#00AEEC" },
|
||||
]}
|
||||
/>
|
||||
</View>
|
||||
)}
|
||||
{/* Progress bar between video and info — always rendered to avoid height jump */}
|
||||
<View style={styles.progressTrack}>
|
||||
{videoUrl && duration > 0 && (
|
||||
<>
|
||||
<View
|
||||
style={[
|
||||
styles.progressLayer,
|
||||
{ width: `${bufferedRatio * 100}%` as any, backgroundColor: "rgba(0,174,236,0.25)" },
|
||||
]}
|
||||
/>
|
||||
<View
|
||||
style={[
|
||||
styles.progressLayer,
|
||||
{ width: `${progressRatio * 100}%` as any, backgroundColor: "#00AEEC" },
|
||||
]}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</View>
|
||||
|
||||
{/* Info */}
|
||||
<View style={styles.info}>
|
||||
|
||||
@@ -18,24 +18,35 @@ const CARD_WIDTH = (width - 14) / 2;
|
||||
|
||||
interface Props {
|
||||
item: LiveRoom;
|
||||
isLivePulse?: Boolean;
|
||||
onPress?: () => void;
|
||||
fullWidth?: boolean;
|
||||
}
|
||||
|
||||
export function LiveCard({ item, onPress }: Props) {
|
||||
export function LiveCard({
|
||||
item,
|
||||
onPress,
|
||||
fullWidth,
|
||||
isLivePulse = false,
|
||||
}: Props) {
|
||||
const cardWidth = fullWidth ? width - 8 : CARD_WIDTH;
|
||||
return (
|
||||
<TouchableOpacity
|
||||
style={styles.card}
|
||||
style={[styles.card, { width: cardWidth }]}
|
||||
onPress={onPress}
|
||||
activeOpacity={0.85}
|
||||
>
|
||||
<View style={styles.thumbContainer}>
|
||||
<Image
|
||||
source={{ uri: proxyImageUrl(item.cover) }}
|
||||
style={styles.thumb}
|
||||
style={[
|
||||
styles.thumb,
|
||||
{ width: cardWidth, height: cardWidth * 0.5625 },
|
||||
]}
|
||||
resizeMode="cover"
|
||||
/>
|
||||
<View style={styles.liveBadge}>
|
||||
<LivePulse />
|
||||
{isLivePulse && <LivePulse />}
|
||||
<Text style={styles.liveBadgeText}>直播中</Text>
|
||||
</View>
|
||||
<View style={styles.meta}>
|
||||
|
||||
Reference in New Issue
Block a user