Skip to content

Add env option to control video feed shuffling #42

Description

@shbernal

Feature request

Add a Docker/Compose environment option to control whether Erin shuffles the video feed.

Current behavior

Erin currently randomizes the feed on every load. The README documents this under "In what order will my files appear in the feed?", and the frontend always calls _shuffleArray(_videoFiles) before setting videos in src/App.js.

This works well for the default TikTok-like experience, but it means a deployment cannot opt into a stable/directory order without patching the frontend or building a custom image.

Proposed behavior

Expose a boolean env option, for example:

SHUFFLE_ENABLED=true

or:

RANDOMIZE_VIDEO_ORDER=true

Suggested default: true, so existing deployments keep the current behavior.

When set to false, Erin would preserve the discovered order for the current feed/playlist. The existing ?play=... behavior could still keep the requested video first, then append the remaining videos in either shuffled or stable order depending on the option.

Why this fits the existing config model

This feels like a deployment-level preference rather than an in-app control. Erin already injects config from env through Caddy into public/index.html, for example:

  • AUTOPLAY_ENABLED
  • START_MUTED
  • PROGRESS_BAR_POSITION
  • IGNORE_HIDDEN_PATHS
  • SCROLL_DIRECTION
  • USE_CUSTOM_SKIN
  • VIDEO_START_POSITION

Video ordering can follow the same pattern:

  • add an ENV default in Dockerfile
  • add a placeholder in public/index.html
  • replace it in docker/Caddyfile
  • document it in README.md and sample.env
  • branch in src/App.js between _shuffleArray(_videoFiles) and _videoFiles

Use case

For self-hosted/kiosk-style feeds, a stable order can be useful when the operator wants predictable playback, curated ordering by filename/folder, or easier verification that all clips are being shown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions