Rank: Newbie Groups: Member
Joined: 3/1/2016 Posts: 3
|
Hello,
My company is currently evaluating purchasing an enterprise license of EO.Total. I am in charge of the engineering effort of that evaluation. Currently I am having an issue invoking C# and I hope that you can help me figure out what I am doing wrong. Thank you.
My JS Code: controllerX.prototype.firePlayingStateEvent = function () { eoWebBrowser.extInvoke("playing", null, null); return 0; }
My C# Code: public WebViewApi(EOWebView webv) { _webView = webv; _webView.JSExtInvoke += _webView_JSExtInvoke; } private void _webView_JSExtInvoke(object sender, JSExtInvokeArgs e) { switch (e.FunctionName) { case "playing": CoursePlayingEvent?.Invoke(sender, e); break; case "error": CoursePlaybackFailedEvent?.Invoke(sender, e); break; default: throw new Exception("An invalid state was dispatched from CoursePlayer"); } }
Message: Invoking function 'firePlayingStateEvent' failed because channel is invalid.
StackTrace: at EO.WebBrowser.WebView.a(String A_0, JSInvokeResult A_1, ar4 A_2, Boolean A_3) at EO.WebBrowser.WebView.a(lq A_0, Action`1 A_1, Boolean A_2, Boolean A_3, String A_4) at EO.WebBrowser.WebView.a(lq A_0, Action`1 A_1, Boolean A_2, String A_3) at EO.WebBrowser.JSObject.a(String A_0, Boolean A_1, Object[] A_2) at EO.WebBrowser.JSObject.InvokeFunction(String functionName, Object[] args) at WebViewTests.WebViewTests.InvokeJs(String jsMethodToCall, Object obj, WebView webView) in E:\Source\Repos\TemplateDevelopment\TemplateDevelopment\WebViewTests\WebViewTests.cs:line 798 at WebViewTests.WebViewTests.<>c__DisplayClass21_0.<WebView_CoursePlayStateEvent_Test>b__0() in E:\Source\Repos\TemplateDevelopment\TemplateDevelopment\WebViewTests\WebViewTests.cs:line 787 at EO.Base.ThreadRunnerBase.c.c()
|
Rank: Newbie Groups: Member
Joined: 3/1/2016 Posts: 3
|
Ug! Nevermind. I figured it out.
controllerX.prototype.firePlayingStateEvent = function () { eoWebBrowser.extInvoke("playing", null, null); return 0; }
Should be:
controllerX.prototype.firePlayingStateEvent = function () { eoWebBrowser.extInvoke("playing", [null, null]); return 0; }
Sorry for the stupid question.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Great. Glad to hear that you found out the root cause and thank you very much for the update!
|