Let's say I have an React Native App, and all the core code exists there including an object model something like:
let MyObject = {
SimpleText : "Hello",
MediaObject : MediaStream()
}
I have some React Native UI, and also a WebView (.md)
I would like to display the MediaObject from my core RN code, with my WebView using a simple <video> element. for Example: videoEl.srcObject = MyObject.MediaObject
I see that when you use the webview, the script inside the page has access to something called: ReactNativeWebView
and with that I can post messages as strings, but I can't send or receive an object (like MediaStream).
I can do everything else i need with post messages, except this problem with the MediaStream
Any way to accomplish this?
So far in my research I found that:
For a few years now you cannot make an object URL of a MediaStream any more, meaning that I can't create the objectURL in the core code, and "pass" the url as a string. Then do something like set the
.src = "<object_url>"
.Since React Native are able to "expose" a class/object or something to window.XXXXX, am I able to do the same thing? It would be perfect if I could simply say window.MyObject and have access to my object inside the host ReactNative App.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744349482a4569887.html
评论列表(0条)