【问题标题】:Avoid Android VideoView corruption when rotating back to portrait? [duplicate]旋转回纵向时避免Android VideoView损坏? [复制]
【发布时间】:2012-08-04 11:11:19
【问题描述】:

可能重复:
Avoid Android VideoView corruption when rotating back to portrait

我设法编写了一个有限的视频播放器,能够从互联网上查看 .3gp 文件。视频将以全屏居中显示,保持视频纵横比。此外,旋转不会中断视频,视频会继续播放而不会出现问题。

一切似乎都很好,但是...在我的 HTC Legend 上,当您旋转回纵向时,视频已损坏,并且不是全屏显示,而是以其原始像素大小显示。但是再次旋转到风景作品并完美显示。任何想法为什么?不幸的是,我没有更多的硬件来测试它,而且我已经没有什么想法可以测试了。

您可以从https://github.com/gradha/Android-video-stream-rotation 获取完整的示例源代码。这是我打开应用程序的屏幕截图,旋转到横向,触摸屏幕以显示视频控件,然后旋转回纵向以查看损坏情况。

【问题讨论】:

    标签: android android-videoview corruption screen-rotation


    【解决方案1】:
    getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    

    这个来源救救我

    【讨论】:

      猜你喜欢
      • 2011-09-25
      • 2012-06-17
      • 2011-04-24
      • 2012-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-24
      • 2012-10-18
      相关资源
      最近更新 更多