fix for low quality trailers

This commit is contained in:
chrisk325 2026-03-01 15:10:59 +05:30 committed by GitHub
parent f653aa9aa7
commit e475feae84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,5 @@
import { logger } from '../utils/logger';
import { Platform } from 'react-native';
import { YouTubeExtractor } from './youtubeExtractor';
export interface TrailerData {
@ -41,7 +42,8 @@ export class TrailerService {
}
try {
const url = await YouTubeExtractor.getBestStreamUrl(youtubeVideoId);
const platform = Platform.OS === 'android' ? 'android' : 'ios';
const url = await YouTubeExtractor.getBestStreamUrl(youtubeVideoId, platform);
if (url) {
logger.info('TrailerService', `On-device extraction succeeded for ${youtubeVideoId}`);
this.setCache(youtubeVideoId, url);