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

    Video Item component.

    Represents a single video element, including player control, favorite functionality, playback progress, and quality optimization.

    Responsibilities:

    • Initializes and configures the video player for a specific video.
    • Tracks playback time and saves user progress.
    • Allows users to add/remove videos from favorites.
    • Emits events when the player is closed or favorites are updated.

    Selector: app-video-item Standalone: true

    Implements

    • OnInit
    • AfterViewInit
    • OnDestroy
    Index

    Constructors

    Properties

    authService: AuthService = ...

    Authentication service for managing user data and favorite lists.

    closeVideoClick: OutputEmitterRef<boolean> = ...

    Output event emitted when the close/back button of the video player is clicked. Carries a boolean value representing the close state.

    favoriteVideosUpdated: OutputEmitterRef<void> = ...

    Output event emitted after a favorite video action (add/remove) completes. Used to notify parent components to refresh favorite lists.

    isInFavorite: WritableSignal<boolean> = ...

    Signal indicating whether the current video is in the user's favorites.

    user: User | null = ...

    The currently authenticated user object.

    video: InputSignal<Video | undefined> = ...

    Input signal providing the current video to be displayed or played.

    videoId: WritableSignal<number> = ...

    Signal holding the ID of the current video.

    videoProgressService: VideoProgressService = ...

    Service handling video progress tracking (save/load playback position).

    videoQualityService: VideoQualityService = ...

    Service for adjusting and optimizing video playback quality.

    videoService: VideoService = ...

    Service responsible for managing video metadata and favorite operations.

    Methods

    • Handles the back/close button click from the player view.

      Emits closeVideoClick event to inform the parent component to close the player overlay.

      Parameters

      • closeVideo: boolean

        Boolean indicating whether to close the video player.

      Returns void

    • Lifecycle hook.

      After the view initializes, checks whether the current video is part of the user's favorites and updates state accordingly.

      Returns void

    • Lifecycle hook.

      Saves the user's video progress when the component is destroyed and resets internal tracking state.

      Returns void

    • Lifecycle hook.

      Initializes video context:

      • Sets video ID.
      • Loads saved progress.
      • Displays temporary optimization message.
      • Clears quality service message after setup.

      Returns void

    • Handles adding or removing a video from favorites.

      Sends a request to the backend and updates the user's favorite list. Emits favoriteVideosUpdated event when the action completes.

      Parameters

      • videoId: number

        The ID of the video to add or remove from favorites.

      Returns void