Java 类android.media.MediaPlayer.OnBufferingUpdateListener 实例源码

项目:letv    文件:VideoViewH264m3u8.java   
public void setOnBufferingUpdateListener(OnBufferingUpdateListener l) {
    this.mOnBufferingUpdateListener = l;
}
项目:letv    文件:VideoViewH264LeMobile.java   
public void setOnBufferingUpdateListener(OnBufferingUpdateListener l) {
    this.mOnBufferingUpdateListener = l;
}
项目:letv    文件:VideoViewH264m3u8Hw.java   
public void setOnBufferingUpdateListener(OnBufferingUpdateListener l) {
    this.mOnBufferingUpdateListener = l;
}
项目:letv    文件:VideoViewH264m3u8HwLeMobile.java   
public void setOnBufferingUpdateListener(OnBufferingUpdateListener l) {
    this.mOnBufferingUpdateListener = l;
}
项目:letv    文件:VideoViewH264mp4.java   
public void setOnBufferingUpdateListener(OnBufferingUpdateListener l) {
    this.mOnBufferingUpdateListener = l;
}
项目:letv    文件:VideoViewTV.java   
public void setOnBufferingUpdateListener(OnBufferingUpdateListener l) {
    this.mOnBufferingUpdateListener = l;
}
项目:letv    文件:VideoViewH264m3u8_4D.java   
public void setOnBufferingUpdateListener(OnBufferingUpdateListener l) {
    this.mOnBufferingUpdateListener = l;
}
项目:letv    文件:VideoViewH264LeMobile_4D.java   
public void setOnBufferingUpdateListener(OnBufferingUpdateListener l) {
    this.mOnBufferingUpdateListener = l;
}
项目:letv    文件:VideoViewH264mp4_4D.java   
public void setOnBufferingUpdateListener(OnBufferingUpdateListener l) {
    this.mOnBufferingUpdateListener = l;
}
项目:letv    文件:VideoViewH264m3u8Hw_4D.java   
public void setOnBufferingUpdateListener(OnBufferingUpdateListener l) {
    this.mOnBufferingUpdateListener = l;
}
项目:letv    文件:FFMpegPlayer.java   
public void setOnBufferingUpdateListener(OnBufferingUpdateListener listener) {
    this.mOnBufferingUpdateListener = listener;
}
项目:FullscreenVideoView    文件:FullscreenVideoView.java   
public void setOnBufferingUpdateListener(OnBufferingUpdateListener l) {
    if (mediaPlayer != null) {
        this.bufferingUpdateListener = l;
        this.mediaPlayer.setOnBufferingUpdateListener(this);
    } else throw new RuntimeException("Media Player is not initialized");
}
项目:huaxingtan_android    文件:MusicPlayerService.java   
public boolean setAudioItem(AudioItem item, 
        OnPreparedListener onPreparedListener, 
        OnSeekCompleteListener onSeekCompleteListener, 
        OnErrorListener onErrorListener,
        final OnBufferingUpdateListener onBufferingUpdateListener,
        OnCompletionListener onCompletionListener) {

    if (onPreparedListener != null)
        mMediaPlayer.setOnPreparedListener(onPreparedListener);

    if (onErrorListener != null)
        mMediaPlayer.setOnErrorListener(onErrorListener);

    MediaPlayer.OnBufferingUpdateListener bufferListenerProxy = new MediaPlayer.OnBufferingUpdateListener() {
        public void onBufferingUpdate(MediaPlayer mp, int percent) {
            if(percent == 100)
                doneBuffering = true;
            if (onBufferingUpdateListener != null)
                onBufferingUpdateListener.onBufferingUpdate(mp, percent);
        }
    };
    mMediaPlayer.setOnBufferingUpdateListener(bufferListenerProxy);


    if (onSeekCompleteListener != null)
        mMediaPlayer.setOnSeekCompleteListener(onSeekCompleteListener);

    if (onCompletionListener != null)
        mMediaPlayer.setOnCompletionListener(onCompletionListener);

    if (getNowPlayingId() != item.getFileId()) {
        mMediaPlayer.reset();
        mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
        mAudioItem = item;
        String URI = mAudioItem.getFileUrl();
        doneBuffering = false;
        if (mAudioItem.getStatus() == Status.FINISHED)
            URI = new File(this.getFilesDir(), mAudioItem.getPath()).getAbsolutePath();
            bufferListenerProxy.onBufferingUpdate(mMediaPlayer, 100);
        try {
            mMediaPlayer.setDataSource(URI);
        } catch (Exception e) {
            Log.d(TAG, "failed to load "+URI, e);
            doneBuffering = true;
            return false;
        }
        wifiLock();
        mMediaPlayer.prepareAsync();
    } else {
        if (onPreparedListener!=null)
            onPreparedListener.onPrepared(mMediaPlayer);
    }

    return true;
}
项目:letv    文件:LetvMediaPlayerControl.java   
void setOnBufferingUpdateListener(OnBufferingUpdateListener onBufferingUpdateListener);