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


Java VideoView.seekTo方法代码示例

本文整理汇总了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();
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:21,代码来源:VideoActivity.java

示例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();
}
 
开发者ID:EyeSeeTea,项目名称:malariapp,代码行数:26,代码来源:VideoActivity.java

示例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));
  }
}
 
开发者ID:commonsguy,项目名称:cwac-cam2,代码行数:17,代码来源:VideoPlayerActivity.java


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