Where is the SampleZipfileProvider class?

前端 未结 1 588
盖世英雄少女心
盖世英雄少女心 2020-12-05 20:18

At the bottom of the section in Google\'s dev guide on expansion files (http://developer.android.com/guide/market/expansion-files.html#ZipLib) there is the following text.

相关标签:
1条回答
  • 2020-12-05 20:51

    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"));
    
    0 讨论(0)
提交回复
热议问题