【问题标题】:ExoPlayer Cant Play some audio streamsExoPlayer 无法播放某些音频流
【发布时间】:2019-05-15 00:45:57
【问题描述】:

我是这里的新手。我正在开发一个安卓应用来收听在线电台。

我遇到的问题是 ExoPlayer(2.9.2) 可以或不能播放一些相同类型的不同比特率的流。

举例

这些 mpga 流

http://108.61.34.50:7130/              ---> 96kbs ===> Playable
http://s3.voscast.com:8408             ---> 64kbs ===> Not Playable
http://220.247.227.20:8000/citystream  ---> 128kbs ===> Not Playable

我使用 vlc 编解码器窗口来获取此信息,这 3 个流共享除了比特率之外的相同值。

我正在使用 ExtractorMediaSource

    songs.add(Uri.parse("http://220.247.227.20:8000/citystream"));//City

    player= ExoPlayerFactory.newSimpleInstance(this,
            new DefaultTrackSelector());

    DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(this,
            Util.getUserAgent(this, "AudioApp"));

    ConcatenatingMediaSource concatenatingMediaSource = new ConcatenatingMediaSource();
    for (Uri temp : songs)
    {
        BaseMediaSource mediaSourse=
                new ExtractorMediaSource.Factory(dataSourceFactory).createMediaSource(temp);
        concatenatingMediaSource.addMediaSource(mediaSourse);
    }

    player.prepare(concatenatingMediaSource);
    player.setPlayWhenReady(true);

希望有人能帮帮我..

【问题讨论】:

    标签: android audio stream audio-streaming exoplayer


    【解决方案1】:

    在测试了各种不同的流之后,我意识到这是一个特定于设备的错误。 华为 Y5 2017

    我测试过的另一部手机运行良好,我最终在 github 上向 ExpoPlayer 团队提交了问题,但并不知道这是特定于设备的问题。 在这里

    Why does ExoPlayer cant play some of the streams of same type with different bitrates ?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-29
      • 2018-11-20
      • 2016-05-18
      • 1970-01-01
      • 1970-01-01
      • 2012-04-01
      • 2012-09-26
      • 1970-01-01
      相关资源
      最近更新 更多