根据枚举HashCode转换为对应枚举值

    private void OnLiveError(int iCode, int iCodeExtra)
    {
        MEDIAPLAYER_ERROR liveError = (MEDIAPLAYER_ERROR)Enum.Parse(typeof(MEDIAPLAYER_ERROR), iCode.ToString());
        MEDIAPLAYER_ERROR liveErrorExtra = (MEDIAPLAYER_ERROR)Enum.Parse(typeof(MEDIAPLAYER_ERROR), iCodeExtra.ToString());
        switch (liveError)
        {
            case MEDIAPLAYER_ERROR.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK:
                break;
            case MEDIAPLAYER_ERROR.MEDIA_ERROR_SERVER_DIED:
                break;
            case MEDIAPLAYER_ERROR.MEDIA_ERROR_UNKNOWN:
                break;
            default:
                break;
        }
        switch (liveErrorExtra)
        {
            case MEDIAPLAYER_ERROR.MEDIA_ERROR_IO:
                break;
            case MEDIAPLAYER_ERROR.MEDIA_ERROR_MALFORMED:
                break;
            case MEDIAPLAYER_ERROR.MEDIA_ERROR_TIMED_OUT:
                break;
            case MEDIAPLAYER_ERROR.MEDIA_ERROR_UNSUPPORTED:
                break;
            default:
                break;
        }
    }
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页