要播放优酷的视频,需要在Manifest文件里面设置:android:hardwareAccelerated="true",否则在播放界面没有视频图像。但是设置了这个属性之后,在进入土豆界面的时候,程序直接崩溃:
08-28 18:00:28.633 11054-11054/cn.sumile.webviewfw E/Surface﹕ dequeueBuffer: IGraphicBufferProducer::requestBuffer failed: -2147483646
08-28 18:00:28.633 11054-11054/cn.sumile.webviewfw E/Surface﹕ dequeueBuffer failed (Unknown error 2147483646)
08-28 18:00:28.643 11054-11054/cn.sumile.webviewfw E/ViewRootImpl﹕ Could not lock surface
java.lang.IllegalArgumentException
at android.view.Surface.nativeLockCanvas(Native Method)
at android.view.Surface.lockCanvas(Surface.java:244)
at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2474)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2448)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2292)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1922)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1039)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5648)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
at android.view.Choreographer.doCallbacks(Choreographer.java:574)
at android.view.Choreographer.doFrame(Choreographer.java:544)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5049)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(Native Method)
以上土豆bug出现在小米4上,Android4.4.4.其他手机没问题。。。艹艹艹。。
同时,不管怎么设置,土豆的视频都没办法显示视频图像。
问题:
1.怎样让土豆显示视频图像。
2.怎么让优酷和土豆中点击全屏然后在手机中全屏播放(onShowCustomView已经设置,但是优酷和土豆完全不理他啊)
3.在优酷和土豆中如何权衡这个硬件加速的问题(这个现在不重要。。)