本文整理汇总了Java中android.media.MediaPlayer.OnSeekCompleteListener类的典型用法代码示例。如果您正苦于以下问题:Java OnSeekCompleteListener类的具体用法?Java OnSeekCompleteListener怎么用?Java OnSeekCompleteListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OnSeekCompleteListener类属于android.media.MediaPlayer包,在下文中一共展示了OnSeekCompleteListener类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initPlay
import android.media.MediaPlayer.OnSeekCompleteListener; //导入依赖的package包/类
public void initPlay() {
// 跳到指定位置播放,一种是暂停位置,一种是拖动后的位置
mediaPlayer.setOnSeekCompleteListener(new OnSeekCompleteListener() {
@Override
public void onSeekComplete(MediaPlayer mp) {
Intent intent = new Intent();
intent.setAction("seekComplete");
if (secondPause != -1) {
intent.putExtra("seek", false);
intent.putExtra("pause", secondPause);
} else {
intent.putExtra("seek", Msg_Music.SEEK);
}
sendBroadcast(intent);
}
});
}
开发者ID:pengbing92,项目名称:MyMusicPlayer,代码行数:23,代码来源:MyMusicService.java
示例2: setOnSeekCompleteListener
import android.media.MediaPlayer.OnSeekCompleteListener; //导入依赖的package包/类
public void setOnSeekCompleteListener(OnSeekCompleteListener l) {
this.mOnSeekCompleteListener = l;
}
开发者ID:JackChan1999,项目名称:letv,代码行数:4,代码来源:VideoViewH264m3u8.java
示例3: getOnSeekCompleteListener
import android.media.MediaPlayer.OnSeekCompleteListener; //导入依赖的package包/类
public OnSeekCompleteListener getOnSeekCompleteListener() {
return this.mOnSeekCompleteListener;
}
开发者ID:JackChan1999,项目名称:letv,代码行数:4,代码来源:VideoViewTV.java
示例4: setOnSeekCompleteListener
import android.media.MediaPlayer.OnSeekCompleteListener; //导入依赖的package包/类
public void setOnSeekCompleteListener(OnSeekCompleteListener mOnSeekCompleteListener) {
this.mOnSeekCompleteListener = mOnSeekCompleteListener;
}
开发者ID:JackChan1999,项目名称:letv,代码行数:4,代码来源:VideoViewTV.java
示例5: setOnSeekCompleteListener
import android.media.MediaPlayer.OnSeekCompleteListener; //导入依赖的package包/类
public void setOnSeekCompleteListener(OnSeekCompleteListener listener) {
this.mOnSeekCompleteListener = listener;
}
开发者ID:JackChan1999,项目名称:letv,代码行数:4,代码来源:FFMpegPlayer.java
示例6: setOnSeekCompleteListener
import android.media.MediaPlayer.OnSeekCompleteListener; //导入依赖的package包/类
public void setOnSeekCompleteListener(OnSeekCompleteListener l) {
if (mediaPlayer != null)
this.seekCompleteListener = l;
else throw new RuntimeException("Media Player is not initialized");
}
开发者ID:rtoshiro,项目名称:FullscreenVideoView,代码行数:6,代码来源:FullscreenVideoView.java
示例7: setAudioItem
import android.media.MediaPlayer.OnSeekCompleteListener; //导入依赖的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
示例8: setOnSeekCompleteListener
import android.media.MediaPlayer.OnSeekCompleteListener; //导入依赖的package包/类
void setOnSeekCompleteListener(OnSeekCompleteListener onSeekCompleteListener);
开发者ID:JackChan1999,项目名称:letv,代码行数:2,代码来源:LetvMediaPlayerControl.java
注:本文中的android.media.MediaPlayer.OnSeekCompleteListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论