當前位置: 首頁>>代碼示例>>Java>>正文


Java MediaPlayer.MEDIA_INFO_BUFFERING_START屬性代碼示例

本文整理匯總了Java中android.media.MediaPlayer.MEDIA_INFO_BUFFERING_START屬性的典型用法代碼示例。如果您正苦於以下問題:Java MediaPlayer.MEDIA_INFO_BUFFERING_START屬性的具體用法?Java MediaPlayer.MEDIA_INFO_BUFFERING_START怎麽用?Java MediaPlayer.MEDIA_INFO_BUFFERING_START使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.media.MediaPlayer的用法示例。


在下文中一共展示了MediaPlayer.MEDIA_INFO_BUFFERING_START屬性的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onInfo

@Override
public boolean onInfo(MediaPlayer mp, int what, int extra) {
    switch (what) {
        case MediaPlayer.MEDIA_INFO_BUFFERING_START:
            mEventEmitter.receiveEvent(getId(), Events.EVENT_STALLED.toString(), Arguments.createMap());
            break;
        case MediaPlayer.MEDIA_INFO_BUFFERING_END:
            mEventEmitter.receiveEvent(getId(), Events.EVENT_RESUME.toString(), Arguments.createMap());
            break;
        case MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
            mEventEmitter.receiveEvent(getId(), Events.EVENT_READY_FOR_DISPLAY.toString(), Arguments.createMap());
            break;

        default:
    }
    return false;
}
 
開發者ID:12d,項目名稱:react-native-videoplayer,代碼行數:17,代碼來源:ReactVideoView.java

示例2: onInfo

@Override
public boolean onInfo(MediaPlayer mp, int what, int extra) {
        switch (what) {
                case MediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
                        // 音頻和視頻數據不正確
                        break;
                case MediaPlayer.MEDIA_INFO_BUFFERING_START:
                        if (!isFinishing())
                                mVideoView.pause();
                        break;
                case MediaPlayer.MEDIA_INFO_BUFFERING_END:
                        if (!isFinishing())
                                mVideoView.start();
                        break;
                case MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
                        if (DeviceUtils.hasJellyBean()) {
                                mVideoView.setBackground(null);
                        } else {
                                mVideoView.setBackgroundDrawable(null);
                        }
                        break;
        }
        return false;
}
 
開發者ID:HelloChenJinJun,項目名稱:TestChat,代碼行數:24,代碼來源:VideoPlayActivity.java

示例3: onInfo

@Override
public boolean onInfo(MediaPlayer mp, int what, int extra) {
        switch (what) {
                case MediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
                        // 音頻和視頻數據不正確
                        break;
                case MediaPlayer.MEDIA_INFO_BUFFERING_START:
                        if (!isFinishing())
                                mSurfaceVideoView.pause();
                        break;
                case MediaPlayer.MEDIA_INFO_BUFFERING_END:
                        if (!isFinishing())
                                mSurfaceVideoView.start();
                        break;
                case MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
                        if (DeviceUtils.hasJellyBean()) {
                                mSurfaceVideoView.setBackground(null);
                        } else {
                                mSurfaceVideoView.setBackgroundDrawable(null);
                        }
                        break;
        }
        return false;
}
 
開發者ID:HelloChenJinJun,項目名稱:TestChat,代碼行數:24,代碼來源:ImageDisplayActivity.java

示例4: onInfo

public void onInfo(int what, int extra) {
    Log.d(TAG, "onInfo what - " + what + " extra - " + extra);
    if (what == MediaPlayer.MEDIA_INFO_BUFFERING_START) {
        if (currentState == CURRENT_STATE_PLAYING_BUFFERING_START) return;
        BACKUP_PLAYING_BUFFERING_STATE = currentState;
        onStatePlaybackBufferingStart();
        Log.d(TAG, "MEDIA_INFO_BUFFERING_START");
    } else if (what == MediaPlayer.MEDIA_INFO_BUFFERING_END) {
        if (BACKUP_PLAYING_BUFFERING_STATE != -1) {
            if (currentState == CURRENT_STATE_PLAYING_BUFFERING_START) {
                setState(BACKUP_PLAYING_BUFFERING_STATE);
            }
            BACKUP_PLAYING_BUFFERING_STATE = -1;
        }
        Log.d(TAG, "MEDIA_INFO_BUFFERING_END");
    }
}
 
