Where is the SampleZipfileProvider class?

本秂侑毒 提交于 2019-11-27 21:27:43

It turned out that my ZipFileContentProvider was sufficient. For those coming across this problem. Here is what I did to use the content provider for the VideoView.setVideoURI() method.

Add provider to Manifest.

<provider android:authorities="com.myCompany.myAppName.provider.ZipFileContentProvider" android:name=".ZipFileContentProvider"></provider>

In video player class:

final String AUTHORITY = "com.myCompany.myAppName.provider.ZipFileContentProvider";
final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY);
video = (VideoView) findViewById(R.id.video);
video.setVideoURI(Uri.parse(CONTENT_URI + "/" + videoFileName + ".mp4"));
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!