gpt4 book ai didi

java - 媒体 Controller 不工作

转载 作者:行者123 更新时间:2023-11-29 19:09:11 30 4
gpt4 key购买 nike

<分区>

我的 VideoView 可以工作,但我的 MediaController 不工作。我很确定我做错了位置或者可能没有......

这是我的代码:

public class Main2Activity extends Activity {

VideoView resultvideo;
MediaController mediacontroller;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

String uri = getIntent().getStringExtra("VIDEO_URI");
Uri videoUri = Uri.parse(uri);

this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

setContentView(R.layout.activity_main2);

mediacontroller = new MediaController(Main2Activity.this);
mediacontroller.setAnchorView(resultvideo);

mediacontroller.show();
mediacontroller.setAnchorView(resultvideo);

resultvideo = (VideoView)findViewById(R.id.videoView2);
resultvideo.setVideoURI(videoUri);
resultvideo.start();

}
}

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com