I want to play mp4 video using tag on Webview. I have few constraints for not to use HTML5 tag. I have looked code to play YouTube video on webview. But YouTube uses .flv format. I have .mp4 开发者_Python百科video to play.
Thanks in advance.
You could play the video directly, without a WebView:
VideoView videoView = new VideoView(this);
setContentView(videoView);
Bundle extra = getIntent().getExtras();
if (null != extra && extra.containsKey("url")) {
    String url = extra.getString("url");
    Uri uri = Uri.parse(url);
    MediaController mc = new MediaController(this);
    videoView.setMediaController(mc);
    videoView.setVideoURI(uri);
    videoView.start();
}
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论