mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-01-11 20:10:25 +00:00
added vlc playback speed control
This commit is contained in:
parent
665ff06ad1
commit
1ba0a49778
5 changed files with 27 additions and 10 deletions
|
|
@ -253,7 +253,7 @@ const HeroCarousel: React.FC<HeroCarouselProps> = ({ items, loading = false }) =
|
|||
if (!hasData) return null;
|
||||
|
||||
return (
|
||||
<Animated.View entering={FadeIn.duration(350).easing(Easing.out(Easing.cubic))}>
|
||||
<Animated.View entering={FadeIn.duration(150).easing(Easing.out(Easing.cubic))}>
|
||||
<Animated.View style={[styles.container as ViewStyle]}>
|
||||
{/* Removed preload images for performance - let FastImage cache handle it naturally */}
|
||||
{settings.enableHomeHeroBackground && data[activeIndex] && (
|
||||
|
|
|
|||
|
|
@ -1157,12 +1157,28 @@ const HeroSection: React.FC<HeroSectionProps> = memo(({
|
|||
// Auto-start trailer when ready on initial entry if enabled
|
||||
useEffect(() => {
|
||||
if (trailerReady && settings?.showTrailers && isFocused && !globalTrailerPlaying && !startedOnReadyRef.current) {
|
||||
startedOnReadyRef.current = true;
|
||||
logger.info('HeroSection', 'Trailer ready - auto-starting playback');
|
||||
setTrailerPlaying(true);
|
||||
isPlayingSV.value = 1;
|
||||
// Check scroll position - only auto-start if user hasn't scrolled past the hero section
|
||||
try {
|
||||
const y = (scrollY as any).value || 0;
|
||||
const pauseThreshold = heroHeight.value * 0.7;
|
||||
|
||||
if (y < pauseThreshold) {
|
||||
startedOnReadyRef.current = true;
|
||||
logger.info('HeroSection', 'Trailer ready - auto-starting playback');
|
||||
setTrailerPlaying(true);
|
||||
isPlayingSV.value = 1;
|
||||
} else {
|
||||
logger.info('HeroSection', 'Trailer ready but user scrolled past - not auto-starting');
|
||||
// Mark as started to prevent retry
|
||||
startedOnReadyRef.current = true;
|
||||
}
|
||||
} catch (_e) {
|
||||
// Fallback if scroll position unavailable - don't auto-start to be safe
|
||||
logger.info('HeroSection', 'Trailer ready but scroll position unavailable - not auto-starting');
|
||||
startedOnReadyRef.current = true;
|
||||
}
|
||||
}
|
||||
}, [trailerReady, settings?.showTrailers, isFocused, globalTrailerPlaying, setTrailerPlaying]);
|
||||
}, [trailerReady, settings?.showTrailers, isFocused, globalTrailerPlaying, setTrailerPlaying, scrollY, heroHeight]);
|
||||
|
||||
// Handle fullscreen toggle
|
||||
const handleFullscreenToggle = useCallback(async () => {
|
||||
|
|
|
|||
|
|
@ -3323,6 +3323,7 @@ const AndroidVideoPlayer: React.FC = () => {
|
|||
ref={vlcPlayerRef}
|
||||
source={processedStreamUrl}
|
||||
volume={volume}
|
||||
playbackSpeed={playbackSpeed}
|
||||
zoomScale={zoomScale}
|
||||
resizeMode={resizeMode}
|
||||
onLoad={(data) => {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ try {
|
|||
interface VlcVideoPlayerProps {
|
||||
source: string;
|
||||
volume: number;
|
||||
playbackSpeed: number;
|
||||
zoomScale: number;
|
||||
resizeMode: 'contain' | 'cover' | 'none';
|
||||
onLoad: (data: any) => void;
|
||||
|
|
@ -46,6 +47,7 @@ export interface VlcPlayerRef {
|
|||
const VlcVideoPlayer = forwardRef<VlcPlayerRef, VlcVideoPlayerProps>(({
|
||||
source,
|
||||
volume,
|
||||
playbackSpeed,
|
||||
zoomScale,
|
||||
resizeMode,
|
||||
onLoad,
|
||||
|
|
@ -342,7 +344,7 @@ const VlcVideoPlayer = forwardRef<VlcPlayerRef, VlcVideoPlayerProps>(({
|
|||
volume={Math.round(Math.max(0, Math.min(1, volume)) * 100)}
|
||||
mute={false}
|
||||
repeat={false}
|
||||
rate={1}
|
||||
rate={playbackSpeed}
|
||||
autoplay={false}
|
||||
onFirstPlay={handleFirstPlay}
|
||||
onPositionChanged={handlePositionChanged}
|
||||
|
|
|
|||
|
|
@ -631,20 +631,18 @@ const HomeScreen = () => {
|
|||
const heroStyleToUse = isTablet ? 'legacy' : settings.heroStyle;
|
||||
return heroStyleToUse === 'carousel' ? (
|
||||
<HeroCarousel
|
||||
key={`carousel-${featuredContentSource}`}
|
||||
items={allFeaturedContent || (featuredContent ? [featuredContent] : [])}
|
||||
loading={featuredLoading}
|
||||
/>
|
||||
) : (
|
||||
<FeaturedContent
|
||||
key={`featured-${showHeroSection}-${featuredContentSource}`}
|
||||
featuredContent={featuredContent}
|
||||
isSaved={isSaved}
|
||||
handleSaveToLibrary={handleSaveToLibrary}
|
||||
loading={featuredLoading}
|
||||
/>
|
||||
);
|
||||
}, [isTablet, settings.heroStyle, showHeroSection, featuredContentSource, featuredLoading]);
|
||||
}, [isTablet, settings.heroStyle, showHeroSection, featuredContentSource, allFeaturedContent, featuredContent, isSaved, handleSaveToLibrary, featuredLoading]);
|
||||
|
||||
const memoizedThisWeekSection = useMemo(() => <ThisWeekSection />, []);
|
||||
const memoizedContinueWatchingSection = useMemo(() => <ContinueWatchingSection ref={continueWatchingRef} />, []);
|
||||
|
|
|
|||
Loading…
Reference in a new issue