mirror of
https://gh-proxy.org/https://github.com/tiajinsha/JKVideo
synced 2026-07-08 07:28:37 +08:00
视频清晰度
This commit is contained in:
@@ -13,9 +13,11 @@ interface Props {
|
||||
currentQn: number;
|
||||
onQualityChange: (qn: number) => void;
|
||||
onMiniPlayer?: () => void;
|
||||
onProgress?: (currentTime: number, duration: number) => void;
|
||||
seekTo?: { t: number; v: number };
|
||||
}
|
||||
|
||||
export function VideoPlayer({ playData, qualities, currentQn, onQualityChange, onMiniPlayer }: Props) {
|
||||
export function VideoPlayer({ playData, qualities, currentQn, onQualityChange, onMiniPlayer, onProgress, seekTo }: Props) {
|
||||
const [fullscreen, setFullscreen] = useState(false);
|
||||
|
||||
if (!playData) {
|
||||
@@ -49,6 +51,8 @@ export function VideoPlayer({ playData, qualities, currentQn, onQualityChange, o
|
||||
onQualityChange={onQualityChange}
|
||||
onFullscreen={() => setFullscreen(true)}
|
||||
onMiniPlayer={onMiniPlayer}
|
||||
onProgress={onProgress}
|
||||
seekTo={seekTo}
|
||||
/>
|
||||
|
||||
<Modal visible={fullscreen} animationType="fade" statusBarTranslucent>
|
||||
@@ -61,6 +65,8 @@ export function VideoPlayer({ playData, qualities, currentQn, onQualityChange, o
|
||||
onQualityChange={onQualityChange}
|
||||
onFullscreen={() => setFullscreen(false)}
|
||||
style={{ width: '100%', height: '100%' } as any}
|
||||
onProgress={onProgress}
|
||||
seekTo={seekTo}
|
||||
/>
|
||||
<TouchableOpacity style={styles.closeBtn} onPress={() => setFullscreen(false)}>
|
||||
<Ionicons name="close" size={28} color="#fff" />
|
||||
|
||||
Reference in New Issue
Block a user