Android:视频作为启动画面
我想将视频作为启动屏幕播放。我已经实现了播放视频,但它显示了默认控件,如播放、暂停和搜索等。我想删除 这样视频结束后我需要调用新活动。
MediaController mc = new MediaController(this);
getWindow().setFormat(PixelFormat.TRANSLUCENT);
video.setMediaController(mc);
video.setVideoURI(uri);
video.setOnCompletionListener(this);
video.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View arg0, MotionEvent arg1) {
Toast.makeText(getApplicationContext(), "ontouch",Toast.LENGTH_LONG).show();
return true;
}
}) ;
和 main.xml
提前致谢。
I want to play the video as splash screen.I have implement the play video but it show the default control like play,pause and seek etc.I want to remove the
so that the after video finish I need to call the new activity.
MediaController mc = new MediaController(this);
getWindow().setFormat(PixelFormat.TRANSLUCENT);
video.setMediaController(mc);
video.setVideoURI(uri);
video.setOnCompletionListener(this);
video.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View arg0, MotionEvent arg1) {
Toast.makeText(getApplicationContext(), "ontouch",Toast.LENGTH_LONG).show();
return true;
}
}) ;
and the main.xml
Thank in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
答案太简单了
删除该行,
因为我不想使用该控件。
谢谢
The answer was too simple
remove the line
because i did not want to use the control.
Thank you
禁用layout.xml文件中的touchable属性:
希望对您有帮助
现在有一个名为
http://d.android.com/reference/android/widget/VideoView.html#setMediaController%28android.widget.MediaController%29
可以调用此方法并将参数作为 MediaController.hide() 传递,
这是示例代码:
Disable the touchable property in the layout.xml file:
Hope that helps you
Now there is a Method called
http://d.android.com/reference/android/widget/VideoView.html#setMediaController%28android.widget.MediaController%29
You can call this method and pass the argument as MediaController.hide()
Here is a Sample Code: