首页 > 解决方案 > Just-Audio Flutter Headers are not working when adding to playlist (ConcatenatingAudioSource)

问题描述

We need to pass headers to server that hosts mp3 files and using following code but somehow header field is showing as null in logs, can you review and let us know if we are missing something or not using the headers correctly:

await _player
        .setAudioSource(
      ConcatenatingAudioSource(
        children: queue
            .map(
              (item) => AudioSource.uri(
                Uri.parse(item.id),
                headers: {'header1': 'media.Ourhost', 'header2': 'media.Ourhost.app'},
                tag: '',
              ),
            )
            .toList(),
      ),
    )

标签: flutteraudiojust-audio

解决方案


推荐阅读