mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-11 17:45:38 +00:00
Update TrailerModal.tsx
This commit is contained in:
parent
6f8515f943
commit
83d19f466c
1 changed files with 4 additions and 9 deletions
|
|
@ -272,16 +272,11 @@ const TrailerModal: React.FC<TrailerModalProps> = memo(({
|
||||||
ref={videoRef}
|
ref={videoRef}
|
||||||
source={(() => {
|
source={(() => {
|
||||||
const lower = (trailerUrl || '').toLowerCase();
|
const lower = (trailerUrl || '').toLowerCase();
|
||||||
const looksLikeDash = /\.mpd(\b|$)/.test(lower) || /dash|manifest/.test(lower);
|
const looksLikeHls = /\.m3u8(\b|$)/.test(lower) || /hls|playlist|m3u/.test(lower);
|
||||||
const isYouTubeCdn = lower.includes('googlevideo.com') || lower.includes('youtube.com');
|
|
||||||
if (Platform.OS === 'android') {
|
if (Platform.OS === 'android') {
|
||||||
const headers = {
|
const headers = { 'User-Agent': 'Nuvio/1.0 (Android)' };
|
||||||
'User-Agent': (looksLikeDash && isYouTubeCdn)
|
if (looksLikeHls) {
|
||||||
? 'com.google.android.apps.youtube.vr.oculus/1.60.19 (Linux; U; Android 12L; eureka-user Build/SQ3A.220605.009.A1) gzip'
|
return { uri: trailerUrl, type: 'm3u8', headers } as any;
|
||||||
: 'Nuvio/1.0 (Android)',
|
|
||||||
};
|
|
||||||
if (looksLikeDash) {
|
|
||||||
return { uri: trailerUrl, type: 'mpd', headers } as any;
|
|
||||||
}
|
}
|
||||||
return { uri: trailerUrl, headers } as any;
|
return { uri: trailerUrl, headers } as any;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue