videoflix-frontend - v0.0.0
    Preparing search index...

    Main content component.

    Displays all video sections grouped by category and manages favorite videos, scrolling behavior, and responsive UI updates.

    Responsibilities:

    • Loads and groups videos by category.
    • Displays favorites based on user profile.
    • Controls horizontal scrolling and arrow visibility per section.
    • Handles video playback state toggling.

    Selector: app-main-content Standalone: true

    Implements

    • OnInit
    • AfterViewChecked
    Index

    Constructors

    Properties

    destroyRef: DestroyRef = ...

    Angular DestroyRef for automatic subscription cleanup.

    favoriteScrollContainer: Signal<readonly ElementRef<any>[]> = ...

    References to scrollable container for favorite videos section.

    favoriteVideos: WritableSignal<Video[]> = ...

    Signal storing the current user's favorite videos.

    groupedVideos: WritableSignal<{ [key: string]: Video[] }> = ...

    Signal containing all videos grouped by their category. Key = category name, Value = array of videos.

    isFetching: WritableSignal<boolean> = ...

    Signal representing loading state during video fetching.

    scrollContainer: Signal<readonly ElementRef<any>[]> = ...

    References to scrollable containers for each video category. Used to control left/right scroll actions.

    showVideo: WritableSignal<boolean> = ...

    Signal indicating whether the video player overlay is visible.

    user: Signal<User | null> = ...

    Computed signal returning the authenticated user object.

    userService: AuthService = ...

    Injected authentication service used to retrieve current user data.

    videos: Signal<Video[] | undefined> = ...

    Computed list of loaded videos from the VideoService.

    videosService: VideoService = ...

    Injected service responsible for loading and managing videos.

    videoToPlay: WritableSignal<Video | undefined> = ...

    Holds the currently selected video for playback.

    visibleArrows: WritableSignal<{ [key: string]: boolean }> = ...

    Signal tracking which category carousels should display scroll arrows. Key = category name, Value = boolean visibility flag.

    Methods

    • Returns the scroll container element corresponding to a given video category.

      Parameters

      • category: string

        The category name to locate.

      Returns HTMLElement | null

      The HTML element of the scroll container, or null if not found.

    • Handles a click event on a video item.

      Toggles the video player overlay and sets the selected video.

      Parameters

      • showVideo: boolean

        Current visibility state of the video player.

      • video: Video

        The video object that was clicked.

      Returns void

    • Lifecycle hook — executed after every view check. Ensures arrow visibility stays accurate when layout updates occur.

      Returns void

    • Lifecycle hook — initializes video data and sets up reactive states.

      • Fetches videos from VideoService.
      • Groups them by category once loaded.
      • Determines which categories require arrows.
      • Filters favorite videos for the current user.
      • Cleans up subscription on destroy.

      Returns void

    • Scrolls the video list to the left for the specified category.

      Parameters

      • category: string | number

        Either a category name ('favorite') or index number.

      Returns void

    • Scrolls the video list to the right for the specified category.

      Parameters

      • category: string | number

        Either a category name ('favorite') or index number.

      Returns void

    • Updates the visibility of scroll arrows for each video category carousel.

      • Checks scrollable width vs. visible width for each container.
      • Also includes logic for favorite videos section.

      Returns void