我的全屏视频网页视图几乎总是在打开后立即关闭,有时它可以正常工作.几乎每次我点击youtube视频上的全屏按钮时,您都可以看到屏幕闪烁到全屏并恢复原状.这可能是什么原因?
webview显示在tablayout / viewpager设置中,其中包含一些其他片段.
我用这段代码来显示视频:
https://github.com/cprcrack/VideoEnabledWebView
它们产生完全相同的行为.
全屏失败时记录并在打开后立即恢复正常:
07-14 17:41:06.694 D/ViewRootImpl@33432e1[GroupActivity]: ViewPostImeInputStage processPointer 0 07-14 17:41:06.786 D/ViewRootImpl@33432e1[GroupActivity]: ViewPostImeInputStage processPointer 1 07-14 17:41:06.803 D/InputMethodManager: HSI from window - flag : 0 Pid : 6392 07-14 17:41:07.512 D/ViewRootImpl@33432e1[GroupActivity]: ViewPostImeInputStage processPointer 0 07-14 17:41:07.592 D/ViewRootImpl@33432e1[GroupActivity]: ViewPostImeInputStage processPointer 1 07-14 17:41:07.615 D/InputMethodManager: HSI from window - flag : 0 Pid : 6392 07-14 17:41:07.709 V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@3e22579 nm : com.linkhubapp ic=null 07-14 17:41:07.709 I/InputMethodManager: [IMM] startInputInner - mService.startInputOrWindowGainedFocus 07-14 17:41:07.713 D/InputTransport: Input channel constructed: fd=152 07-14 17:41:07.714 D/InputTransport: Input channel destroyed: fd=159 07-14 17:41:07.714 D/InputMethodManager: HSI from window - flag : 0 Pid : 6392 07-14 17:41:07.751 D/ViewRootImpl@33432e1[GroupActivity]: Relayout returned: oldFrame=[0,0][1440,2560] newFrame=[0,2560] result=0x1 surface={isValid=true -1176543232} surfaceGenerationChanged=false 07-14 17:41:07.911 D/ViewRootImpl@33432e1[GroupActivity]: Relayout returned: oldFrame=[0,2560] result=0x7 surface={isValid=true -1273339904} surfaceGenerationChanged=true 07-14 17:41:07.921 D/mali_winsys: EGLint new_window_surface(egl_winsys_display*,void*,EGLSurface,EGLConfig,egl_winsys_surface**,egl_color_buffer_format*,EGLBoolean) returns 0x3000,[1440x2560]-format:1 07-14 17:41:07.922 D/ViewRootImpl@33432e1[GroupActivity]: mHardwareRenderer.updateSurface() mSurface={isValid=true -1273339904} 07-14 17:41:07.974 D/SurfaceView: Relayout returned: oldFrame=[0,0][0,0] newFrame=[0,875][1440,1685] result=0x7 surface={Surface(name=null)/@0xb9ffb70 isValid=true -1178691584} 07-14 17:41:08.047 D/SurfaceView: Relayout returned: oldFrame=[0,1685] newFrame=[0,1685] result=0x5 surface={Surface(name=null)/@0xb9ffb70 isValid=false 0} 07-14 17:41:08.095 D/InputMethodManager: HSI from window - flag : 0 Pid : 6392 07-14 17:41:08.163 D/ViewRootImpl@33432e1[GroupActivity]: Relayout returned: oldFrame=[0,2560] result=0x1 surface={isValid=true -1273339904} surfaceGenerationChanged=false 07-14 17:41:08.232 V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@1772e0f nm : com.linkhubapp ic=null 07-14 17:41:08.232 I/InputMethodManager: [IMM] startInputInner - mService.startInputOrWindowGainedFocus 07-14 17:41:08.233 D/InputTransport: Input channel constructed: fd=173 07-14 17:41:08.233 D/InputTransport: Input channel destroyed: fd=152
全屏成功时记录日志:
07-14 17:41:27.987 D/ViewRootImpl@33432e1[GroupActivity]: ViewPostImeInputStage processPointer 0 07-14 17:41:28.023 D/ViewRootImpl@33432e1[GroupActivity]: ViewPostImeInputStage processPointer 1 07-14 17:41:28.048 D/InputMethodManager: HSI from window - flag : 0 Pid : 6392 07-14 17:41:28.496 D/ViewRootImpl@33432e1[GroupActivity]: ViewPostImeInputStage processPointer 0 07-14 17:41:28.571 D/ViewRootImpl@33432e1[GroupActivity]: ViewPostImeInputStage processPointer 1 07-14 17:41:28.616 D/InputMethodManager: HSI from window - flag : 0 Pid : 6392 07-14 17:41:28.719 V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@80b2646 nm : com.linkhubapp ic=null 07-14 17:41:28.719 I/InputMethodManager: [IMM] startInputInner - mService.startInputOrWindowGainedFocus 07-14 17:41:28.725 D/InputTransport: Input channel constructed: fd=155 07-14 17:41:28.725 D/InputTransport: Input channel destroyed: fd=173 07-14 17:41:28.725 D/InputMethodManager: HSI from window - flag : 0 Pid : 6392 07-14 17:41:28.766 D/ViewRootImpl@33432e1[GroupActivity]: Relayout returned: oldFrame=[0,2560] result=0x1 surface={isValid=true -1273339904} surfaceGenerationChanged=false 07-14 17:41:28.956 D/ViewRootImpl@33432e1[GroupActivity]: Relayout returned: oldFrame=[0,2560] result=0x1 surface={isValid=true -1273339904} surfaceGenerationChanged=false 07-14 17:41:29.036 D/SurfaceView: Relayout returned: oldFrame=[0,1685] result=0x7 surface={Surface(name=null)/@0xc360d2 isValid=true -1273337856} 07-14 17:41:29.089 D/SurfaceView: Relayout returned: oldFrame=[0,1685] result=0x1 surface={Surface(name=null)/@0xc360d2 isValid=true -1311279104}
编辑:
它似乎只在youtube上发生.测试过Vimeo和youtube. Vimeo每次都会打开.