html5视频全屏嵌入式人行横道崩溃

时间:2016-03-02 08:57:31

标签: android video crash fullscreen crosswalk

我有XWalkView的Android原生应用。一切正常,直到进入html5视频全屏模式(youtube或简单的html视频标签)。

logcat和应用程序崩溃时出错:

  

03-01 23:23:27.759 7879-7879 /? E / chromium:[错误:xwalk_autofill_client.cc(116)]未在virtual void xwalk中实现:: XWalkAutofillClient :: OnFirstUserGestureObserved()

     

03-01 23:23:27.909 7879-7879 /? A / chromium:[致命:jni_android.cc(249)]检查失败:错误。请在崩溃报告中包含Java异常堆栈

     

03-01 23:23:27.909 7879-7879 /? A / libc:0xdeadbaad(代码= 1)的致命信号11(SIGSEGV),线程7879(eu.my.app.MyApp)

应用程序代码只是来自人行横道网站的示例:

public class MyActivity extends XWalkActivity {
XWalkView mXwalkView;

class MyResourceClient extends XWalkResourceClient {
    MyResourceClient(XWalkView view) {
        super(view);
    }

    @Override
    public WebResourceResponse shouldInterceptLoadRequest(XWalkView view, String url) {
        return super.shouldInterceptLoadRequest(view, url);
    }
}

class MyUIClient extends XWalkUIClient {
    MyUIClient(XWalkView view) {
        super(view);
    }

    @Override
    public void onFullscreenToggled(XWalkView view, boolean enterFullscreen) {
        super.onFullscreenToggled(view, enterFullscreen);
    }
}

@Override
public void addContentView(View view, ViewGroup.LayoutParams params) {
    super.addContentView(view, params);
}

@Override
protected void onXWalkReady() {
    mXwalkView = new XWalkView(this, this);
    setContentView(R.layout.main);
    ((FrameLayout) findViewById(R.id.myContainer)).addView(mXwalkView);
    mXwalkView.setResourceClient(new MyResourceClient(mXwalkView));
    mXwalkView.setUIClient(new MyUIClient(mXwalkView));
    mXwalkView.load("http://www.youtube.com/", null);
}

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
}

@Override
public Window getWindow() {
    return super.getWindow();
}

@Override
protected void onPause() {
    super.onPause();
    if (mXwalkView != null) {
        mXwalkView.pauseTimers();
        mXwalkView.onHide();
    }
}

@Override
protected void onResume() {
    super.onResume();
    if (mXwalkView != null) {
        mXwalkView.resumeTimers();
        mXwalkView.onShow();
    }
}

@Override
protected void onDestroy() {
    super.onDestroy();
    if (mXwalkView != null) {
        mXwalkView.onDestroy();
    }
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (mXwalkView != null) {
        mXwalkView.onActivityResult(requestCode, resultCode, data);
    }
}

@Override
protected void onNewIntent(Intent intent) {
    if (mXwalkView != null) {
        mXwalkView.onNewIntent(intent);
    }
}
}

0 个答案:

没有答案