【问题标题】:exoplayer player error unable to connect to hls linkexoplayer 播放器错误无法连接到 hls 链接
【发布时间】:2020-01-04 07:48:44
【问题描述】:

我有一个使用 mpv 可以正常播放的 hls 链接,但在 exoplayer 中我收到此错误:

PlayerError com.google.android.exoplayer2.ExoPlaybackException: com.google.android.exoplayer2.upstream.HttpDataSource$HttpDataSourceException: 无法连接到https://hamdeli.arvanvod.com/MLWvVo7NPe/BNlxo57Wzj/h_,144_200,240_400,360_800,480_1500,720_1579,k.mp4.list/master.m3u8

任何想法可能是什么问题?我现在该怎么办?

【问题讨论】:

标签: android http-live-streaming exoplayer


【解决方案1】:

我遇到了类似的问题,我花了大约 2 个小时在上面,然后我意识到这是我的设备上的一个问题,日期和时间已更改,因此请从您的最后验证一次。

当您更改正在检查的设备中的日期时,似乎 exoplyer 或您的 URL 不起作用。

【讨论】:

    【解决方案2】:

    我进一步挖掘并发现该链接提供了一个 307 临时重定向响应,将 https 重定向到 http。我手动编辑了链接,现在问题已经解决了。

    【讨论】:

      【解决方案3】:

      大概会解决这个问题

      /res/xml/config.xml

      <?xml version="1.0" encoding="utf-8"?>
      <network-security-config>
          <domain-config cleartextTrafficPermitted="true">
              <domain includeSubdomains="true">example.com</domain>
          </domain-config>
      </network-security-config>
      

      Manifest.xml

      <application
      ...
          android:networkSecurityConfig="@xml/network_config">
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-11-23
        • 1970-01-01
        • 2022-09-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多