Skip to content

Feature Request: Seek Support for StreamerNode (Remote Audio Streaming) #895

@prashant-yi

Description

@prashant-yi

Feature Description

I would like to request seeking support for the StreamerNode when playing remote audio sources. Currently, StreamerNode allows streaming audio from a URL, but it appears to lack the capability to seek to a specific position or start playback from an offset.

Context & Problem

I am migrating my application's audio playback from expo-audio to react-native-audio-api.
While react-native-audio-api provides powerful graph-based audio processing, I hit a blocker with remote audio files (e.g., standard MP3/WAV hosted on S3/R2).

  • Current Implementation: I use StreamerNode to play remote URLs.
  • The Limitation: The StreamerNode API (await node.start()) does not accept a time or offset parameter, nor does it expose a seekTo(seconds) method.
  • Result: Users cannot scrub through a podcast or voice note; they are forced to listen from the beginning every time.

Proposed Solution

Enhance StreamerNode to support seeking. This could be implemented in one of two ways:

  1. seekTo Method:

    const streamer = await context.createStreamerNode();
    streamer.setSource("https://example.com/audio.mp3");
    await streamer.start();
    
    // Later...
    await streamer.seekTo(30); // Seek to 30 seconds
  2. Offset in start:

    // Start playing from the 30-second mark
    await streamer.start({ offset: 30 });

Use Case

  • Long-form Content: Podcasts, lectures, or long voice notes where listeners frequently skip sections or resume playback.
  • Streaming Efficiency: Users shouldn't need to download the entire file (using AudioPlayerNode with a local file) just to seek. Streaming is preferred for startup performance.

Current Workaround

My current workaround is to revert to expo-audio or react-native-track-player for the specific use case of remote streaming media, while using react-native-audio-api for complex recording graphs. This creates a fragmented codebase. Having seeking support in StreamerNode would allow me to unify my audio stack.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions