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


Java OnBufferingUpdateListener类代码示例

本文整理汇总了Java中android.media.MediaPlayer.OnBufferingUpdateListener的典型用法代码示例。如果您正苦于以下问题:Java OnBufferingUpdateListener类的具体用法?Java OnBufferingUpdateListener怎么用?Java OnBufferingUpdateListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: setOnBufferingUpdateListener

import android.media.MediaPlayer.OnBufferingUpdateListener; //导入依赖的package包/类
public void setOnBufferingUpdateListener(OnBufferingUpdateListener l) {
    this.mOnBufferingUpdateListener = l;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:4,代码来源:VideoViewH264m3u8.java

示例2: setOnBufferingUpdateListener

import android.media.MediaPlayer.OnBufferingUpdateListener; //导入依赖的package包/类
public void setOnBufferingUpdateListener(OnBufferingUpdateListener listener) {
    this.mOnBufferingUpdateListener = listener;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:4,代码来源:FFMpegPlayer.java

示例3: setOnBufferingUpdateListener

import android.media.MediaPlayer.OnBufferingUpdateListener; //导入依赖的package包/类
public void setOnBufferingUpdateListener(OnBufferingUpdateListener l) {
    if (mediaPlayer != null) {
        this.bufferingUpdateListener = l;
        this.mediaPlayer.setOnBufferingUpdateListener(this);
    } else throw new RuntimeException("Media Player is not initialized");
}
 
开发者ID:rtoshiro,项目名称:FullscreenVideoView,代码行数:7,代码来源:FullscreenVideoView.java

示例4: setAudioItem

import android.media.MediaPlayer.OnBufferingUpdateListener; //导入依赖的package包/类
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;
}
 
开发者ID:scv119,项目名称:huaxingtan_android,代码行数:56,代码来源:MusicPlayerService.java

示例5: setOnBufferingUpdateListener

import android.media.MediaPlayer.OnBufferingUpdateListener; //导入依赖的package包/类
void setOnBufferingUpdateListener(OnBufferingUpdateListener onBufferingUpdateListener); 
开发者ID:JackChan1999,项目名称:letv,代码行数:2,代码来源:LetvMediaPlayerControl.java


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