旋转视频弄乱了 MediaControls,android
当我旋转设备时,视频控件无法正确调整大小。我制作了一个关于我在这里谈论的内容的视频:http://www.youtube.com/watch ?v=FgRythmUo3A
有没有办法“重绘”控件?
我对清单进行了此更改,以便我可以控制它旋转时发生的情况:
<activity android:name="Vforum" android:configChanges="orientation"></activity>
然后我的 java,我重写 onConfigurationChanged()
方法:
@Override
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
// redraw controls
}
有什么想法吗?
When I rotate my device, the video controls dont resize properly. I made a video of what I am talking about here: http://www.youtube.com/watch?v=FgRythmUo3A
Is there a way to "redraw" the controls?
I made this change to my manifest so I could control what happens when it rotates:
<activity android:name="Vforum" android:configChanges="orientation"></activity>
Then my java, I override the onConfigurationChanged()
method:
@Override
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
// redraw controls
}
any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
迈克和/或罗尼,我们需要您提供更多信息。
首先,回答老鼠的问题将有助于帮助者提供帮助:)
也许你还应该发布布局 - xml。也许只有一个设置是你一开始就不应该做的。
稍微搜索一下就发现了这一点:
Android VideoView 方向随缓冲视频发生变化
也许那个会给你一些提示。
We need more Info from you here, Mike and/or Ronnie.
First of all, answering mice's questions would be helpful for helpers to help :)
Maybe you should also post the layout - xml. Perhaps there is only a setting you shouldn't have made in the first place.
A little search brought this up:
Android VideoView orientation change with buffered video
Maybe that one will give you some hints.
您应该保存玩家位置并使用保存的位置重新创建玩家。这就是我在几个项目中所做的,而且似乎有效。
Fildor 的链接应该可以帮助您。
You should save the player position and recreate the player with the saved position. That's what I've done in a couple of projects and it seems to work.
Fildor's link should help you with that.