Ui changes

This commit is contained in:
tapframe 2025-08-27 13:30:19 +05:30
parent bfa0eeb2af
commit b7bd700bf9
4 changed files with 82 additions and 1 deletions

@ -1 +1 @@
Subproject commit f56983d17df532f0342cf9bb9d11ae74f64637ff
Subproject commit e48fd1a255b90cac10cd60fdddab8410783434a1

View file

@ -228,6 +228,20 @@ const AndroidVideoPlayer: React.FC = () => {
// Check if we have a logo to show
const hasLogo = metadata && metadata.logo && !metadataLoading;
// Prefetch backdrop and title logo for faster loading screen appearance
useEffect(() => {
if (backdrop && typeof backdrop === 'string') {
Image.prefetch(backdrop).catch(() => {});
}
}, [backdrop]);
useEffect(() => {
const logoUrl = (metadata && (metadata as any).logo) as string | undefined;
if (logoUrl && typeof logoUrl === 'string') {
Image.prefetch(logoUrl).catch(() => {});
}
}, [metadata]);
// Resolve current episode description for series
const currentEpisodeDescription = (() => {
try {
@ -1827,6 +1841,7 @@ const AndroidVideoPlayer: React.FC = () => {
<View style={styles.openingContent}>
{hasLogo ? (
<>
<Animated.View style={{
transform: [
{ scale: Animated.multiply(logoScaleAnim, pulseAnim) }
@ -1843,9 +1858,26 @@ const AndroidVideoPlayer: React.FC = () => {
}}
/>
</Animated.View>
<Text style={{
color: '#B8B8B8',
fontSize: 12,
marginTop: 8,
opacity: 0.9
}} numberOfLines={1}>
{`Via ${(currentStreamProvider || streamProvider || '').toString().toUpperCase()}${(currentQuality || quality) ? `${(currentQuality || quality)}p` : ''}`}
</Text>
</>
) : (
<>
<ActivityIndicator size="large" color="#E50914" />
<Text style={{
color: '#B8B8B8',
fontSize: 12,
marginTop: 12,
opacity: 0.9
}} numberOfLines={1}>
{`Via ${(currentStreamProvider || streamProvider || '').toString().toUpperCase()}${(currentQuality || quality) ? `${(currentQuality || quality)}p` : ''}`}
</Text>
</>
)}
</View>

View file

@ -250,6 +250,20 @@ const VideoPlayer: React.FC = () => {
// Check if we have a logo to show
const hasLogo = metadata && metadata.logo && !metadataLoading;
// Prefetch backdrop and title logo for faster loading screen appearance
useEffect(() => {
if (backdrop && typeof backdrop === 'string') {
Image.prefetch(backdrop).catch(() => {});
}
}, [backdrop]);
useEffect(() => {
const logoUrl = (metadata && (metadata as any).logo) as string | undefined;
if (logoUrl && typeof logoUrl === 'string') {
Image.prefetch(logoUrl).catch(() => {});
}
}, [metadata]);
// Resolve current episode description for series
const currentEpisodeDescription = (() => {
try {
@ -1738,6 +1752,7 @@ const VideoPlayer: React.FC = () => {
<View style={styles.openingContent}>
{hasLogo ? (
<>
<Animated.View style={{
transform: [
{ scale: Animated.multiply(logoScaleAnim, pulseAnim) }
@ -1754,9 +1769,28 @@ const VideoPlayer: React.FC = () => {
}}
/>
</Animated.View>
{/* Minimal provider/quality indicator under logo (not animated) */}
<Text style={{
color: '#B8B8B8',
fontSize: 12,
marginTop: 8,
opacity: 0.9
}} numberOfLines={1}>
{`Via ${(currentStreamProvider || streamProvider || '').toString().toUpperCase()}${(currentQuality || quality) ? `${(currentQuality || quality)}p` : ''}`}
</Text>
</>
) : (
<>
<ActivityIndicator size="large" color="#E50914" />
{/* Minimal provider/quality indicator under spinner */}
<Text style={{
color: '#B8B8B8',
fontSize: 12,
marginTop: 12,
opacity: 0.9
}} numberOfLines={1}>
{`Via ${(currentStreamProvider || streamProvider || '').toString().toUpperCase()}${(currentQuality || quality) ? `${(currentQuality || quality)}p` : ''}`}
</Text>
</>
)}
</View>

View file

@ -15,6 +15,7 @@ import {
Dimensions,
Linking,
Clipboard,
Image as RNImage,
} from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
@ -1344,6 +1345,20 @@ export const StreamsScreen = () => {
return metadata?.poster || null;
}, [currentEpisode, metadata, episodeThumbnail]);
// Prefetch hero/backdrop and title logo when StreamsScreen opens
useEffect(() => {
const urls: string[] = [];
if (episodeImage && typeof episodeImage === 'string') urls.push(episodeImage);
if (bannerImage && typeof bannerImage === 'string') urls.push(bannerImage);
if (metadata && (metadata as any).logo && typeof (metadata as any).logo === 'string') {
urls.push((metadata as any).logo as string);
}
// Deduplicate and prefetch
Array.from(new Set(urls)).forEach(u => {
RNImage.prefetch(u).catch(() => {});
});
}, [episodeImage, bannerImage, metadata]);
const isLoading = type === 'series' ? loadingEpisodeStreams : loadingStreams;
const streams = type === 'series' ? episodeStreams : groupedStreams;