BiddingStack Audio Player for Flutter

BiddingStack Audio Player Flutter Integration Guide

Play BiddingStack audio in your Flutter app with a typed controller for playback control, runtime configuration, player events, media session integration, and an optional fullscreen player.

Requirements

ComponentMinimum Version
Flutter3.16+
Dart3.4+
iOS14.0+
Android API Level24 (Android 7.0)+

Installation

The biddingstack_media_sdk package is distributed privately while in early access. Contact the BiddingStack team to get the SDK package.

Platform setup:

  • Android: make sure <uses-permission android:name="android.permission.INTERNET" /> is declared in android/app/src/main/AndroidManifest.xml. Flutter's default template only declares it for debug and profile builds.
  • iOS: for background playback, add the audio background mode to ios/Runner/Info.plist:
<key>UIBackgroundModes</key>
<array>
  <string>audio</string>
</array>

Integration

1. Create a controller and player widget

Give the widget an explicit height; use onResize to track the player's content height:

import 'package:biddingstack_media_sdk/biddingstack_media_sdk.dart';

final controller = BiddingStackPlayerController(
  onEvent: (event) => debugPrint(event.toString()),
);

SizedBox(
  height: 280,
  child: BiddingStackPlayer(controller: controller),
)

Widget parameters:

ParameterDefaultDescription
controllerrequiredThe BiddingStackPlayerController driving this player
mediaSessionEnabledtrueLock screen / media controls integration
verbosefalseVerbose logging
enableExternalLinkOpentrueOpen external links from the player

Controller callbacks:

CallbackDescription
onEvent(PlayerEvent event)Player events
onResize(double heightDp)Player content height changed
onExternalLinkOpened(Uri uri)An external link was opened

2. Load audio

await controller.load(const PlayerSettings(
  playerConfig: PlayerConfig(autoPlay: false, themeid: 1),
  audio: [
    AudioItem(
      audioUrl: 'https://example.com/track.mp3',
      audioTitle: 'My Track',
    ),
  ],
));

PlayerConfig mirrors the web player configuration. mode is managed by the SDK and set to embed automatically.

3. Release the player

@override
void dispose() {
  controller.destroy();
  super.dispose();
}

Playback Control

All controller methods return Future<void>; failures surface as BiddingStackPlayerException:

MethodDescription
load(PlayerSettings settings)Load settings and audio
play() / pause()Start / pause playback
seek(double seconds)Seek to a position in seconds
next() / prev()Switch tracks in a playlist
setPlaybackRate(double rate)Set playback speed
setVolume(double volume)Set volume, 0.01.0
setMuted(bool muted)Mute / unmute
destroy()Tear down the player

Note: Commands issued before the platform view attaches are queued and flushed automatically.

Fullscreen Player

Present a fullscreen audio player; the returned future completes when it is dismissed:

await BiddingStackMedia.presentFullscreenPlayer(
  settings,
  onEvent: (event) => debugPrint(event.type.toString()),
);

mode is set to fullscreen automatically.