diff --git a/ios/Nuvio.xcodeproj/project.pbxproj b/ios/Nuvio.xcodeproj/project.pbxproj index baaf2b7..7c31ca7 100644 --- a/ios/Nuvio.xcodeproj/project.pbxproj +++ b/ios/Nuvio.xcodeproj/project.pbxproj @@ -271,12 +271,10 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Nuvio/Pods-Nuvio-frameworks.sh", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/MobileVLCKit/MobileVLCKit.framework/MobileVLCKit", "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MobileVLCKit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework", ); runOnlyForDeploymentPostprocessing = 0; @@ -527,7 +525,10 @@ LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\""; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "$(inherited) "; + OTHER_LDFLAGS = ( + "$(inherited)", + " ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; @@ -582,7 +583,10 @@ ); LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\""; MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = "$(inherited) "; + OTHER_LDFLAGS = ( + "$(inherited)", + " ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; diff --git a/ios/Nuvio.xcodeproj/xcshareddata/xcschemes/Nuvio.xcscheme b/ios/Nuvio.xcodeproj/xcshareddata/xcschemes/Nuvio.xcscheme index a2c0c55..40d32da 100644 --- a/ios/Nuvio.xcodeproj/xcshareddata/xcschemes/Nuvio.xcscheme +++ b/ios/Nuvio.xcodeproj/xcshareddata/xcschemes/Nuvio.xcscheme @@ -82,7 +82,7 @@ buildConfiguration = "Debug"> diff --git a/ios/Nuvio/KSPlayerView.swift b/ios/Nuvio/KSPlayerView.swift index abad75d..744b0a2 100644 --- a/ios/Nuvio/KSPlayerView.swift +++ b/ios/Nuvio/KSPlayerView.swift @@ -493,3 +493,4 @@ extension KSPlayerView { return nil } } + diff --git a/ios/Nuvio/Nuvio.entitlements b/ios/Nuvio/Nuvio.entitlements index a0bc443..0c67376 100644 --- a/ios/Nuvio/Nuvio.entitlements +++ b/ios/Nuvio/Nuvio.entitlements @@ -1,10 +1,5 @@ - - aps-environment - development - com.apple.developer.associated-domains - - - \ No newline at end of file + + diff --git a/ios/Podfile.lock b/ios/Podfile.lock index aa01f07..7c324c4 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -404,7 +404,6 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - MobileVLCKit (3.5.1) - RCT-Folly (2024.10.14.00): - boost - DoubleConversion @@ -1885,10 +1884,6 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - react-native-vlc-media-player (1.0.38): - - MobileVLCKit (= 3.5.1) - - React - - TVVLCKit (= 3.5.1) - React-nativeconfig (0.76.9) - React-NativeModulesApple (0.76.9): - glog @@ -2518,7 +2513,6 @@ DEPENDENCIES: - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) - "react-native-slider (from `../node_modules/@react-native-community/slider`)" - react-native-video (from `../node_modules/react-native-video`) - - react-native-vlc-media-player (from `../node_modules/react-native-vlc-media-player`) - React-nativeconfig (from `../node_modules/react-native/ReactCommon`) - React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`) - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) @@ -2560,7 +2554,6 @@ SPEC REPOS: - libavif - libdav1d - lottie-ios - - MobileVLCKit - ReachabilitySwift - SDWebImage - SDWebImageAVIFCoder @@ -2736,8 +2729,6 @@ EXTERNAL SOURCES: :path: "../node_modules/@react-native-community/slider" react-native-video: :path: "../node_modules/react-native-video" - react-native-vlc-media-player: - :path: "../node_modules/react-native-vlc-media-player" React-nativeconfig: :path: "../node_modules/react-native/ReactCommon" React-NativeModulesApple: @@ -2872,7 +2863,6 @@ SPEC CHECKSUMS: libdav1d: 23581a4d8ec811ff171ed5e2e05cd27bad64c39f lottie-ios: a881093fab623c467d3bce374367755c272bdd59 lottie-react-native: 4ba06e2e4985c53dda6595a880f780e7ff551df1 - MobileVLCKit: 144d5f565512d1147d63b0fa1379231b3fd66535 RCT-Folly: ea9d9256ba7f9322ef911169a9f696e5857b9e17 RCTDeprecation: ebe712bb05077934b16c6bf25228bdec34b64f83 RCTRequired: ca91e5dd26b64f577b528044c962baf171c6b716 @@ -2910,7 +2900,6 @@ SPEC CHECKSUMS: react-native-safe-area-context: cd916088cac5300c3266876218377518987b995e react-native-slider: d8c35cc0162af73c9448f4b18c34d09e841cc1ab react-native-video: bc6104529a6fde35127a1625b30d557412fdb70d - react-native-vlc-media-player: da3308dda896d4ff7abfacadb8f981752bf9b425 React-nativeconfig: 8efdb1ef1e9158c77098a93085438f7e7b463678 React-NativeModulesApple: cebca2e5320a3d66e123cade23bd90a167ffce5e React-perflogger: 72e653eb3aba9122f9e57cf012d22d2486f33358 diff --git a/src/components/player/VideoPlayer.tsx b/src/components/player/VideoPlayer.tsx index 61097ed..e033b13 100644 --- a/src/components/player/VideoPlayer.tsx +++ b/src/components/player/VideoPlayer.tsx @@ -67,6 +67,9 @@ const VideoPlayer: React.FC = () => { const navigation = useNavigation(); + // KSPlayer is active only on iOS when using MKV (shouldUseAndroidPlayer is false) + const isKsPlayerActive = Platform.OS === 'ios' && !shouldUseAndroidPlayer; + const { title = 'Episode Name', season, @@ -3178,6 +3181,7 @@ const VideoPlayer: React.FC = () => { ksTextTracks={ksTextTracks} selectedTextTrack={selectedTextTrack} useCustomSubtitles={useCustomSubtitles} + isKsPlayerActive={isKsPlayerActive} subtitleSize={subtitleSize} subtitleBackground={subtitleBackground} fetchAvailableSubtitles={fetchAvailableSubtitles} diff --git a/src/components/player/modals/SubtitleModals.tsx b/src/components/player/modals/SubtitleModals.tsx index 4db0a10..b23a87e 100644 --- a/src/components/player/modals/SubtitleModals.tsx +++ b/src/components/player/modals/SubtitleModals.tsx @@ -24,6 +24,8 @@ interface SubtitleModalsProps { ksTextTracks: Array<{id: number, name: string, language?: string}>; selectedTextTrack: number; useCustomSubtitles: boolean; + // When true, KSPlayer is active (iOS MKV path). Use to gate iOS-only limitations. + isKsPlayerActive?: boolean; subtitleSize: number; subtitleBackground: boolean; fetchAvailableSubtitles: () => void; @@ -71,6 +73,7 @@ export const SubtitleModals: React.FC = ({ ksTextTracks, selectedTextTrack, useCustomSubtitles, + isKsPlayerActive, subtitleSize, subtitleBackground, fetchAvailableSubtitles, @@ -284,47 +287,82 @@ export const SubtitleModals: React.FC = ({ }}> Built-in Subtitles + + {/* Notice about built-in subtitle limitations - only when KSPlayer active on iOS */} + {isIos && isKsPlayerActive && ( + + + + + + Built-in subtitles temporarily disabled + + + Due to some React Native limitations with KSPlayer, built-in subtitle rendering is temporarily disabled. Please use external subtitles instead for the best experience. + + + + + )} - - {ksTextTracks.map((track) => { - const isSelected = selectedTextTrack === track.id && !useCustomSubtitles; - // Debug logging for subtitle selection - if (__DEV__ && ksTextTracks.length > 0) { - console.log('[SubtitleModals] Track:', track.id, track.name, 'Selected:', selectedTextTrack, 'isSelected:', isSelected, 'useCustom:', useCustomSubtitles); - } - return ( - { - selectTextTrack(track.id); - setSelectedOnlineSubtitleId(null); - }} - activeOpacity={0.7} - > - - - {getTrackDisplayName(track)} - - {isSelected && ( - - )} - - - ); - })} - + {(!isIos || (isIos && !isKsPlayerActive)) && ( + + {ksTextTracks.map((track) => { + const isSelected = selectedTextTrack === track.id && !useCustomSubtitles; + // Debug logging for subtitle selection + if (__DEV__ && ksTextTracks.length > 0) { + console.log('[SubtitleModals] Track:', track.id, track.name, 'Selected:', selectedTextTrack, 'isSelected:', isSelected, 'useCustom:', useCustomSubtitles); + } + return ( + { + selectTextTrack(track.id); + setSelectedOnlineSubtitleId(null); + }} + activeOpacity={0.7} + > + + + {getTrackDisplayName(track)} + + {isSelected && ( + + )} + + + ); + })} + + )} )} diff --git a/src/utils/mkvDetection.ts b/src/utils/mkvDetection.ts index 11e6bb9..69fae40 100644 --- a/src/utils/mkvDetection.ts +++ b/src/utils/mkvDetection.ts @@ -155,15 +155,5 @@ export const detectMkvComprehensive = async ( export const isMkvStream = (streamUri: string, streamHeaders?: Record): boolean => { const result = detectMkvStream(streamUri, streamHeaders); - // Debug logging in development - if (__DEV__ && streamUri) { - console.log('[MKV Detection]', { - uri: streamUri.substring(0, 100) + (streamUri.length > 100 ? '...' : ''), - isMkv: result.isMkv, - method: result.method, - confidence: result.confidence - }); - } - return result.isMkv; };