Ijkplayer: 关于https视频播放问题

Created on 18 Jul 2018  ·  1Comment  ·  Source: bilibili/ijkplayer

这两天要升级下视频库,下载最新的视频库,支持https

使用module-lite.sh编译

===== versions =====
ijkplayer :
FFmpeg : ff3.4--ijk0.8.7--20180103--001
libavutil : 55.78.100
libavcodec : 57.107.100
libavformat : 57.83.100
libswscale : 4.8.100
libswresample: 2.9.100
===== options =====
player-opts : video-pictq-size = 3
player-opts : overlay-format = fcc-_es2
player-opts : max-fps = 30
player-opts : framedrop = 5
player-opts : videotoolbox-max-frame-width = 960
player-opts : videotoolbox = 1
player-opts : start-on-prepared = 0
format-opts : ijkapplication = 4796066992
format-opts : ijkiomanager = 4796067024
format-opts : user-agent = ijkplayer
format-opts : auto_convert = 0
format-opts : allowed_extensions = ALL
format-opts : timeout = 30000000
format-opts : reconnect = 1
format-opts : protocol_whitelist = http,https,tls,rtp,tcp,udp,crypto,file,httpproxy
format-opts : safe = 0

  1. 先播放http连接视频(正常),之后https无法播放
    https播放报错日志:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
    : Input/output error

  2. 先播放https视频(正常),之后http的视频无法播放
    http播放报错日志:: Operation timed out

请问这个问题如何去解决啊???

Most helpful comment

如果项目中同时使用了HTTP和HTTPS的视频源的话,要注意如果视频源刚好是相同域名,会导致播放失败,这是由于dns缓存造成的,解决办法参考这篇issue
初始化IjkMediaPlayer时,设置清除dns cache

IjkMediaPlayer.OPT_CATEGORY_FORMAT, "dns_cache_clear", 1

参考:https://github.com/CarGuo/GSYVideoPlayer/blob/master/doc/QUESTION.md

>All comments

如果项目中同时使用了HTTP和HTTPS的视频源的话,要注意如果视频源刚好是相同域名,会导致播放失败,这是由于dns缓存造成的,解决办法参考这篇issue
初始化IjkMediaPlayer时,设置清除dns cache

IjkMediaPlayer.OPT_CATEGORY_FORMAT, "dns_cache_clear", 1

参考:https://github.com/CarGuo/GSYVideoPlayer/blob/master/doc/QUESTION.md

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xSharkM picture xSharkM  ·  3Comments

launam picture launam  ·  3Comments

aslgd picture aslgd  ·  4Comments

bruceshu picture bruceshu  ·  4Comments

lingcimi picture lingcimi  ·  3Comments