開發者ID:Wilshion,項目名稱:HeadlineNews,代碼行數:17,代碼來源:JCVideoPlayer.java

示例5: onInfo

@Override
public boolean onInfo(MediaPlayer mp, int what, int extra) {

    switch (what) {
        case MediaPlayer.MEDIA_INFO_UNKNOWN:
            LogHelper.i(LOG_TAG, "Unknown media info");
            break;
        case MediaPlayer.MEDIA_INFO_BUFFERING_START:
            LogHelper.i(LOG_TAG, "Buffering started");
            break;
        case MediaPlayer.MEDIA_INFO_BUFFERING_END:
            LogHelper.i(LOG_TAG, "Buffering finished");
            break;
        case MediaPlayer.MEDIA_INFO_METADATA_UPDATE: // case never selected
            LogHelper.i(LOG_TAG, "New metadata available");
            break;
        default:
            LogHelper.i(LOG_TAG, "other case of media info");
            break;
    }

    return true;
}
 
開發者ID:malah-code,項目名稱:Open-Quran-Radio,代碼行數:23,代碼來源:PlayerService.java

示例6: onInfo

public void onInfo(int what, int extra) {
    Log.d(TAG, "onInfo what - " + what + " extra - " + extra);
    if (what == MediaPlayer.MEDIA_INFO_BUFFERING_START) {
        if (currentState == CURRENT_STATE_PLAYING_BUFFERING_START) return;
        BACKUP_PLAYING_BUFFERING_STATE = currentState;
        setUiWitStateAndScreen(CURRENT_STATE_PLAYING_BUFFERING_START);//沒這個case
        Log.d(TAG, "MEDIA_INFO_BUFFERING_START");
    } else if (what == MediaPlayer.MEDIA_INFO_BUFFERING_END) {
        if (BACKUP_PLAYING_BUFFERING_STATE != -1) {
            setUiWitStateAndScreen(BACKUP_PLAYING_BUFFERING_STATE);
            BACKUP_PLAYING_BUFFERING_STATE = -1;
        }
        Log.d(TAG, "MEDIA_INFO_BUFFERING_END");
    }
}
 
開發者ID:Longalei,項目名稱:Edu,代碼行數:15,代碼來源:JCVideoPlayer.java

示例7: onInfo

public void onInfo(int what, int extra) {
    Log.d(TAG, "onInfo what - " + what + " extra - " + extra);
    if (what == MediaPlayer.MEDIA_INFO_BUFFERING_START) {
        BACKUP_PLAYING_BUFFERING_STATE = currentState;
        setUiWitStateAndScreen(CURRENT_STATE_PLAYING_BUFFERING_START);//沒這個case
        Log.d(TAG, "MEDIA_INFO_BUFFERING_START");
    } else if (what == MediaPlayer.MEDIA_INFO_BUFFERING_END) {
        if (BACKUP_PLAYING_BUFFERING_STATE != -1) {
            setUiWitStateAndScreen(BACKUP_PLAYING_BUFFERING_STATE);
            BACKUP_PLAYING_BUFFERING_STATE = -1;
        }
        Log.d(TAG, "MEDIA_INFO_BUFFERING_END");
    }
}
 
開發者ID:snowwolf10285,項目名稱:PicShow-zhaipin,代碼行數:14,代碼來源:JCVideoPlayer.java

示例8: onInfo

