MediaSFU React Native
    Preparing search index...

    Variable MainAspectComponentConst

    MainAspectComponent: React.FC<MainAspectComponentOptions> = ...

    MainAspectComponent tracks responsive breakpoints and adjusts container dimensions relative to the viewport, providing callbacks for wide/medium/small determinations. Override hooks let consumers reshape either the children or the wrapper entirely.

    • Dynamically tracks viewport size and fires breakpoint callbacks
    • Adjusts container height based on control visibility
    • Supports fractional sizing for flexible layouts
    • Re-renders on window dimension changes
    • Provides screen size callbacks (wide/medium/small)
    • Wide screen: ≥ 768px width
    • Medium screen: 576px–767px width
    • Small screen: < 576px width
    • Container provides structural grouping
    • Children maintain their accessibility properties
    // Basic responsive main area
    <MainAspectComponent
    backgroundColor="#000"
    showControls
    updateIsWideScreen={(isWide) => setIsWideScreen(isWide)}
    updateIsMediumScreen={(isMedium) => setIsMediumScreen(isMedium)}
    updateIsSmallScreen={(isSmall) => setIsSmallScreen(isSmall)}
    >
    <VideoGridContainer />
    </MainAspectComponent>
    // Custom fractions with hidden controls
    <MainAspectComponent
    backgroundColor="#1a1a1a"
    showControls={false}
    containerWidthFraction={0.9}
    containerHeightFraction={0.85}
    defaultFraction={0.95}
    updateIsWideScreen={handleWideScreen}
    updateIsMediumScreen={handleMediumScreen}
    updateIsSmallScreen={handleSmallScreen}
    style={{ borderRadius: 12, overflow: 'hidden' }}
    >
    <StageView participants={stageParticipants} />
    </MainAspectComponent>
    // With animated container
    <MainAspectComponent
    backgroundColor="transparent"
    updateIsWideScreen={setWideScreen}
    updateIsMediumScreen={setMediumScreen}
    updateIsSmallScreen={setSmallScreen}
    renderContainer={({ defaultContainer, dimensions }) => (
    <Animated.View
    style={{
    transform: [{ scale: scaleAnim }],
    opacity: opacityAnim,
    }}
    >
    {defaultContainer}
    </Animated.View>
    )}
    >
    <PresentationView />
    </MainAspectComponent>