本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}