Skip to content

Repository files navigation

Reel App - FastPix Android Player SDK Demo

A modern Android demonstration application showcasing the FastPix Android Player SDK. This app demonstrates how to integrate professional video playback capabilities into Android applications with a TikTok-style reel feed interface, focusing entirely on loading and displaying media in a seamless, infinite-scroll experience.

Overview

Reel App is a reference implementation for developers looking to integrate FastPix's video streaming solutions into their Android applications. It features:

  • Video Streaming: High-performance video playback using the FastPix Android Player SDK.
  • Social-style Feed: Infinite scroll reel feed similar to popular social media apps.
  • Quality Selection: Dynamic video quality switching during playback.
  • Playback Controls: Advanced player controls including muting and seeking.
  • Video Metadata: Display creator information, timestamps, and descriptions.

Features

Player Features

  • ✅ Multi-quality selection with auto-quality mode
  • ✅ Subtitles switching - see guide
  • ✅ Audio tracks switching - see guide
  • ✅ Mute/unmute controls
  • ✅ Seek bar with buffering indicators
  • ✅ Error handling and recovery
  • ✅ Lifecycle-aware playback (pause on background, resume on foreground)

Fetching Media

The reel feed is dynamically populated by fetching a list of video assets directly from the FastPix API. This is handled using a Retrofit GET request to retrieve the on-demand media.

Below is the network interface snippet used in the app to fetch the media list:

@GET("on-demand")
suspend fun listMedia(
    @Query("limit") limit: Int = 10,
    @Query("offset") offset: Int = 1,
    @Query("orderBy") orderBy: String = "desc",  // "asc" or "desc"
): Response<ListMediaResponse>

For complete details on the request parameters and response payload, refer to the official FastPix List Media API Documentation.


Tech Stack

Architecture & Framework

  • Language: Kotlin
  • UI Framework: Jetpack Compose
  • Architecture Pattern: MVVM
  • Dependency Injection: Dagger Hilt

Libraries & Dependencies

  • Video Playback: fastpix-android-player (FastPix Player SDK)
  • Networking: Retrofit 2 (REST API client), okhttp3 (HTTP client with interceptors), kotlinx-serialization (JSON serialization)
  • UI: Jetpack Compose (Declarative UI), Material3 (Material Design components), Coil (Image and video frame loading)
  • State Management: Kotlin Flow (Reactive streams), Compose State (Local composition state)
  • Build Tools: Gradle 9.4.1, Kotlin 1.9+, KSP (Kotlin Symbol Processing), ProGuard/R8 for optimization

Prerequisites

Before setting up the project, ensure you have:

  1. Android Studio (latest version recommended)
  2. Java Development Kit (JDK) 11 or higher
  3. Android SDK with API level 24+ (minimum SDK)
  4. Gradle 9.4.1 (included via wrapper)

Setup & Configuration

Step 1: Clone the Repository

git clone https://github.com/FastPix/demo-android-reel-app.git
cd demo-android-reel-app

Step 2: Obtain Required Credentials

Before opening the project, gather:

  1. FastPix Credentials: Visit your FastPix Dashboard and copy your Token ID and Secret Key.
  2. GitHub PAT: Go to GitHub Settings → Developer settings → Personal access tokens, create a new token with the read:packages scope, and copy it.

Step 3: Configure local.properties

Create or edit the local.properties file in the project root directory with your credentials:

# Android SDK path (usually auto-detected, but you can specify it)
sdk.dir=/path/to/your/android/sdk

# FastPix API Credentials
fastpix.tokenId=YOUR_FASTPIX_TOKEN_ID
fastpix.secretKey=YOUR_FASTPIX_SECRET_KEY

# GitHub Credentials for Maven package resolution
github.username=YOUR_GITHUB_USERNAME
github.token=YOUR_GITHUB_PERSONAL_ACCESS_TOKEN

Step 4: Build & Run

Option A: Using Android Studio

  1. Open the project in Android Studio.
  2. Android Studio will automatically detect and sync Gradle dependencies.
  3. Connect an Android device (API 24+) or start an emulator.
  4. Click the Run button (or press Shift + F10).

Option B: Using Command Line

# Clean the project
./gradlew clean

# Build the debug APK
./gradlew assembleDebug

# Install on connected device
./gradlew installDebug

# Or build and run directly
./gradlew installDebug
adb shell am start -n com.fastpix.reelappexample.debug/com.fastpix.reelappexample.MainActivity

Troubleshooting

Gradle Sync Fails

Problem: Could not find io.fastpix:fastpix-android-player

Solution:

  1. Verify github.username and github.token in local.properties.
  2. Ensure GitHub PAT has the read:packages scope.
  3. Run ./gradlew clean --refresh-dependencies.

Build Fails with "BuildConfig Constants Not Found"

Problem: BuildConfig.FASTPIX_TOKEN_ID is undefined

Solution:

  1. Confirm fastpix.tokenId and fastpix.secretKey are correctly set in local.properties.
  2. Clean and rebuild: ./gradlew clean assembleDebug.

Player Won't Play Videos

Problem: Video playback shows "Content not Available"

Solution:

  1. Verify the playback ID is valid.
  2. Check network connectivity.
  3. Ensure the video has finished processing on the FastPix platform.

Audio Tracks or Subtitles Not Showing

Problem: Only the default audio plays and no subtitle options appear, even when the original source had multiple audio tracks or embedded captions.

Solution:

FastPix does not automatically extract alternate audio streams or embedded subtitle tracks from a source file or URL. This includes YouTube videos imported by URL and on device uploads — only the default muxed audio is ingested. You must supply tracks explicitly using one of the methods in the Adding Audio Tracks & Subtitles API Reference.

Reference Documentation

License

Reel App is licensed under the MIT License - see the LICENSE file for details.

Support

For issues or questions:

  1. Check the Troubleshooting section above.
  2. Review FastPix Documentation.
  3. Open an issue on GitHub Issues.
  4. Contact FastPix support at support@fastpix.com.

About

TikTok-style, infinite-scroll reel app demo for the FastPix Android Player SDK - Kotlin, Jetpack Compose, MVVM.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages