React-native-track-player: [Android] None of the available extractors (...) could read the stream

Created on 23 May 2019  路  8Comments  路  Source: react-native-kit/react-native-track-player

Configuration

$ react-native info
  React Native Environment Info:
    System:
      OS: macOS 10.14.5
      CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
      Memory: 204.66 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 12.1.0 - /usr/local/bin/node
      Yarn: 1.16.0 - /usr/local/bin/yarn
      npm: 6.9.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
    IDEs:
      Android Studio: 3.4 AI-183.5429.30.34.5452501
      Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
    npmPackages:
      react: ^16.8.3 => 16.8.3
      react-native: ^0.59.3 => 0.59.3
    npmGlobalPackages:
      react-native-cli: 2.0.1

react-native-track-player version 1.1.4

Issue

When I try to play the following stream URL https://nhks-vh.akamaihd.net/i/news/easy/k10011923001000.mp4/master.m3u8
the player fails on Android with:

{
  code: "playback-source"
  message : "None of the available extractors (MatroskaExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, Ac3Extractor, TsExtractor, FlvExtractor, OggExtractor, PsExtractor, WavExtractor, AmrExtractor) could read the stream."
  type: "playback-error"
}

Strangely an earlier build of my app with version 0.2.3 or react-native-track-player is able to play the stream without issue.

Here's some more detail on the stream:

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=64000,CODECS="mp4a.40.2",CLOSED-CAPTIONS=NONE
https://nhks-vh.akamaihd.net/i/news/easy/k10011923001000.mp4/index_0_a.m3u8?null=0&id=AgAyz4n2FyAuHHC05VxmY81II0nwX6YO6XNjoYkDmlXsFLrySjy6aBUOjV35yRhpL5vB69xqJFhEwQ%3d%3d

Note 1: I've confirmed playback does work for this stream on iOS.
Node 2: I've also tried enabling all extensions through the track-player.json file, unsuccessfully.

{
  "dash": true,
  "hls": true,
  "smoothstreaming": true
}

Most helpful comment

@javier-artiles you've forgotten to specify the type of the stream as HLS.. You can specify that in the track object -- there's more info in the documentation

for your specific example, you'd change this:

await TrackPlayer.add({
  id: streamUrl,
  url: streamUrl,
  type: 'hls', // missing this!
  //title: 'Track Title',
  //artist: 'Track Artist',
  //artwork: require('track.png')
});

All 8 comments

Hey @javier-artiles I have an inkling about what the issue could be. Do you have a basic demo of this not working?

Hi @dcvz thank for your prompt reply.
I've created a basic demo that illustrates the issue. In the README of the repo I've pasted the log results that I get when running on Android.
Thank you for your help!!

Hi @dcvz by any chance have you been able to look into this issue? If you have any leads I could investigate I may be able to unlock some progress. I鈥檓 not familiar with the underlying libraries (or Android native development in general), but I can give it a try if you think that鈥檚 where the root cause may be.

@javier-artiles pulling down your branch now and investigating

@javier-artiles you've forgotten to specify the type of the stream as HLS.. You can specify that in the track object -- there's more info in the documentation

for your specific example, you'd change this:

await TrackPlayer.add({
  id: streamUrl,
  url: streamUrl,
  type: 'hls', // missing this!
  //title: 'Track Title',
  //artist: 'Track Artist',
  //artwork: require('track.png')
});

try it out and let me know if it's working for you :)

as far as I believe we are no longer using the track-player.json to enable modules. /cc @Guichaguri

Thank you so much @dcvz I missed that. I should have reads the docs more thoroughly.
The issue is fixed once I set the track type field to hls.

Was this page helpful?
0 / 5 - 0 ratings