feat(player): copy video link button
Some checks failed
Backend tests / test (push) Has been cancelled
Some checks failed
Backend tests / test (push) Has been cancelled
User request (07-10): a quick way to grab the direct video URL to share or open elsewhere. Added a link icon in the player top bar that copies the current playing URL to the clipboard (direct CDN URL for most sources, so it pastes into VLC/MX/a browser; proxy-wrapped/referer-bound sources are best-effort). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
2cfb0bc12d
commit
b62d22370b
2 changed files with 26 additions and 0 deletions
|
|
@ -16,6 +16,13 @@ export type ChangelogEntry = {
|
|||
};
|
||||
|
||||
export const CHANGELOG: ChangelogEntry[] = [
|
||||
{
|
||||
id: '2026-07-14c',
|
||||
date: 'July 2026',
|
||||
items: [
|
||||
'Copy video link: while a video is playing, tap the link icon in the top bar to copy its URL, then paste it into a browser or a player like VLC or MX Player. Works best for direct sources.',
|
||||
],
|
||||
},
|
||||
{
|
||||
id: '2026-07-14b',
|
||||
date: 'July 2026',
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { useEvent } from 'expo';
|
|||
import * as Haptics from 'expo-haptics';
|
||||
import * as ScreenOrientation from 'expo-screen-orientation';
|
||||
import { useVideoPlayer, VideoView, type VideoSource } from 'expo-video';
|
||||
import * as Clipboard from 'expo-clipboard';
|
||||
import React from 'react';
|
||||
import {
|
||||
ActivityIndicator,
|
||||
|
|
@ -188,6 +189,21 @@ function NativeVideoPlayer({ params }: { params: RouteParams }) {
|
|||
setControlsVisible(true);
|
||||
}, [player]);
|
||||
|
||||
// Kopiuj link odtwarzanego wideo (direct CDN / embed hostera) do schowka — user może
|
||||
// wrzucić do VLC/MX/przeglądarki albo udostępnić (zgłoszenie 07-10).
|
||||
const copyLink = React.useCallback(async () => {
|
||||
setControlsVisible(true);
|
||||
try {
|
||||
await Clipboard.setStringAsync(url);
|
||||
Alert.alert(
|
||||
'Link copied',
|
||||
'The video link is on your clipboard. Paste it into a browser or a player like VLC or MX Player.',
|
||||
);
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}, [url]);
|
||||
|
||||
const statusEvent = useEvent(player, 'statusChange', { status: player.status });
|
||||
const status = statusEvent?.status ?? player.status;
|
||||
const playerError = statusEvent?.error;
|
||||
|
|
@ -839,6 +855,9 @@ function NativeVideoPlayer({ params }: { params: RouteParams }) {
|
|||
) : (
|
||||
<View style={{ flex: 1 }} />
|
||||
)}
|
||||
<Pressable onPress={copyLink} hitSlop={16} style={styles.iconBtn}>
|
||||
<Text style={styles.iconText}>🔗</Text>
|
||||
</Pressable>
|
||||
<Pressable onPress={toggleMute} hitSlop={16} style={styles.iconBtn}>
|
||||
<Text style={styles.iconText}>{muted ? '🔇' : '🔊'}</Text>
|
||||
</Pressable>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue