mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-10 12:01:55 +00:00
some fix
This commit is contained in:
parent
30b148d783
commit
83c3bdbdde
5 changed files with 3468 additions and 3457 deletions
|
|
@ -55,7 +55,7 @@ const getVideoResizeMode = (resizeMode: ResizeModeType) => {
|
||||||
const AndroidVideoPlayer: React.FC = () => {
|
const AndroidVideoPlayer: React.FC = () => {
|
||||||
const navigation = useNavigation();
|
const navigation = useNavigation();
|
||||||
const insets = useSafeAreaInsets();
|
const insets = useSafeAreaInsets();
|
||||||
const route = useRoute<RouteProp<RootStackParamList, 'Player'>>();
|
const route = useRoute<RouteProp<RootStackParamList, 'PlayerAndroid'>>();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
uri,
|
uri,
|
||||||
|
|
@ -1935,7 +1935,7 @@ const AndroidVideoPlayer: React.FC = () => {
|
||||||
|
|
||||||
// Start navigation immediately but let stream fetching continue in background
|
// Start navigation immediately but let stream fetching continue in background
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
(navigation as any).replace('Player', {
|
(navigation as any).replace('PlayerAndroid', {
|
||||||
uri: bestStream.url,
|
uri: bestStream.url,
|
||||||
title: metadata?.name || '',
|
title: metadata?.name || '',
|
||||||
episodeTitle: nextEpisode.name,
|
episodeTitle: nextEpisode.name,
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
3408
src/components/player/KSPlayerCore.tsx
Normal file
3408
src/components/player/KSPlayerCore.tsx
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -23,7 +23,8 @@ import HomeScreen from '../screens/HomeScreen';
|
||||||
import LibraryScreen from '../screens/LibraryScreen';
|
import LibraryScreen from '../screens/LibraryScreen';
|
||||||
import SettingsScreen from '../screens/SettingsScreen';
|
import SettingsScreen from '../screens/SettingsScreen';
|
||||||
import MetadataScreen from '../screens/MetadataScreen';
|
import MetadataScreen from '../screens/MetadataScreen';
|
||||||
import KSPlayer from '../components/player/KSPlayer';
|
import KSPlayerCore from '../components/player/KSPlayerCore';
|
||||||
|
import AndroidVideoPlayer from '../components/player/AndroidVideoPlayer';
|
||||||
import CatalogScreen from '../screens/CatalogScreen';
|
import CatalogScreen from '../screens/CatalogScreen';
|
||||||
import AddonsScreen from '../screens/AddonsScreen';
|
import AddonsScreen from '../screens/AddonsScreen';
|
||||||
import SearchScreen from '../screens/SearchScreen';
|
import SearchScreen from '../screens/SearchScreen';
|
||||||
|
|
@ -74,14 +75,7 @@ export type RootStackParamList = {
|
||||||
episodeThumbnail?: string;
|
episodeThumbnail?: string;
|
||||||
fromPlayer?: boolean;
|
fromPlayer?: boolean;
|
||||||
};
|
};
|
||||||
KSPlayer: {
|
PlayerIOS: {
|
||||||
id: string;
|
|
||||||
type: string;
|
|
||||||
stream: Stream;
|
|
||||||
episodeId?: string;
|
|
||||||
backdrop?: string;
|
|
||||||
};
|
|
||||||
Player: {
|
|
||||||
uri: string;
|
uri: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
season?: number;
|
season?: number;
|
||||||
|
|
@ -99,6 +93,27 @@ export type RootStackParamList = {
|
||||||
imdbId?: string;
|
imdbId?: string;
|
||||||
availableStreams?: { [providerId: string]: { streams: any[]; addonName: string } };
|
availableStreams?: { [providerId: string]: { streams: any[]; addonName: string } };
|
||||||
backdrop?: string;
|
backdrop?: string;
|
||||||
|
videoType?: string;
|
||||||
|
};
|
||||||
|
PlayerAndroid: {
|
||||||
|
uri: string;
|
||||||
|
title?: string;
|
||||||
|
season?: number;
|
||||||
|
episode?: number;
|
||||||
|
episodeTitle?: string;
|
||||||
|
quality?: string;
|
||||||
|
year?: number;
|
||||||
|
streamProvider?: string;
|
||||||
|
streamName?: string;
|
||||||
|
headers?: { [key: string]: string };
|
||||||
|
forceVlc?: boolean;
|
||||||
|
id?: string;
|
||||||
|
type?: string;
|
||||||
|
episodeId?: string;
|
||||||
|
imdbId?: string;
|
||||||
|
availableStreams?: { [providerId: string]: { streams: any[]; addonName: string } };
|
||||||
|
backdrop?: string;
|
||||||
|
videoType?: string;
|
||||||
};
|
};
|
||||||
Catalog: { id: string; type: string; addonId?: string; name?: string; genreFilter?: string };
|
Catalog: { id: string; type: string; addonId?: string; name?: string; genreFilter?: string };
|
||||||
Credits: { mediaId: string; mediaType: string };
|
Credits: { mediaId: string; mediaType: string };
|
||||||
|
|
@ -989,13 +1004,13 @@ const InnerNavigator = ({ initialRouteName }: { initialRouteName?: keyof RootSta
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="Player"
|
name="PlayerIOS"
|
||||||
component={KSPlayer as any}
|
component={KSPlayerCore as any}
|
||||||
options={{
|
options={{
|
||||||
animation: Platform.OS === 'android' ? 'none' : 'default',
|
animation: 'default',
|
||||||
animationDuration: Platform.OS === 'android' ? 0 : 0,
|
animationDuration: 0,
|
||||||
// Force fullscreen presentation on iPad
|
// Force fullscreen presentation on iPad
|
||||||
presentation: Platform.OS === 'ios' ? 'fullScreenModal' : 'card',
|
presentation: 'fullScreenModal',
|
||||||
// Disable gestures during video playback
|
// Disable gestures during video playback
|
||||||
gestureEnabled: false,
|
gestureEnabled: false,
|
||||||
// Ensure proper orientation handling
|
// Ensure proper orientation handling
|
||||||
|
|
@ -1004,10 +1019,26 @@ const InnerNavigator = ({ initialRouteName }: { initialRouteName?: keyof RootSta
|
||||||
backgroundColor: '#000000', // Pure black for video player
|
backgroundColor: '#000000', // Pure black for video player
|
||||||
},
|
},
|
||||||
// iPad-specific fullscreen options
|
// iPad-specific fullscreen options
|
||||||
...(Platform.OS === 'ios' && {
|
statusBarHidden: true,
|
||||||
statusBarHidden: true,
|
statusBarAnimation: 'none',
|
||||||
statusBarAnimation: 'none',
|
// Freeze when blurred to release resources safely
|
||||||
}),
|
freezeOnBlur: true,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Stack.Screen
|
||||||
|
name="PlayerAndroid"
|
||||||
|
component={AndroidVideoPlayer as any}
|
||||||
|
options={{
|
||||||
|
animation: 'none',
|
||||||
|
animationDuration: 0,
|
||||||
|
presentation: 'card',
|
||||||
|
// Disable gestures during video playback
|
||||||
|
gestureEnabled: false,
|
||||||
|
// Ensure proper orientation handling
|
||||||
|
orientation: 'landscape',
|
||||||
|
contentStyle: {
|
||||||
|
backgroundColor: '#000000', // Pure black for video player
|
||||||
|
},
|
||||||
// Freeze when blurred to release resources safely
|
// Freeze when blurred to release resources safely
|
||||||
freezeOnBlur: true,
|
freezeOnBlur: true,
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -900,7 +900,10 @@ export const StreamsScreen = () => {
|
||||||
}
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|
||||||
navigation.navigate('Player', {
|
// Simple platform check - iOS uses KSPlayerCore, Android uses AndroidVideoPlayer
|
||||||
|
const playerRoute = Platform.OS === 'ios' ? 'PlayerIOS' : 'PlayerAndroid';
|
||||||
|
|
||||||
|
navigation.navigate(playerRoute as any, {
|
||||||
uri: stream.url,
|
uri: stream.url,
|
||||||
title: metadata?.name || '',
|
title: metadata?.name || '',
|
||||||
episodeTitle: type === 'series' ? currentEpisode?.name : undefined,
|
episodeTitle: type === 'series' ? currentEpisode?.name : undefined,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue