CarGuo / GSYVideoPlayer

视频播放器(IJKplayer、ExoPlayer、MediaPlayer),HTTPS,16k page size,支持弹幕,外挂字幕,支持滤镜、水印、gif截图,片头广告、中间广告,多个同时播放,支持基本的拖动,声音、亮度调节,支持边播边缓存,支持视频自带rotation的旋转(90,270之类),重力旋转与手动旋转的同步支持,支持列表播放 ,列表全屏动画,视频加载速度,列表小窗口支持拖动,动画效果,调整比例,多分辨率切换,支持切换播放器,进度条小窗口预览,列表切换详情页面无缝播放,rtsp、concat、mpeg。
https://juejin.cn/user/817692379985752/posts
Apache License 2.0
20.33k stars 4.21k forks source link

7.0.2 升级后有问题呀exopler xxxxx.com/m3u8 格式不支持了 #2111

Closed yang0000meng closed 5 years ago

yang0000meng commented 5 years ago

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&timestamp=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)

CarGuo commented 5 years ago

没有啊,但是有个 setOverrideExtension 的接口

 /**
     * 是否需要覆盖拓展类型,目前只针对exoPlayer内核模式有效
     * @param overrideExtension 比如传入 m3u8,mp4,avi 等类型
     */
    public void setOverrideExtension(String overrideExtension) {
        this.mOverrideExtension = overrideExtension;
    }
yang0000meng commented 5 years ago

我注释多了 ,以为是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; } });