INNER CODE UNIT · Dart
playableIds
koel/player · lib/audio_handler.dart:206
var playableIds = mediaItems.map((item) => item.id).toList();
put('queue/state', data: {
'songs': playableIds,
'song': playableIds.isEmpty ? '' : _currentMediaItem.id,
});
});
_player.positionStream.throttle(Duration(seconds: 1)).listen((position) {
if (mediaItem.value == null || position.inSeconds % 5 != 0) return;
put('queue/playback-status', data: {
'song': _currentMediaItem.id,
'position': position.inSeconds,
});
// if the playable is an episode, we want to keep track of the progress
// in the app as well.