在使用ijkplayer的时候视频播放失败,日志如下:
image.png
W/IJKMEDIA: HTTP error 404 Not Found
I/tv.danmaku.ijk.media.player.IjkMediaPlayer: onNativeInvoke 2
W/IJKMEDIA: Failed to open segment of playlist 0
E/IJKMEDIA: Error when loading first segment 'http://anyshare.eisoo.com:9028/anyshares3accesstestbucket/5A25A53CC44E4B5498C22A3BC98062BF/28C5A956CC6E4897A5B381264BAFA9F4-1?userid=AKIAI6IFWLK557WYM23A&Expires=1537206167&Signature=LVN1ZfxDGl8Ri0Loerh8o5wG5MY%3d&x-as-userid=0474fe44-5157-11e5-8ddd-dcd2fc061e41'
E/IJKMEDIA: http://anyshare.eisoo.com:9123/v1/file?method=play&userid=0474fe44-5157-11e5-8ddd-dcd2fc061e41&tokenid=a5a90d40-6480-4a87-9b52-1966293b2ea4&docid=28C5A956CC6E4897A5B381264BAFA9F4&usehttps=false: Invalid data found when processing input
D/IJKMEDIA: FFP_MSG_ERROR: 0
I/IJKMEDIA: SDL_JNI_DetachThreadEnv: [1966]
E/tv.danmaku.ijk.media.player.IjkMediaPlayer: Error (-10000,0)
E/JiaoZiVideoPlayer: onError -10000 - 0 [153779063]
经过一番排查后,解决方案如下
// 清空DNS,有时因为在APP里面要播放多种类型的视频(如:MP4,直播,直播平台保存的视频,和其他http视频), 有时会造成因为DNS的问题而报10000问题的
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "dns_cache_clear", 1); |