Plugins

Riverpod

The riverpod providers are there to simplify usage of the StateNotifiers and event streams. See ./lib/src/plugins/riverpod/providers to find available providers.

final String? currentMediaItemEpisodeId = ref.watch(
    primaryPlayerProvider.select(
        (player) => player?.currentMediaItem?.metadata?.extras?['id']?.asOrNull<String>(),
    ),
);

final String? currentMediaItemEpisodeId = ref.watch(
    playerProviderFor(playerId).select(
        (player) => player?.currentMediaItem?.metadata?.extras?['id']?.asOrNull<String>(),
    ),
);

Npaw / Youbora

NPAW can be enabled with "setNpawConfig()":

BccmPlayerInterface.instance.setNpawConfig(
    NpawConfig(
        accountCode: '',
        appName: '',
    ),
)

It uses title etc from your MediaMetadata by default, but you can customize it via extras. Currently limited to the following properties:

MediaMetadata(
    extras: {
        'npaw.content.id': '123',
        'npaw.content.title': 'Live',
        'npaw.content.tvShow': 'Show',
        'npaw.content.season': 'Season',
        'npaw.content.episodeTitle': 'Livestream',
        'npaw.content.isLive': 'true',
    },
);

For BCC Media apps

Add the BCC Media playback listener (sends episode progress to API and that kind of stuff). Add it in main.dart.

BccmPlayerInterface.instance.addPlaybackListener(
    BccmPlaybackListener(ref: ref, apiProvider: apiProvider),
)