当前位置: 首页>>代码示例>>Java>>正文


Java PLMediaPlayer.ERROR_CODE_INVALID_URI属性代码示例

本文整理汇总了Java中com.pili.pldroid.player.PLMediaPlayer.ERROR_CODE_INVALID_URI属性的典型用法代码示例。如果您正苦于以下问题:Java PLMediaPlayer.ERROR_CODE_INVALID_URI属性的具体用法?Java PLMediaPlayer.ERROR_CODE_INVALID_URI怎么用?Java PLMediaPlayer.ERROR_CODE_INVALID_URI使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.pili.pldroid.player.PLMediaPlayer的用法示例。


在下文中一共展示了PLMediaPlayer.ERROR_CODE_INVALID_URI属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onError

@Override
public boolean onError(PLMediaPlayer mp, int errorCode) {
    switch (errorCode) {
        case PLMediaPlayer.ERROR_CODE_INVALID_URI:
            showToastTips("Invalid URL !");
            break;
        case PLMediaPlayer.ERROR_CODE_404_NOT_FOUND:
            showToastTips("404 resource not found !");
            break;
        case PLMediaPlayer.ERROR_CODE_CONNECTION_REFUSED:
            showToastTips("Connection refused !");
            break;
        case PLMediaPlayer.ERROR_CODE_CONNECTION_TIMEOUT:
            showToastTips("Connection timeout !");
            break;
        case PLMediaPlayer.ERROR_CODE_EMPTY_PLAYLIST:
            showToastTips("Empty playlist !");
            break;
        case PLMediaPlayer.ERROR_CODE_STREAM_DISCONNECTED:
            showToastTips("Stream disconnected !");
            break;
        case PLMediaPlayer.ERROR_CODE_IO_ERROR:
            showToastTips("Network IO Error !");
            break;
        case PLMediaPlayer.MEDIA_ERROR_UNKNOWN:
        default:
            showToastTips("unknown error !");
            break;
    }
    // Todo pls handle the error status here, retry or call finish()
    finish();
    // If you want to retry, do like this:
    // mVideoView.setVideoPath(mVideoPath);
    // mVideoView.start();
    // Return true means the error has been handled
    // If return false, then `onCompletion` will be called
    return true;
}
 
开发者ID:qq137712630,项目名称:MeiZiNews,代码行数:38,代码来源:PLVideoTextureActivity.java

示例2: getErrorMessage

private static String getErrorMessage(int code) {
    String msg;
    switch (code) {
        case PLMediaPlayer.ERROR_CODE_INVALID_URI:
            msg = "Invalid URL !";
            break;
        case PLMediaPlayer.ERROR_CODE_404_NOT_FOUND:
            msg = "404 resource not found !";
            break;
        case PLMediaPlayer.ERROR_CODE_CONNECTION_REFUSED:
            msg = "Connection refused !";
            break;
        case PLMediaPlayer.ERROR_CODE_CONNECTION_TIMEOUT:
            msg = "Connection timeout !";
            break;
        case PLMediaPlayer.ERROR_CODE_EMPTY_PLAYLIST:
            msg = "Empty playlist !";
            break;
        case PLMediaPlayer.ERROR_CODE_STREAM_DISCONNECTED:
            msg = "Stream disconnected !";
            break;
        case PLMediaPlayer.ERROR_CODE_IO_ERROR:
            msg = "Network IO Error !";
            break;
        case PLMediaPlayer.ERROR_CODE_UNAUTHORIZED:
            msg = "Unauthorized Error !";
            break;
        case PLMediaPlayer.ERROR_CODE_PREPARE_TIMEOUT:
            msg = "Prepare timeout !";
            break;
        case PLMediaPlayer.ERROR_CODE_READ_FRAME_TIMEOUT:
            msg = "Read frame timeout !";
            break;
        case PLMediaPlayer.MEDIA_ERROR_UNKNOWN:
        default:
            msg = "unknown error !";
            break;
    }
    return msg;
}
 
开发者ID:452MJ,项目名称:C9MJ,代码行数:40,代码来源:MediaException.java

示例3: onError

