Exoplayer不播放本地mov文件

时间:2018-03-22 13:00:59

标签: android exoplayer mov media-source

我可以使用exoplayer从url和本地mp4文件运行.mov文件。当我尝试从本地路径运行.mov文件时,它会抛出UnrecognizedInputFormatException异常(下面的stacktrace)。 Exoplayer是否支持以任何方式从本地路径运行mov文件。

com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the available extractors (MatroskaExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, Ac3Extractor, TsExtractor, FlvExtractor, OggExtractor, PsExtractor, WavExtractor) could read the stream.
                                                        at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractorHolder.selectExtractor(ExtractorMediaPeriod.java:820)
                                                        at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:742)
                                                        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:315)
                                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
                                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
                                                        at java.lang.Thread.run(Thread.java:761)

这就是我构建媒体资源的方式:

    private MediaSource buildMediaSource(Uri uri) {
    DataSource.Factory dataSourceFactory = new FileDataSourceFactory();
    return new ExtractorMediaSource.Factory(
            new FileDataSourceFactory()).
            createMediaSource(uri);

}

TIA

0 个答案:

没有答案