Is it possible to run TypeScript in the Flutter WebView? I need to run TypeScript while loading a website in the WebView in my flutter app. Currently, I am encountering an issue with running videos during the load, so I am looking to manually trigger video playback from the app.
WebView(
initialUrl: privacyUrl,
javascriptMode: JavascriptMode.unrestricted,
gestureNavigationEnabled: false,
debuggingEnabled: true,
onWebViewCreated: (controller) {
webController = controller;
},
onPageFinished: (url) {
// A piece of JavaScript code taken from the webpage that requires an equivalent TypeScript method.
webController.runJavascriptReturningResult(
"javascript:(function() { document.getElementById('spot-video').play(); })()");
},
),