Skip to content

Commit accc2ca

Browse files
committed
refactor: remove proxy URL handling from video player and HLS hook
1 parent 39523e3 commit accc2ca

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

components/player/MobileVideoPlayer.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { useMobileGestures } from './hooks/useMobileGestures';
99
import { MobileControlsWrapper } from './mobile/MobileControlsWrapper';
1010
import { MobileOverlay } from './mobile/MobileOverlay';
1111
import { MobileSkipIndicator } from './mobile/MobileSkipIndicator';
12-
import { getProxyUrl } from './utils/urlUtils';
1312

1413
interface MobileVideoPlayerProps {
1514
src: string;
@@ -88,8 +87,6 @@ export function MobileVideoPlayer({
8887
togglePlay,
8988
});
9089

91-
const proxiedSrc = getProxyUrl(src);
92-
9390
return (
9491
<div
9592
ref={containerRef}
@@ -99,7 +96,7 @@ export function MobileVideoPlayer({
9996
<video
10097
ref={videoRef}
10198
className="w-full h-full object-contain touch-none"
102-
src={proxiedSrc}
99+
src={src}
103100
poster={poster}
104101
onPlay={handlePlay}
105102
onPause={handlePause}

components/player/hooks/useHlsPlayer.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { useEffect, useRef } from 'react';
22
import Hls from 'hls.js';
3-
import { getProxyUrl } from '../utils/urlUtils';
43

54
interface UseHlsPlayerProps {
65
videoRef: React.RefObject<HTMLVideoElement | null>;
@@ -28,7 +27,6 @@ export function useHlsPlayer({
2827
}
2928

3029
let hls: Hls | null = null;
31-
const proxiedSrc = getProxyUrl(src);
3230

3331
// Check if HLS is supported natively (Safari, Mobile Chrome)
3432
// We prefer native playback if available as it's usually more battery efficient
@@ -51,7 +49,7 @@ export function useHlsPlayer({
5149
});
5250
hlsRef.current = hls;
5351

54-
hls.loadSource(proxiedSrc);
52+
hls.loadSource(src);
5553
hls.attachMedia(video);
5654

5755
hls.on(Hls.Events.MANIFEST_PARSED, () => {
@@ -119,12 +117,12 @@ export function useHlsPlayer({
119117
} else {
120118
console.log('[HLS] Using native HLS support');
121119
// Native HLS support
122-
video.src = proxiedSrc;
120+
video.src = src;
123121
}
124122
} else if (isNativeHlsSupported) {
125123
// Fallback for environments where Hls.js is not supported but native is (e.g. iOS without MSE?)
126124
console.log('[HLS] Using native HLS support (Hls.js not supported)');
127-
video.src = proxiedSrc;
125+
video.src = src;
128126
} else {
129127
console.error('[HLS] HLS not supported in this browser');
130128
}

0 commit comments

Comments
 (0)