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


Java MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK属性代码示例

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


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

示例1: errToStr

private String errToStr(int framework_err, int impl_err) {
    String msg = null;
    if (framework_err == MediaPlayer.MEDIA_ERROR_IO) {
        msg = "IO Error";
    } else if (framework_err == MediaPlayer.MEDIA_ERROR_MALFORMED) {
        msg = "Bitstream unsupported";
    } else if (framework_err == MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK) {
        msg = "Invalid progressive playback";
    } else if (framework_err == MediaPlayer.MEDIA_ERROR_TIMED_OUT) {
        msg = "Operation time out";
    } else if (framework_err == MediaPlayer.MEDIA_ERROR_SERVER_DIED) {
        msg = "MediaPlayer died";
    } else if (framework_err == MediaPlayer.MEDIA_ERROR_UNSUPPORTED) {
        msg = "File spec is not supported in the media framework";
    } else if (framework_err == MediaPlayer.MEDIA_ERROR_UNKNOWN) {
        msg = "Unknown error";
    }
    return msg;
}
 
开发者ID:TedaLIEz,项目名称:ParsingPlayer,代码行数:19,代码来源:ParsingPlayerProxy.java

示例2: onError

@Override
public boolean onError(MediaPlayer mp, int what, int extra) {
    //Invoked when there has been an error during an asynchronous operation
    switch (what) {
        case MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK:
            Log.d("MediaPlayer Error", "MEDIA ERROR NOT VALID FOR PROGRESSIVE PLAYBACK " + extra);
            break;
        case MediaPlayer.MEDIA_ERROR_SERVER_DIED:
            Log.d("MediaPlayer Error", "MEDIA ERROR SERVER DIED " + extra);
            break;
        case MediaPlayer.MEDIA_ERROR_UNKNOWN:
            Log.d("MediaPlayer Error", "MEDIA ERROR UNKNOWN " + extra);
            break;
    }
    return false;
}
 
开发者ID:Vinetos,项目名称:Hello-Music-droid,代码行数:16,代码来源:AudioService.java

示例3: onError

public boolean onError(IMediaPlayer mp, int framework_err, int impl_err) {
    Log.d(TAG, "Error: " + framework_err + "," + impl_err);
    mCurrentState = STATE_ERROR;
    mTargetState = STATE_ERROR;
    if (mMediaController != null) {
        mMediaController.hide();
    }

    /* If an error handler has been supplied, use it and finish. */
    if (mOnErrorListener != null) {
        if (mOnErrorListener.onError(mMediaPlayer, framework_err, impl_err)) {
            return true;
        }
    }

    /* Otherwise, pop up an error dialog so the user knows that
     * something bad has happened. Only try and pop up the dialog
     * if we're attached to a window. When we're going away and no
     * longer have a window, don't bother showing the user an error.
     */
    if (getWindowToken() != null) {
        Resources r = mAppContext.getResources();
        String message="Unknown error";

        if (framework_err == MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK) {
            message="Invalid progressive playback";
        }

        new AlertDialog.Builder(getContext())
                .setMessage(message)
                .setPositiveButton("error",
                        new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int whichButton) {
                            /* If we get here, there is no onError listener, so
                             * at least inform them that the video is over.
                             */
                                if (mOnCompletionListener != null) {
                                    mOnCompletionListener.onCompletion(mMediaPlayer);
                                }
                            }
                        })
                .setCancelable(false)
                .show();
    }
    return true;
}
 
开发者ID:WeDevelopTeam,项目名称:HeroVideo-master,代码行数:46,代码来源:MediaPlayerView.java

示例4: onError

public boolean onError(IMediaPlayer mp, int framework_err, int impl_err)
{
    Log.d(TAG, "Error: " + framework_err + "," + impl_err);
    mCurrentState = STATE_ERROR;
    mTargetState = STATE_ERROR;
    if (mMediaController != null)
    {
        mMediaController.hide();
    }
    
    /* If an error handler has been supplied, use it and finish. */
    if (mOnErrorListener != null)
    {
        if (mOnErrorListener.onError(mMediaPlayer, framework_err, impl_err))
        {
            return true;
        }
    }
    
    /*
     * Otherwise, pop up an error dialog so the user knows that something bad has happened. Only try and pop up
     * the dialog if we're attached to a window. When we're going away and no longer have a window, don't bother
     * showing the user an error.
     */
    if (getWindowToken() != null)
    {
        Resources r = mAppContext.getResources();
        int messageId;
        
        if (framework_err == MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK)
        {
            messageId = R.string.VideoView_error_text_invalid_progressive_playback;
        }
        else
        {
            messageId = R.string.VideoView_error_text_unknown;
        }
        
        new AlertDialog.Builder(getContext()).setMessage(messageId)
            .setPositiveButton(R.string.VideoView_error_button, new DialogInterface.OnClickListener()
            {
                public void onClick(DialogInterface dialog, int whichButton)
                {
                    /*
                     * If we get here, there is no onError listener, so at least inform them that the video is
                     * over.
                     */
                    if (mOnCompletionListener != null)
                    {
                        mOnCompletionListener.onCompletion(mMediaPlayer);
                    }
                }
            })
            .setCancelable(false)
            .show();
    }
    return true;
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:58,代码来源:IjkVideoView.java

示例5: onError

public boolean onError(IMediaPlayer mp, int framework_err, int impl_err) {
    Log.d(TAG, "Error: " + framework_err + "," + impl_err);
    mCurrentState = STATE_ERROR;
    mTargetState = STATE_ERROR;
    if (mMediaController != null) {
        mMediaController.hide();
    }

    /* If an error handler has been supplied, use it and finish. */
    if (mOnErrorListener != null) {
        if (mOnErrorListener.onError(mMediaPlayer, framework_err, impl_err)) {
            return true;
        }
    }

    /* Otherwise, pop up an error dialog so the user knows that
     * something bad has happened. Only try and pop up the dialog
     * if we're attached to a window. When we're going away and no
     * longer have a window, don't bother showing the user an error.
     */
    if (getWindowToken() != null) {
        Resources r = mAppContext.getResources();
        int messageId;

        if (framework_err == MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK) {
            messageId = R.string.VideoView_error_text_invalid_progressive_playback;
        } else {
            messageId = R.string.VideoView_error_text_unknown;
        }

        new AlertDialog.Builder(getContext())
                .setMessage(messageId)
                .setPositiveButton(R.string.VideoView_error_button,
                        new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int whichButton) {
                            /* If we get here, there is no onError listener, so
                             * at least inform them that the video is over.
                             */
                                if (mOnCompletionListener != null) {
                                    mOnCompletionListener.onCompletion(mMediaPlayer);
                                }
                            }
                        })
                .setCancelable(false)
                .show();
    }
    return true;
}
 
开发者ID:wheat7,项目名称:VRPlayer,代码行数:48,代码来源:PlayerView.java


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