mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-01-11 20:10:25 +00:00
fix.
This commit is contained in:
parent
f3f68c0ff6
commit
8b7109a529
2 changed files with 30 additions and 84 deletions
|
|
@ -784,34 +784,16 @@ const AndroidVideoPlayer: React.FC = () => {
|
|||
}
|
||||
disableImmersiveMode();
|
||||
|
||||
if (Platform.OS === 'ios') {
|
||||
// iOS: rebuild stack so Streams is presented as modal above Metadata
|
||||
if (type === 'series' && id && episodeId) {
|
||||
(navigation as any).reset({
|
||||
index: 2,
|
||||
routes: [
|
||||
{ name: 'MainTabs' },
|
||||
{ name: 'Metadata', params: { id, type } },
|
||||
{ name: 'Streams', params: { id, type: 'series', episodeId, fromPlayer: true } }
|
||||
]
|
||||
});
|
||||
} else if ((navigation as any).canGoBack()) {
|
||||
(navigation as any).goBack();
|
||||
} else {
|
||||
(navigation as any).navigate('MainTabs');
|
||||
}
|
||||
// For series, hard reset to a single Streams route to avoid stacking multiple modals/pages
|
||||
if (type === 'series' && id && episodeId) {
|
||||
(navigation as any).reset({
|
||||
index: 0,
|
||||
routes: [
|
||||
{ name: 'Streams', params: { id, type: 'series', episodeId, fromPlayer: true } }
|
||||
]
|
||||
});
|
||||
} else {
|
||||
// Android: hard reset to avoid stacking multiple pages/modals
|
||||
if (type === 'series' && id && episodeId) {
|
||||
(navigation as any).reset({
|
||||
index: 0,
|
||||
routes: [
|
||||
{ name: 'Streams', params: { id, type: 'series', episodeId, fromPlayer: true } }
|
||||
]
|
||||
});
|
||||
} else {
|
||||
(navigation as any).goBack();
|
||||
}
|
||||
navigation.goBack();
|
||||
}
|
||||
}).catch(() => {
|
||||
// Fallback: still try to restore portrait then navigate
|
||||
|
|
@ -822,34 +804,16 @@ const AndroidVideoPlayer: React.FC = () => {
|
|||
}
|
||||
disableImmersiveMode();
|
||||
|
||||
if (Platform.OS === 'ios') {
|
||||
// iOS: rebuild stack so Streams is presented as modal above Metadata
|
||||
if (type === 'series' && id && episodeId) {
|
||||
(navigation as any).reset({
|
||||
index: 2,
|
||||
routes: [
|
||||
{ name: 'MainTabs' },
|
||||
{ name: 'Metadata', params: { id, type } },
|
||||
{ name: 'Streams', params: { id, type: 'series', episodeId, fromPlayer: true } }
|
||||
]
|
||||
});
|
||||
} else if ((navigation as any).canGoBack()) {
|
||||
(navigation as any).goBack();
|
||||
} else {
|
||||
(navigation as any).navigate('MainTabs');
|
||||
}
|
||||
// For series, hard reset to a single Streams route to avoid stacking multiple modals/pages
|
||||
if (type === 'series' && id && episodeId) {
|
||||
(navigation as any).reset({
|
||||
index: 0,
|
||||
routes: [
|
||||
{ name: 'Streams', params: { id, type: 'series', episodeId, fromPlayer: true } }
|
||||
]
|
||||
});
|
||||
} else {
|
||||
// Android: hard reset to avoid stacking multiple pages/modals
|
||||
if (type === 'series' && id && episodeId) {
|
||||
(navigation as any).reset({
|
||||
index: 0,
|
||||
routes: [
|
||||
{ name: 'Streams', params: { id, type: 'series', episodeId, fromPlayer: true } }
|
||||
]
|
||||
});
|
||||
} else {
|
||||
(navigation as any).goBack();
|
||||
}
|
||||
navigation.goBack();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -828,37 +828,19 @@ const VideoPlayer: React.FC = () => {
|
|||
|
||||
// Navigate back with proper handling for fullscreen modal
|
||||
try {
|
||||
// On iOS, ensure Streams shows the CURRENT episode as modal by navigating directly
|
||||
if (Platform.OS === 'ios') {
|
||||
if (type === 'series' && id && episodeId) {
|
||||
// Ensure modal by restoring MainTabs -> Metadata -> Streams
|
||||
(navigation as any).reset({
|
||||
index: 2,
|
||||
routes: [
|
||||
{ name: 'MainTabs' },
|
||||
{ name: 'Metadata', params: { id, type } },
|
||||
{ name: 'Streams', params: { id, type: 'series', episodeId, fromPlayer: true } }
|
||||
]
|
||||
});
|
||||
} else if (navigation.canGoBack()) {
|
||||
navigation.goBack();
|
||||
} else {
|
||||
navigation.navigate('MainTabs');
|
||||
}
|
||||
// For series, hard reset to a single Streams route to avoid stacking multiple modals/pages
|
||||
if (type === 'series' && id && episodeId) {
|
||||
(navigation as any).reset({
|
||||
index: 0,
|
||||
routes: [
|
||||
{ name: 'Streams', params: { id, type: 'series', episodeId, fromPlayer: true } }
|
||||
]
|
||||
});
|
||||
} else if (navigation.canGoBack()) {
|
||||
navigation.goBack();
|
||||
} else {
|
||||
// Android: hard reset to avoid stacking multiple pages/modals
|
||||
if (type === 'series' && id && episodeId) {
|
||||
(navigation as any).reset({
|
||||
index: 0,
|
||||
routes: [
|
||||
{ name: 'Streams', params: { id, type: 'series', episodeId, fromPlayer: true } }
|
||||
]
|
||||
});
|
||||
} else if (navigation.canGoBack()) {
|
||||
navigation.goBack();
|
||||
} else {
|
||||
navigation.navigate('MainTabs');
|
||||
}
|
||||
// Fallback: navigate to main tabs if can't go back
|
||||
navigation.navigate('MainTabs');
|
||||
}
|
||||
logger.log('[VideoPlayer] Navigation completed');
|
||||
} catch (navError) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue