Play html5 video tag from Webview on Android app

Asked 2 years ago, Updated 2 years ago, 87 views

I use WebView on the Android app to run the local html5 code.
I can't play video.

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

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

The Android version is expected to be 4.2 or higher.

Thank you for your cooperation.

android html5 webview

2022-09-30 19:02

1 Answers

Is there a possibility that PluginState is not turned on?Write a code similar to the one below and turn on Plugin to view the web page containing the video tag.

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


2022-09-30 19:02

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.