问题起因:

在进行ijkplayer播放器的测试时,发现ijkplayer播放器在切换网络时出现直播画面停止的问题。

问题分析:

抓取日志发现:tv.danmaku.ijk.media.player.IjkMediaPlayer: Error (-10000,0)

问题解决:

重写OnErrorListener的onError方法,然后判断what = -10000的时候,触发重置播放器的操作

参考内容

ijkplayer_android_def.h :

// Generic error codes for the media player framework.  Errors are fatal, the
// playback must abort.
//
// Errors are communicated back to the client using the
// MediaPlayerListener::notify method defined below.
// In this situation, 'notify' is invoked with the following:
// 'msg' is set to MEDIA_ERROR.
// 'ext1' should be a value from the enum media_error_type.
// 'ext2' contains an implementation dependant error code to provide
// more details. Should default to 0 when not used.
//
// The codes are distributed as follow:
// 0xx: Reserved
// 1xx: Android Player errors. Something went wrong inside the MediaPlayer.
// 2xx: Media errors (e.g Codec not supported). There is a problem with the
// media itself.
// 3xx: Runtime errors. Some extraordinary condition arose making the playback
// impossible.
//
enum media_error_type {
// 0xx
MEDIA_ERROR_UNKNOWN = 1,
// 1xx
MEDIA_ERROR_SERVER_DIED = 100,
// 2xx
MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = 200,
// 3xx // -xx
MEDIA_ERROR_IO = -1004,
MEDIA_ERROR_MALFORMED = -1007,
MEDIA_ERROR_UNSUPPORTED = -1010,
MEDIA_ERROR_TIMED_OUT = -110, MEDIA_ERROR_IJK_PLAYER = -10000,
};

最新文章

  1. 本地ip被劫持,初始化hosts文件,及其作用与说明
  2. 0125 多线程 继承Thread 练习
  3. nodeJS实战
  4. C++ AppendMenu
  5. 用keil直接生成BIN文件
  6. poj 1077-Eight(八数码+逆向bfs打表)
  7. 从51跳cortex-m0学习2——程序详解
  8. 转:命令和查询责任分离(CQRS)架构模式
  9. java项目开发第六天——天若有情天亦老,人间正道是沧桑
  10. 关于constraint的用法
  11. svn客户端的使用
  12. less中的变量
  13. FusionCharts 2D柱状图和折线图的组合图
  14. Linux开发-makefile
  15. 【AHOI2005】病毒检测
  16. 如何优化你的布局层级结构之RelativeLayout和LinearLayout及FrameLayout性能分析
  17. Android Material Design控件使用(四)——下拉刷新 SwipeRefreshLayout
  18. SQLI DUMB SERIES-22
  19. Centos创建ftp服务器
  20. java中数组、集合、字符串之间的转换,以及用加强for循环遍历

热门文章

  1. python中TCP粘包问题解决方案
  2. Unity for VsCode
  3. 接口自动化测试链接https://www.cnblogs.com/finer/
  4. JAVA远程调试
  5. OpenStack安装-MySQL,Rabbitmq,memcache.
  6. php利用simple_html_dom类,获取页面内容,充当爬虫角色
  7. C# Winform 跨线程更新UI控件常用方法汇总(多线程访问UI控件)
  8. 251. Flatten 2D Vector 平铺二维矩阵
  9. [模板]LCA
  10. 黑马java课程2222