androidx / androidx/media

Choose MediaSource based on content-type header or sniffing data

Open
#2,898 5 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

enhancement low priority
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

If the client hasn't explicitly provided a MIME type, and ExoPlayer couldn't find any suitable extractor based on the source URI, then fall back to consider the content-type header from the response to the source.

i.e. I have a MediaItem who's URI looks like https://example.com/path_without_extension. I don't explicitly set the MIME type. Despite making a request to the source and the source responding with "content-type: application/vnd.apple.mpegurl", ExoPlayer still throws Caused by: androidx.media3.exoplayer.source.UnrecognizedInputFormatException: None of the available extractors (FlvExtractor, FlacExtractor, WavExtractor, FragmentedMp4Extractor, Mp4Extractor, AmrExtractor, PsExtractor, OggExtractor, TsExtractor, MatroskaExtractor, AdtsExtractor, Ac3Extractor, Ac4Extractor, Mp3Extractor, AviExtractor, JpegExtractor, PngExtractor, WebpExtractor, BmpExtractor, HeifExtractor, AvifExtractor) could read the stream. {contentIsMalformed=false, dataType=1}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.