我在标签Activity中有三个活动。我必须在两个活动中使用视频视图。当我在一个活动中播放视频时,它会自动播放其他活动中的视频。如何解决此问题?
活动一码:
final VideoView videoView1= (VideoView)v.findViewById(R.id.videoViewPreviewVideos);
final MediaController controller;
String uriPath = "android.resource://com.robin.musicplayer/"+R.raw.bigsure30;
final Uri uri = Uri.parse(uriPath);
controller = new MediaController(MainActivity.this);
controller.setMediaPlayer(videoView1);
videoView1.setMediaController(controller);
videoView1.setVideoURI(uri);
controller.setAnchorView(videoView1);
Code Acitvity 2:
String uriPath = "android.resource://com.robin.musicplayer/"+R.raw.treadmil;
final Uri uri = Uri.parse(uriPath);
controller = new MediaController(this);
controller.setMediaPlayer(this.videoView1);
this.videoView1.setVideoURI(uri);
controller.setAnchorView(videoView1);
controller.setPadding(10, 500,10, 100);
videoView1.seekTo(1);
videoView1.start();