本文整理汇总了Java中android.widget.VideoView.seekTo方法的典型用法代码示例。如果您正苦于以下问题:Java VideoView.seekTo方法的具体用法?Java VideoView.seekTo怎么用?Java VideoView.seekTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.VideoView
的用法示例。
在下文中一共展示了VideoView.seekTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.widget.VideoView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
PreferencesState.getInstance().loadsLanguageInActivity();
setContentView(R.layout.video_activity);
//Displays a video file.
MediaController mediaController = new MediaController(VideoActivity.this);
mVideoView = (VideoView)findViewById(R.id.videoview);
String videoPathParam = getIntent().getStringExtra(VIDEO_PATH_PARAM);
mVideoView.setVideoPath(videoPathParam);
mVideoView.setMediaController(mediaController);
mediaController.setAnchorView(mVideoView);
mVideoView.requestFocus();
if (savedInstanceState != null) {
mVideoView.seekTo(savedInstanceState.getInt("video",0));
}
mVideoView.start();
}
示例2: onCreate
import android.widget.VideoView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
PreferencesState.getInstance().initalizateActivityDependencies();
setContentView(R.layout.video_activity);
//Displays a video file.
MediaController mediaController = new MediaController(VideoActivity.this);
mVideoView = (VideoView) findViewById(R.id.videoview);
String videoPathParam = getIntent().getStringExtra(VIDEO_PATH_PARAM);
File file = new File(videoPathParam);
if (file.exists()) {
mVideoView.setVideoPath(videoPathParam);
} else {
mVideoView.setVideoURI(FileIOUtils.getRawUri(videoPathParam));
}
mVideoView.setMediaController(mediaController);
mediaController.setAnchorView(mVideoView);
mVideoView.requestFocus();
if (savedInstanceState != null) {
mVideoView.seekTo(savedInstanceState.getInt("video", 0));
}
mVideoView.start();
}
示例3: onCreate
import android.widget.VideoView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
vv=new VideoView(this, null);
setContentView(vv,
new FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT,
Gravity.CENTER));
vv.setVideoURI(getIntent().getData());
vv.setOnCompletionListener(this);
vv.start();
if (savedInstanceState!=null) {
vv.seekTo(savedInstanceState.getInt(STATE_OFFSET, 0));
}
}