• 开源播放器 ijkplayer (四) :Ijkplayer切换网络时停止播放的问题处理


    问题起因:

    在进行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,
    };
    
  • 相关阅读:
    JS---案例:拖曳对话框
    关于选用ccflow你所担心的问题都在这里为您解答
    Elasticsearch(GEO)数据写入和空间检索
    echart的legend不显示问题
    html5+css3的神奇搭配
    h5+css3+Jq
    初探 jQuery
    在vi编辑器中如何向上翻页,向下翻页以及查询“ab”
    webpack4 特性
    webpack4配置
  • 原文地址:https://www.cnblogs.com/renhui/p/8569026.html
Copyright © 2020-2023  润新知