public boolean onInfo(MediaPlayer mp, int arg1, int arg2) {
                    switch (arg1) {
                        case MediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING:
                            Log.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING:");
                            break;
                        case MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
//                            Log.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START:" + " renderView == SurfaceView : " + (mCurrentRender==RENDER_SURFACE_VIEW));
                            Log.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START");
                            mSeekWhenPrepared = 0;
                            onPlayerEvent(OnPlayerEventListener.EVENT_CODE_RENDER_START,null);
                            break;
                        case MediaPlayer.MEDIA_INFO_BUFFERING_START:
                            Log.d(TAG, "MEDIA_INFO_BUFFERING_START:");
                            onPlayerEvent(OnPlayerEventListener.EVENT_CODE_BUFFERING_START,null);
                            break;
                        case MediaPlayer.MEDIA_INFO_BUFFERING_END:
                            Log.d(TAG, "MEDIA_INFO_BUFFERING_END:");
                            onPlayerEvent(OnPlayerEventListener.EVENT_CODE_BUFFERING_END,null);
                            break;
                        case MediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
                            Log.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING:");
                            break;
                        case MediaPlayer.MEDIA_INFO_NOT_SEEKABLE:
                            Log.d(TAG, "MEDIA_INFO_NOT_SEEKABLE:");
                            break;
                        case MediaPlayer.MEDIA_INFO_METADATA_UPDATE:
                            Log.d(TAG, "MEDIA_INFO_METADATA_UPDATE:");
                            break;
                        case MediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE:
                            Log.d(TAG, "MEDIA_INFO_UNSUPPORTED_SUBTITLE:");
                            break;
                        case MediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT:
                            Log.d(TAG, "MEDIA_INFO_SUBTITLE_TIMED_OUT:");
                            break;
                    }
                    return true;
                }
 
開發者ID:jiajunhui,項目名稱:PlayerBase,代碼行數:37,代碼來源:DefaultVideoView.java

示例9: onInfo

public boolean onInfo(MediaPlayer mp, int arg1, int arg2) {
                    switch (arg1) {
                        case MediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING:
                            Log.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING:");
                            break;
                        case MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
//                            Log.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START:" + " renderView == SurfaceView : " + (mCurrentRender==RENDER_SURFACE_VIEW));
                            Log.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START");
                            startSeekPos = 0;
                            onPlayerEvent(OnPlayerEventListener.EVENT_CODE_RENDER_START,null);
                            break;
                        case MediaPlayer.MEDIA_INFO_BUFFERING_START:
                            Log.d(TAG, "MEDIA_INFO_BUFFERING_START:");
                            onPlayerEvent(OnPlayerEventListener.EVENT_CODE_BUFFERING_START,null);
                            break;
                        case MediaPlayer.MEDIA_INFO_BUFFERING_END:
                            Log.d(TAG, "MEDIA_INFO_BUFFERING_END:");
                            onPlayerEvent(OnPlayerEventListener.EVENT_CODE_BUFFERING_END,null);
                            break;
                        case MediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
                            Log.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING:");
                            break;
                        case MediaPlayer.MEDIA_INFO_NOT_SEEKABLE:
                            Log.d(TAG, "MEDIA_INFO_NOT_SEEKABLE:");
                            break;
                        case MediaPlayer.MEDIA_INFO_METADATA_UPDATE:
                            Log.d(TAG, "MEDIA_INFO_METADATA_UPDATE:");
                            break;
                        case MediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE:
                            Log.d(TAG, "MEDIA_INFO_UNSUPPORTED_SUBTITLE:");
                            break;
                        case MediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT:
                            Log.d(TAG, "MEDIA_INFO_SUBTITLE_TIMED_OUT:");
                            break;
                    }
                    return true;
                }
 
開發者ID:jiajunhui,項目名稱:PlayerBase,代碼行數:37,代碼來源:DefaultDecoderPlayer.java

示例10: onInfo

