1

我在 WebView 中有一个 Flash 视频,它可以正常工作,直到我想全屏显示它。我确实覆盖了方法

public void onShowCustomView (View view, int requestedOrientation, WebChromeClient.CustomViewCallback callback)

与https://github.com/android/platform_packages_apps_browser/blob/master/src/com/android/browser/BaseUi.java类似的方式,因为在尝试进入全屏模式 android 4.0 时 Flash 播放器崩溃时 建议使用它,但我得到以下异常:

05-01 22:58:05.737: E/Handler(32402): Failed to handle callback; interface not implemented, callback:com.adobe.flashplayer.FlashPaintSurface$7@41bf1b38
05-01 22:58:05.737: E/Handler(32402): android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
05-01 22:58:05.737: E/Handler(32402):   at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:4381)
05-01 22:58:05.737: E/Handler(32402):   at android.view.ViewRootImpl.recomputeViewAttributes(ViewRootImpl.java:2455)
05-01 22:58:05.737: E/Handler(32402):   at android.view.ViewGroup.recomputeViewAttributes(ViewGroup.java:988)
05-01 22:58:05.737: E/Handler(32402):   at android.view.ViewGroup.recomputeViewAttributes(ViewGroup.java:988)
05-01 22:58:05.737: E/Handler(32402):   at android.view.ViewGroup.recomputeViewAttributes(ViewGroup.java:988)
05-01 22:58:05.737: E/Handler(32402):   at android.view.View.setSystemUiVisibility(View.java:13381)
05-01 22:58:05.737: E/Handler(32402):   at com.adobe.flashplayer.FlashPaintSurface$2.surfaceCreated(FlashPaintSurface.java:234)
05-01 22:58:05.737: E/Handler(32402):   at android.view.SurfaceView.updateWindow(SurfaceView.java:543)
05-01 22:58:05.737: E/Handler(32402):   at android.view.SurfaceView.access$000(SurfaceView.java:81)
05-01 22:58:05.737: E/Handler(32402):   at android.view.SurfaceView$4.setFormat(SurfaceView.java:718)
05-01 22:58:05.737: E/Handler(32402):   at com.adobe.flashplayer.FlashPaintSurface$7.run(FlashPaintSurface.java:717)
05-01 22:58:05.737: E/Handler(32402):   at android.os.Handler.handleCallback(Handler.java:607)
05-01 22:58:05.737: E/Handler(32402):   at android.os.Handler.dispatchMessage(Handler.java:92)
05-01 22:58:05.737: E/Handler(32402):   at android.os.Looper.loop(Looper.java:154)
05-01 22:58:05.737: E/Handler(32402):   at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:783)
05-01 22:58:05.737: E/Handler(32402):   at java.lang.Thread.run(Thread.java:864)

如何实现 com.adobe.flashplayer.FlashPaintSurface 的回调?我在这里缺少什么?

注意我在 ICS (Android > 4.0) 上遇到了这个问题,因为在 Android < 4.0 上是另一种方法

public void onShowCustomView (View view, WebChromeClient.CustomViewCallback callback)

被调用并且视图有一个 VideoView 的子类型。

我希望有人能帮忙。

问候明道加斯。

4

0 回答 0