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

    Provides video-related operations for the Videoflix platform.

    Responsibilities:

    • Fetching available videos from the backend.
    • Managing video state with reactive signals.
    • Handling favorite video operations.
    • Fetching signed S3 URLs for secure video streaming.
    Index

    Constructors

    Properties

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

    Readonly signal exposing the currently loaded videos. Used across components to display video lists reactively.

    Methods

    • Adds a video to the user's list of favorites.

      Automatically updates the AuthService user state with new favorites.

      Parameters

      • video_id: number

        The ID of the video to be added to favorites.

      Returns Observable<number[]>

      Observable emitting the updated list of favorite video IDs.

      this.videoService.addToFavorite(5).subscribe();
      
    • Retrieves a signed S3 URL for a specific video and quality level.

      Used for secure streaming — URLs are short-lived and access-controlled.

      Parameters

      • videoId: number

        The ID of the requested video.

      • Optionalquality: "120p" | "360p" | "720p" | "1080p"

        Optional video quality ('120p' | '360p' | '720p' | '1080p').

      Returns Observable<{ url: string }>

      Observable emitting an object containing the signed video URL.

      this.videoService.getSignedVideoUrl(12, '720p').subscribe(({ url }) => {
      player.src({ src: url });
      });
    • Loads all available videos from the backend and updates the local state.

      Returns Observable<Video[]>

      Observable emitting an array of Video objects.

      this.videoService.loadVideos().subscribe();