chip now shows next episode soruce

This commit is contained in:
tapframe 2025-08-13 14:03:07 +05:30
parent ac504b99c8
commit 340ba19176
2 changed files with 32 additions and 0 deletions

View file

@ -200,6 +200,9 @@ const AndroidVideoPlayer: React.FC = () => {
// Next episode button state
const [showNextEpisodeButton, setShowNextEpisodeButton] = useState(false);
const [isLoadingNextEpisode, setIsLoadingNextEpisode] = useState(false);
const [nextLoadingProvider, setNextLoadingProvider] = useState<string | null>(null);
const [nextLoadingQuality, setNextLoadingQuality] = useState<string | null>(null);
const [nextLoadingTitle, setNextLoadingTitle] = useState<string | null>(null);
const nextEpisodeButtonOpacity = useRef(new Animated.Value(0)).current;
const nextEpisodeButtonScale = useRef(new Animated.Value(0.8)).current;
// Get metadata to access logo (only if we have a valid id)
@ -1307,6 +1310,12 @@ const AndroidVideoPlayer: React.FC = () => {
bestStream = sortedStreams[0];
streamFound = true;
hasNavigated = true;
// Update loading details for the chip
const qualityText = (bestStream.title?.match(/(\d+)p/) || [])[1] || null;
setNextLoadingProvider(addonName || addonId || null);
setNextLoadingQuality(qualityText);
setNextLoadingTitle(bestStream.name || bestStream.title || null);
logger.log('[AndroidVideoPlayer] Found stream for next episode:', bestStream);
@ -2013,6 +2022,13 @@ const AndroidVideoPlayer: React.FC = () => {
S{nextEpisode.season_number}E{nextEpisode.episode_number}
{nextEpisode.name ? `: ${nextEpisode.name}` : ''}
</Text>
{isLoadingNextEpisode && (
<Text style={{ color: '#333333', fontSize: 11, marginTop: 2 }} numberOfLines={1}>
{nextLoadingProvider ? `${nextLoadingProvider}` : 'Finding source…'}
{nextLoadingQuality ? `${nextLoadingQuality}p` : ''}
{nextLoadingTitle ? `${nextLoadingTitle}` : ''}
</Text>
)}
</View>
</TouchableOpacity>
</Animated.View>

View file

@ -220,6 +220,9 @@ const VideoPlayer: React.FC = () => {
// Next episode button state
const [showNextEpisodeButton, setShowNextEpisodeButton] = useState(false);
const [isLoadingNextEpisode, setIsLoadingNextEpisode] = useState(false);
const [nextLoadingProvider, setNextLoadingProvider] = useState<string | null>(null);
const [nextLoadingQuality, setNextLoadingQuality] = useState<string | null>(null);
const [nextLoadingTitle, setNextLoadingTitle] = useState<string | null>(null);
const nextEpisodeButtonOpacity = useRef(new Animated.Value(0)).current;
const nextEpisodeButtonScale = useRef(new Animated.Value(0.8)).current;
@ -1211,6 +1214,12 @@ const VideoPlayer: React.FC = () => {
bestStream = sortedStreams[0];
streamFound = true;
hasNavigated = true;
// Update loading details for the chip
const qualityText = (bestStream.title?.match(/(\d+)p/) || [])[1] || null;
setNextLoadingProvider(addonName || addonId || null);
setNextLoadingQuality(qualityText);
setNextLoadingTitle(bestStream.name || bestStream.title || null);
logger.log('[VideoPlayer] Found stream for next episode:', bestStream);
@ -1920,6 +1929,13 @@ const VideoPlayer: React.FC = () => {
S{nextEpisode.season_number}E{nextEpisode.episode_number}
{nextEpisode.name ? `: ${nextEpisode.name}` : ''}
</Text>
{isLoadingNextEpisode && (
<Text style={{ color: '#333333', fontSize: 11, marginTop: 2 }} numberOfLines={1}>
{nextLoadingProvider ? `${nextLoadingProvider}` : 'Finding source…'}
{nextLoadingQuality ? `${nextLoadingQuality}p` : ''}
{nextLoadingTitle ? `${nextLoadingTitle}` : ''}
</Text>
)}
</View>
</TouchableOpacity>
</Animated.View>