我已经为我的应用程序创建了obb文件,其中有一个包含两个视频文件的文件夹。现在的问题是当我读取此文件时,它会给我文件名列表,但是当我调用getAssetFileDescriptor()方法时,始终返回null。我想念什么吗?
val expansionFile = APKExpansionSupport.getAPKExpansionZipFile(this@MainActivity, 1, 0)
val entries = expansionFile.allEntries
for (i in 0 until expansionFile.allEntries.size) {
Log.e("files:-",""+expansionFile.allEntries.get(i).mFileName)
if(expansionFile !=null){
if(expansionFile.allEntries.get(i).mFileName.equals("main.1.com.example.mylargeapk/videos/video.mp4")){
fd_video_file = expansionFile.getAssetFileDescriptor("/videos/video.mp4")
if (fd_video_file!=null){
mMediaPlayer?.setDataSource(fd_video_file)
mMediaPlayer?.prepare()
}
}
}
}