當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。