player switch logic fix ios

This commit is contained in:
tapframe 2025-09-18 16:26:43 +05:30
parent abfccd0e36
commit 6070ed1dce
4 changed files with 101 additions and 106 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
@ -61,10 +61,6 @@
<string>This app does not require microphone access.</string>
<key>RCTRootViewBackgroundColor</key>
<integer>4278322180</integer>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
<key>UIFileSharingEnabled</key>
<true/>
<key>UILaunchStoryboardName</key>
@ -95,5 +91,5 @@
<string>Dark</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</dict>
</plist>

View file

@ -1,10 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.associated-domains</key>
<array/>
</dict>
<dict/>
</plist>

View file

@ -2586,6 +2586,8 @@ const AndroidVideoPlayer: React.FC = () => {
imdbId,
backdrop,
availableStreams,
// Ensure KSPlayer is chosen even if URL/headers do not reveal MKV
forceVlc: true,
});
}, 50);
return;

View file

@ -51,13 +51,15 @@ const VideoPlayer: React.FC = () => {
// Detect if stream is MKV format
const isMkvFile = isMkvStream(uri, headers);
// Use AndroidVideoPlayer for Android devices and non-MKV files on iOS
// Use KSPlayer only for MKV files on iOS
const shouldUseAndroidPlayer = Platform.OS === 'android' || (Platform.OS === 'ios' && !isMkvFile);
// Honor forceVlc from navigation params for iOS, or fallback to MKV detection
const forceVlc = ((route.params as any)?.forceVlc === true);
// Use AndroidVideoPlayer for Android devices. On iOS, use KSPlayer when MKV or forced.
const shouldUseAndroidPlayer = Platform.OS === 'android' || (Platform.OS === 'ios' && !(isMkvFile || forceVlc));
safeDebugLog("Player selection logic", {
platform: Platform.OS,
isMkvFile,
forceVlc,
shouldUseAndroidPlayer
});