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


Java VideoView.requestFocus方法代码示例

本文整理汇总了Java中io.vov.vitamio.widget.VideoView.requestFocus方法的典型用法代码示例。如果您正苦于以下问题:Java VideoView.requestFocus方法的具体用法?Java VideoView.requestFocus怎么用?Java VideoView.requestFocus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.vov.vitamio.widget.VideoView的用法示例。


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

示例1: setStreamUrl

import io.vov.vitamio.widget.VideoView; //导入方法依赖的package包/类
@ReactProp(name = "streamUrl")
public void setStreamUrl(VideoView view, @Nullable String streamUrl) {
  if (!LibsChecker.checkVitamioLibs(mActivity))
    return;

  view.setVideoPath(streamUrl);

  view.setMediaController(new MediaController(mContext));
  view.requestFocus();

  view.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
    @Override
    public void onPrepared(MediaPlayer mediaPlayer) {
      // optional need Vitamio 4.0
      mediaPlayer.setPlaybackSpeed(1.0f);
    }
  });
}
 
开发者ID:sejoker,项目名称:react-native-android-vitamio,代码行数:19,代码来源:VitamioViewManager.java

示例2: initPlay

import io.vov.vitamio.widget.VideoView; //导入方法依赖的package包/类
public void initPlay() {
        mVideoView = (VideoView) findViewById(R.id.surface_view);
        if (!isVideoPlayerOK) return;
//        videoPath = FileUtils.getFileRootPath() + "/" + projectSlug + Config.VideosFolder + "/" + resourceSlug + ".mp4";
        if (!(videoPath == null || videoPath.equals(""))) {
            mVideoView.setVideoURI(Uri.parse(videoPath));
        }

//        Log.w(TAG, videoPath);
        mVideoView.requestFocus();
        mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
            @Override
            public void onPrepared(MediaPlayer mediaPlayer) {
                // optional need Vitamio 4.0
                Log.i(TAG, "onPrepared");
                mediaPlayer.setPlaybackSpeed(1.0f);
                mVideoView.addTimedTextSource(FileUtils.getFileRootPath() + "/" + projectSlug + Config.SourceFolder + "/" + resourceSlug + ".srt");
                mVideoView.setOnTimedTextListener(TranslateActivity.this);
                mVideoView.setTimedTextShown(true);
            }
        });
    }
 
开发者ID:edu-infinity,项目名称:eduinfinity-translateHelper,代码行数:23,代码来源:TranslateActivity.java

示例3: onCreate

import io.vov.vitamio.widget.VideoView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle bundle) {
	super.onCreate(bundle);

	// ~~~ 获取播放地址和标题
	Intent intent = getIntent();
	mPath = intent.getStringExtra("path");
	mTitle = intent.getStringExtra("title");
       Log.i(">>>url play:", mPath);
	// ~~~ 绑定控件
	setContentView(R.layout.videoview);
	mVideoView = (VideoView) findViewById(R.id.surface_view);
	mVolumeBrightnessLayout = findViewById(R.id.operation_volume_brightness);
	mOperationBg = (ImageView) findViewById(R.id.operation_bg);
	mOperationPercent = (ImageView) findViewById(R.id.operation_percent);
	mLoadingView = findViewById(R.id.video_loading);

	// ~~~ 绑定事件
	mVideoView.setOnCompletionListener(this);
	mVideoView.setOnInfoListener(this);

	// ~~~ 绑定数据
	mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
	mMaxVolume = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
	if (mPath.startsWith("http:"))
		mVideoView.setVideoURI(Uri.parse(mPath));
	else
		mVideoView.setVideoPath(mPath);

	//设置显示名称
	mMediaController = new MediaController(this);
	mMediaController.setFileName(mTitle);
	mVideoView.setMediaController(mMediaController);
	mVideoView.requestFocus();

	mGestureDetector = new GestureDetector(this, new MyGestureListener());
	setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:39,代码来源:VideoPlayerActivity.java

示例4: onCreate

import io.vov.vitamio.widget.VideoView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
  super.onCreate(icicle);
  if (!LibsChecker.checkVitamioLibs(this))
    return;
  setContentView(R.layout.videobuffer);
  mVideoView = (VideoView) findViewById(R.id.buffer);
  pb = (ProgressBar) findViewById(R.id.probar);

  downloadRateView = (TextView) findViewById(R.id.download_rate);
  loadRateView = (TextView) findViewById(R.id.load_rate);
  if (path == "") {
    // Tell the user to provide a media file URL/path.
    Toast.makeText(
        VideoViewBuffer.this,
        "Please edit VideoBuffer 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));
     */
    uri = Uri.parse(path);
    mVideoView.setVideoURI(uri);
    mVideoView.setMediaController(new MediaController(this));
    mVideoView.requestFocus();
    mVideoView.setOnInfoListener(this);
    mVideoView.setOnBufferingUpdateListener(this);
    mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
      @Override
      public void onPrepared(MediaPlayer mediaPlayer) {
        // optional need Vitamio 4.0
        mediaPlayer.setPlaybackSpeed(1.0f);
      }
    });
  }

}
 
开发者ID:AJRdev,项目名称:ARDrone-Android-GEII,代码行数:40,代码来源:VideoViewBuffer.java

示例5: onCreate

import io.vov.vitamio.widget.VideoView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
	super.onCreate(icicle);
	if (!LibsChecker.checkVitamioLibs(this))
		return;
	setContentView(R.layout.videoview);
	mEditText = (EditText) findViewById(R.id.url);
	mVideoView = (VideoView) findViewById(R.id.surface_view);
	if (path == "") {
		// Tell the user to provide a media file URL/path.
		Toast.makeText(VideoViewDemo.this, "Please edit VideoViewDemo 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);
			}
		});
	}

}
 
开发者ID:AJRdev,项目名称:ARDrone-Android-GEII,代码行数:32,代码来源:VideoViewDemo.java

示例6: onCreate

import io.vov.vitamio.widget.VideoView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
	requestWindowFeature(Window.FEATURE_NO_TITLE);
	getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
	
	setContentView(R.layout.activity_player);
	
	registerReceiver(mBatteryReceiver, BATTERY_FILTER);
	registerReceiver(mScreenReceiver, SCREEN_FILTER);
	registerReceiver(mUserPresentReceiver, USER_PRESENT_FILTER);

	mVideoLoadingView = findViewById(R.id.video_loading);
	mVideoLoadingInfo = (TextView) findViewById(R.id.video_loading_text);
	
	mVideoView = (VideoView) findViewById(R.id.video_view);	
	
	mVideoView.setMediaBufferingIndicator(mVideoLoadingView);
	
	mVideoView.setOnCompletionListener(this);
	mVideoView.setOnInfoListener(this);
	//mVideoView.setOnBufferingUpdateListener(l);
	
	mVideoView.requestFocus();
	mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
		@Override
		public void onPrepared(MediaPlayer mediaPlayer) {
			mediaPlayer.setPlaybackSpeed(1.0f);
		}
	});
	initialize();		
	getIntentValue(getIntent());
	openVideo(mVid, mCurrentEposide);
}
 
开发者ID:xiaoma1219,项目名称:netkuu.player,代码行数:36,代码来源:PlayerActivity.java

示例7: onCreate

import io.vov.vitamio.widget.VideoView; //导入方法依赖的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) {

			}
		});
	}
}
 
开发者ID:AJRdev,项目名称:ARDrone-Android-GEII,代码行数:48,代码来源:VideoViewSubtitle.java


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