Closed yang0000meng closed 5 years ago
没有啊,但是有个 setOverrideExtension 的接口
/**
* 是否需要覆盖拓展类型,目前只针对exoPlayer内核模式有效
* @param overrideExtension 比如传入 m3u8,mp4,avi 等类型
*/
public void setOverrideExtension(String overrideExtension) {
this.mOverrideExtension = overrideExtension;
}
我注释多了 ,以为是https @证书忽略代码呢,给注释了。 下面的给注释了。 ExoSourceManager.setExoMediaSourceInterceptListener(new ExoMediaSourceInterceptListener() { @Override public MediaSource getMediaSource(String dataSource, boolean preview, boolean cacheEnable, boolean isLooping, File cacheDir) { String userAgent = ""; if (mMapHeadData != null && mMapHeadData.size() > 0) userAgent = mMapHeadData.get("User-Agent"); Uri contentUri = Uri.parse(dataSource); int contentType = 0;//inferContentType(dataSource); if (Util.toLowerInvariant(dataSource).indexOf(".m3u8") > -1) contentType = C.TYPE_HLS; switch (contentType) { case C.TYPE_HLS: return new HlsMediaSource.Factory(CustomSourceTag.getDataSourceFactory(mContent, userAgent, preview, mMapHeadData)).createMediaSource(contentUri); } return null; } });
http://pl-ali.youku.com/playlist/m3u8?vid=XNDI0Nzg1Mzg0OA&type=mp4hdv3&ups_client_netip=b67c352a&utid=Vt%2BbP6yYz4IDANLhzvAgCJ7C&ccode=010101900004&psid=10cee1200d7f1da2e9f2599e960d5c61&app_ver=3.5.3.0&duration=2994&expire=18000&drm_type=1&drm_device=1&ups_ts=1562029338&onOff=0&encr=0&ups_key=f0eb0f1163738f733e778ddea9a5620c&a=aa.m3u8 这个不能播放了 ,以上链接已失效 http://h5vod.gslb.cmvideo.cn/depository_sjq/asset/zhengshi/5102/139/211/5102139211/media/5102139211_5004842547_55.mp4.m3u8?msisdn=0457FTRLUSK6C6JLVBCPGTS1LB7K3QI7I&mdspid=&spid=600058&netType=0&sid=5500641536&pid=2028600738×tamp=20190702091311&Channel_ID=H5_&ProgramID=648374771&ParentNodeID=-99&preview=1&playseek=000000-000600&assertID=5500641536&client_ip=182.124.53.42&SecurityKey=20190702091311&promotionId=&mvid=5102139211&mcid=1000&mpid=130000034787&encrypt=906247c52f9a86caa521e0238e437b3e 这个可以播放,以上链接已失效 是不是判断url 类型的地方改了呀 提示下面错误 2019-07-02 01:18:09.745 2895-3141/com.luren.videocollect E/ExoPlayerImplInternal: Source error. com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the available extractors (MatroskaExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, Ac3Extractor, TsExtractor, FlvExtractor, OggExtractor, PsExtractor, WavExtractor, AmrExtractor, Ac4Extractor) could read the stream. at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractorHolder.selectExtractor(ProgressiveMediaPeriod.java:1059) at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:947) at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:381) 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) 2019-07-02 01:18:09.750 2895-2895/com.luren.videocollect E/EventLogger: playerFailed [0.13] com.google.android.exoplayer2.ExoPlaybackException: com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the available extractors (MatroskaExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, Ac3Extractor, TsExtractor, FlvExtractor, OggExtractor, PsExtractor, WavExtractor, AmrExtractor, Ac4Extractor) could read the stream. at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:386) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:154) at android.os.HandlerThread.run(HandlerThread.java:61) Caused by: com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the available extractors (MatroskaExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, Ac3Extractor, TsExtractor, FlvExtractor, OggExtractor, PsExtractor, WavExtractor, AmrExtractor, Ac4Extractor) could read the stream. at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractorHolder.selectExtractor(ProgressiveMediaPeriod.java:1059) at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:947) at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:381) 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)