centricular / gstcefsrc

A simple gstreamer wrapper around Chromium Embedded Framework
86 stars 45 forks source link

registering JS Callbacks using RenderProcessHandler::OnContextCreated() #54

Open hevc opened 2 years ago

hevc commented 2 years ago

Hi, I'm trying to register custom callback from JS to C++ using this tutorial: https://bitbucket.org/chromiumembedded/cef/wiki/JavaScriptIntegration#markdown-header-using-js-callbacks. I wrote something like that:
class App : public CefApp, public CefRenderProcessHandler with OnContextCreated(...) and
virtual CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() returning this.

Unfortunately the callback OnContextCreated is never called.

Maybe it is related to a wrong thread. The V8 execution must take place on TID_RENDERER thread.

Do you know how to handle callback registration. Is it possible? Maybe another way to achieve it?
It will be nice to have direct communication between C++ and js.

We want something like: https://github.com/Igalia/gst-wpe-webrtc-demo. but without additional server.

MathieuDuponchelle commented 2 years ago

I'm afraid I have absolutely no idea :)