@Override
public boolean onInfo(MediaPlayer mp, int what, int extra) {
    // 當一些特定信息出現或者警告時觸發
    Log.d(TAG, "INFO = " + what + "/" + extra);
    switch (what) {
        case MediaPlayer.MEDIA_INFO_BAD_INTERLEAVING:
            Log.d(TAG, "MEDIA_INFO_BAD_INTERLEAVING");
            break;
        case MediaPlayer.MEDIA_INFO_METADATA_UPDATE:
            Log.d(TAG, "MEDIA_INFO_METADATA_UPDATE");
            break;
        case MediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING:
            Log.d(TAG, "MEDIA_INFO_VIDEO_TRACK_LAGGING");
            break;
        case MediaPlayer.MEDIA_INFO_NOT_SEEKABLE:
            Log.d(TAG, "MEDIA_INFO_NOT_SEEKABLE");
            break;
        case MediaPlayer.MEDIA_INFO_BUFFERING_START:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_START");
            if (mVideoView.isPlaying()) {
                mVideoView.pause();
                mLoadingView.setVisibility(View.VISIBLE);
            }
            break;
        case MediaPlayer.MEDIA_INFO_BUFFERING_END:
            Log.d(TAG, "MEDIA_INFO_BUFFERING_END");
            mVideoView.start();
            mLoadingView.setVisibility(View.GONE);
            break;
        case MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
            Log.d(TAG, "MEDIA_INFO_VIDEO_RENDERING_START");
            mLoadingView.setVisibility(View.GONE);
            break;
    }
    return true;
}
 
開發者ID:liying2008,項目名稱:Simpler,代碼行數:36,代碼來源:VideoPlayerActivity.java

示例11: onInfo

public void onInfo(int what, int extra) {
    Log.d(TAG, "onInfo what - " + what + " extra - " + extra);
    if (what == MediaPlayer.MEDIA_INFO_BUFFERING_START) {
        if (currentState == CURRENT_STATE_PLAYING_BUFFERING_START) return;
        BACKUP_PLAYING_BUFFERING_STATE = currentState;
        onStateAction(CURRENT_STATE_PLAYING_BUFFERING_START);//沒這個case
        Log.d(TAG, "MEDIA_INFO_BUFFERING_START");
    } else if (what == MediaPlayer.MEDIA_INFO_BUFFERING_END) {
        if (BACKUP_PLAYING_BUFFERING_STATE != -1) {
            onStateAction(BACKUP_PLAYING_BUFFERING_STATE);
            BACKUP_PLAYING_BUFFERING_STATE = -1;
        }
        Log.d(TAG, "MEDIA_INFO_BUFFERING_END");
    }
}
 
開發者ID:qq1210514049,項目名稱:ListVideoPlayer,代碼行數:15,代碼來源:ListVideoPlayer.java

示例12: onInfo

@Override
public boolean onInfo(io.vov.vitamio.MediaPlayer mp, int what, int extra) {
    switch (what) {
        case MediaPlayer.MEDIA_INFO_BUFFERING_START://視頻卡住了
            mBufferView.setVisibility(View.VISIBLE);
            break;
        case MediaPlayer.MEDIA_INFO_BUFFERING_END://視頻緩衝結束了
            mBufferView.setVisibility(View.INVISIBLE);
            break;
    }
    return false;
}
 
開發者ID:iPanelkegy,項目名稱:MobileMedia,代碼行數:12,代碼來源:VitamioVideoPlayerActivity.java

示例13: onInfo

@Override
public boolean onInfo(MediaPlayer mp, int what, int extra) {
    switch (what) {
        case MediaPlayer.MEDIA_INFO_BUFFERING_START://視頻卡住了
            mBufferView.setVisibility(View.VISIBLE);
            break;
        case MediaPlayer.MEDIA_INFO_BUFFERING_END://視頻緩衝結束了
            mBufferView.setVisibility(View.INVISIBLE);
            break;
    }
    return false;
}
 
開發者ID:iPanelkegy,項目名稱:MobileMedia,代碼行數:12,代碼來源:SystemVideoPlayerActivity.java


注:本文中的android.media.MediaPlayer.MEDIA_INFO_BUFFERING_START屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。