How to open video player in WebView?

梦想与她 提交于 2019-12-04 18:04:39

You may have better luck if you specify that the uri contains video:

Intent intent = new Intent(Intent.ACTION_VIEW) //I encourage using this instead of specifying the string "android.intent.action.VIEW"
intent.setDataAndType(Uri.parse(url), "video/3gpp");
view.getContext().startActivity(intent);  

Because we haven't specified a specific package to handle the above intent, it is called an implicit intent. For implicit intents, if there are multiple packages that handle the content type that you specify, you will be asked to choose between them. This should give you your desired behavior.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!