Play html5 video tag from Webview on Android app

Question: Question:

I'm using WebView on my Android app and running the local html5 code,
I just can't play the video.

I also tried using html5WebView, but it didn't work.

Does anyone know how to play html5 video on WebView?
The video is stored locally.

Android version is assumed to be 4.2 or higher.

Thank you.

Answer: Answer:

Isn't it "I haven't turned on Plugin State"? Write the following code, turn on the Plugin, and display the web page that contains the video tag.

if (Build.VERSION.SDK_INT < 8) {
    webview.getSettings().setPluginsEnabled(true);
} else {
    webview.getSettings().setPluginState(PluginState.ON);
}
Scroll to Top