本文整理汇总了Java中io.vov.vitamio.MediaPlayer.OnTimedTextListener类的典型用法代码示例。如果您正苦于以下问题:Java OnTimedTextListener类的具体用法?Java OnTimedTextListener怎么用?Java OnTimedTextListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OnTimedTextListener类属于io.vov.vitamio.MediaPlayer包,在下文中一共展示了OnTimedTextListener类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setOnTimedTextListener
import io.vov.vitamio.MediaPlayer.OnTimedTextListener; //导入依赖的package包/类
public void setOnTimedTextListener(OnTimedTextListener l) {
mOnTimedTextListener = l;
}
示例2: setOnTimedTextListener
import io.vov.vitamio.MediaPlayer.OnTimedTextListener; //导入依赖的package包/类
public void setOnTimedTextListener(OnTimedTextListener l) {
mOnTimedTextListener = l;
}
示例3: onCreate
import io.vov.vitamio.MediaPlayer.OnTimedTextListener; //导入依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
if (!LibsChecker.checkVitamioLibs(this))
return;
setContentView(R.layout.subtitle2);
mVideoView = (VideoView) findViewById(R.id.surface_view);
mSubtitleView = (TextView) findViewById(R.id.subtitle_view);
if (path == "") {
// Tell the user to provide a media file URL/path.
Toast.makeText(VideoViewSubtitle.this, "Please edit VideoViewSubtitle Activity, and set path" + " variable to your media file URL/path", Toast.LENGTH_LONG).show();
return;
} else {
/*
* Alternatively,for streaming media you can use
* mVideoView.setVideoURI(Uri.parse(URLstring));
*/
mVideoView.setVideoPath(path);
// mVideoView.setMediaController(new MediaController(this));
mVideoView.requestFocus();
mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
// optional need Vitamio 4.0
mediaPlayer.setPlaybackSpeed(1.0f);
mVideoView.addTimedTextSource(subtitle_path);
mVideoView.setTimedTextShown(true);
}
});
mVideoView.setOnTimedTextListener(new OnTimedTextListener() {
@Override
public void onTimedText(String text) {
mSubtitleView.setText(text);
}
@Override
public void onTimedTextUpdate(byte[] pixels, int width, int height) {
}
});
}
}