@Override
public boolean onError(PLMediaPlayer mp, int errorCode) {
    boolean isNeedReconnect = false;
    Log.e(TAG, "Error happened, errorCode = " + errorCode);
    switch (errorCode) {
        case PLMediaPlayer.ERROR_CODE_INVALID_URI:
            showToastTips("Invalid URL !");
            break;
        case PLMediaPlayer.ERROR_CODE_404_NOT_FOUND:
            showToastTips("404 resource not found !");
            break;
        case PLMediaPlayer.ERROR_CODE_CONNECTION_REFUSED:
            showToastTips("Connection refused !");
            break;
        case PLMediaPlayer.ERROR_CODE_CONNECTION_TIMEOUT:
            showToastTips("Connection timeout !");
            isNeedReconnect = true;
            break;
        case PLMediaPlayer.ERROR_CODE_EMPTY_PLAYLIST:
            showToastTips("Empty playlist !");
            break;
        case PLMediaPlayer.ERROR_CODE_STREAM_DISCONNECTED:
            showToastTips("Stream disconnected !");
            isNeedReconnect = true;
            break;
        case PLMediaPlayer.ERROR_CODE_IO_ERROR:
            showToastTips("Network IO Error !");
            isNeedReconnect = true;
            break;
        case PLMediaPlayer.ERROR_CODE_UNAUTHORIZED:
            showToastTips("Unauthorized Error !");
            break;
        case PLMediaPlayer.ERROR_CODE_PREPARE_TIMEOUT:
            showToastTips("Prepare timeout !");
            isNeedReconnect = true;
            break;
        case PLMediaPlayer.ERROR_CODE_READ_FRAME_TIMEOUT:
            showToastTips("Read frame timeout !");
            isNeedReconnect = true;
            break;
        case PLMediaPlayer.MEDIA_ERROR_UNKNOWN:
            break;
        default:
            showToastTips("unknown error !");
            break;
    }
    // Todo pls handle the error status here, reconnect or call finish()
    release();
    if (isNeedReconnect) {
        mActivity.onReConnecting();
        prepare();
    } else {
        mActivity.finish();
    }
    // Return true means the error has been handled
    // If return false, then `onCompletion` will be called
    return true;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:58,代码来源:LivePlayerHolder.java

示例4: onError

@Override
public boolean onError(PLMediaPlayer plMediaPlayer, int errorCode) {
    boolean isNeedReconnect = false;
    Log.e(TAG, "Error happened, errorCode = " + errorCode);
    switch (errorCode) {
        case PLMediaPlayer.ERROR_CODE_INVALID_URI:
            showToastTips("Invalid URL !");
            break;
        case PLMediaPlayer.ERROR_CODE_404_NOT_FOUND:
            showToastTips("404 resource not found !");
            break;
        case PLMediaPlayer.ERROR_CODE_CONNECTION_REFUSED:
            showToastTips("Connection refused !");
            break;
        case PLMediaPlayer.ERROR_CODE_CONNECTION_TIMEOUT:
            showToastTips("Connection timeout !");
            isNeedReconnect = true;
            break;
        case PLMediaPlayer.ERROR_CODE_EMPTY_PLAYLIST:
            showToastTips("Empty playlist !");
            break;
        case PLMediaPlayer.ERROR_CODE_STREAM_DISCONNECTED:
            showToastTips("Stream disconnected !");
            isNeedReconnect = true;
            break;
        case PLMediaPlayer.ERROR_CODE_IO_ERROR:
            showToastTips("Network IO Error !");
            isNeedReconnect = true;
            break;
        case PLMediaPlayer.ERROR_CODE_UNAUTHORIZED:
            showToastTips("Unauthorized Error !");
            break;
        case PLMediaPlayer.ERROR_CODE_PREPARE_TIMEOUT:
            showToastTips("Prepare timeout !");
            isNeedReconnect = true;
            break;
        case PLMediaPlayer.ERROR_CODE_READ_FRAME_TIMEOUT:
            showToastTips("Read frame timeout !");
            isNeedReconnect = true;
            break;
        case PLMediaPlayer.MEDIA_ERROR_UNKNOWN:
            break;
        default:
            showToastTips("unknown error !");
            break;
    }
    // Todo pls handle the error status here, reconnect or call finish()
    if (isNeedReconnect) {
        sendReconnectMessage();
    } else {
        finish();
    }
    // Return true means the error has been handled
    // If return false, then `onCompletion` will be called
    return true;
}
 
开发者ID:pili-engineering,项目名称:PLDroidRTCStreaming,代码行数:56,代码来源:PlaybackActivity.java

示例5: onError

@Override
public boolean onError(PLMediaPlayer mp, int errorCode) {
    Log.e(TAG, "Error happened, errorCode = " + errorCode);
    switch (errorCode) {
        case PLMediaPlayer.ERROR_CODE_INVALID_URI:
            showToastTips("Invalid URL !");
            break;
        case PLMediaPlayer.ERROR_CODE_404_NOT_FOUND:
            showToastTips("404 resource not found !");
            break;
        case PLMediaPlayer.ERROR_CODE_CONNECTION_REFUSED:
            showToastTips("Connection refused !");
            break;
        case PLMediaPlayer.ERROR_CODE_CONNECTION_TIMEOUT:
            showToastTips("Connection timeout !");
            break;
        case PLMediaPlayer.ERROR_CODE_EMPTY_PLAYLIST:
            showToastTips("Empty playlist !");
            break;
        case PLMediaPlayer.ERROR_CODE_STREAM_DISCONNECTED:
            showToastTips("Stream disconnected !");
            break;
        case PLMediaPlayer.ERROR_CODE_IO_ERROR:
            showToastTips("Network IO Error !");
            break;
        case PLMediaPlayer.MEDIA_ERROR_UNKNOWN:
        default:
            showToastTips("unknown error !");
            break;
    }
    // Todo pls handle the error status here, retry or call finish()
    finish();
    // The PLMediaPlayer has moved to the Error state, if you want to retry, must reset first !
    // try {
    //     mMediaPlayer.reset();
    //     mMediaPlayer.setDisplay(mSurfaceView.getHolder());
    //     mMediaPlayer.setDataSource(mVideoPath);
    //     mMediaPlayer.prepareAsync();
    // } catch (IOException e) {
    //     e.printStackTrace();
    // }
    // Return true means the error has been handled
    // If return false, then `onCompletion` will be called
    return true;
}
 
开发者ID:qq137712630,项目名称:MeiZiNews,代码行数:45,代码来源:PLMediaPlayerActivity.java


注:本文中的com.pili.pldroid.player.PLMediaPlayer.ERROR_CODE_INVALID_URI属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。