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,99 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CADisableMinimumFrameDurationOnPhone</key> <key>CADisableMinimumFrameDurationOnPhone</key>
<true/> <true/>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>Nuvio</string> <string>Nuvio</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string> <string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.1.0</string> <string>1.1.0</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
<array> <array>
<dict> <dict>
<key>CFBundleURLSchemes</key> <key>CFBundleURLSchemes</key>
<array> <array>
<string>stremioexpo</string> <string>stremioexpo</string>
<string>com.nuvio.app</string> <string>com.nuvio.app</string>
</array> </array>
</dict> </dict>
<dict> <dict>
<key>CFBundleURLSchemes</key> <key>CFBundleURLSchemes</key>
<array> <array>
<string>exp+nuvio</string> <string>exp+nuvio</string>
</array> </array>
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>13</string> <string>13</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>
<string>12.0</string> <string>12.0</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>LSSupportsOpeningDocumentsInPlace</key> <key>LSSupportsOpeningDocumentsInPlace</key>
<true/> <true/>
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>
<dict> <dict>
<key>NSAllowsArbitraryLoads</key> <key>NSAllowsArbitraryLoads</key>
<true/> <true/>
</dict> </dict>
<key>NSBonjourServices</key> <key>NSBonjourServices</key>
<array> <array>
<string>_http._tcp</string> <string>_http._tcp</string>
</array> </array>
<key>NSLocalNetworkUsageDescription</key> <key>NSLocalNetworkUsageDescription</key>
<string>App uses the local network to discover and connect to devices.</string> <string>App uses the local network to discover and connect to devices.</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>This app does not require microphone access.</string> <string>This app does not require microphone access.</string>
<key>RCTRootViewBackgroundColor</key> <key>RCTRootViewBackgroundColor</key>
<integer>4278322180</integer> <integer>4278322180</integer>
<key>UIBackgroundModes</key> <key>UIFileSharingEnabled</key>
<array> <true/>
<string>audio</string> <key>UILaunchStoryboardName</key>
</array> <string>SplashScreen</string>
<key>UIFileSharingEnabled</key> <key>UIRequiredDeviceCapabilities</key>
<true/> <array>
<key>UILaunchStoryboardName</key> <string>arm64</string>
<string>SplashScreen</string> </array>
<key>UIRequiredDeviceCapabilities</key> <key>UIRequiresFullScreen</key>
<array> <false/>
<string>arm64</string> <key>UIStatusBarStyle</key>
</array> <string>UIStatusBarStyleDefault</string>
<key>UIRequiresFullScreen</key> <key>UISupportedInterfaceOrientations</key>
<false/> <array>
<key>UIStatusBarStyle</key> <string>UIInterfaceOrientationPortrait</string>
<string>UIStatusBarStyleDefault</string> <string>UIInterfaceOrientationPortraitUpsideDown</string>
<key>UISupportedInterfaceOrientations</key> <string>UIInterfaceOrientationLandscapeLeft</string>
<array> <string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string> </array>
<string>UIInterfaceOrientationPortraitUpsideDown</string> <key>UISupportedInterfaceOrientations~ipad</key>
<string>UIInterfaceOrientationLandscapeLeft</string> <array>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationPortrait</string>
</array> <string>UIInterfaceOrientationPortraitUpsideDown</string>
<key>UISupportedInterfaceOrientations~ipad</key> <string>UIInterfaceOrientationLandscapeLeft</string>
<array> <string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string> </array>
<string>UIInterfaceOrientationPortraitUpsideDown</string> <key>UIUserInterfaceStyle</key>
<string>UIInterfaceOrientationLandscapeLeft</string> <string>Dark</string>
<string>UIInterfaceOrientationLandscapeRight</string> <key>UIViewControllerBasedStatusBarAppearance</key>
</array> <false/>
<key>UIUserInterfaceStyle</key> </dict>
<string>Dark</string> </plist>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>

View file

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

View file

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

View file

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