Java使用JAVE获取MP4播放时长

展开阅读全文

求解读JAVA代码,为什么MP4文件不能播放

04-17

下载的一个压缩包(压缩包内含mp4文件、字幕文件等),压缩包有密码,android程序用密码打开压缩文件,并执行一系列操作后,程序自动播放压缩包内的MP4文件,但MP4文件不能直接使用播放器播放,求解答如何能让mp4文件用播放器播放 。。。谢谢 。。。这里是完整代码下载链接:[点击下载完整代码](http://pan.baidu.com/s/1hqELVms),(用JD-GUI直接查看Jar内的代码、0000208821-DF705DD4是去掉了扩展名的压缩文件) 下面是部分代码(代码位于jar文件内的nc.class): ``` import android.widget.Toast; import com.is.piano.base.ISApp; import com.ispiano.crc64.Algorithm; import java.io.File; import java.io.PrintStream; import java.util.List; import net.lingala.zip4j.core.ZipFile; import net.lingala.zip4j.exception.ZipException; import net.lingala.zip4j.model.FileHeader; import net.lingala.zip4j.model.ZipParameters; public class nc { public static boolean a(String paramString1, String paramString2) { long l1 = System.currentTimeMillis(); ZipFile localZipFile; File localFile; try { localZipFile = new ZipFile(paramString1); localZipFile.setFileNameCharset("GBK"); if (localZipFile.isValidZipFile()) break label101; mh.b(paramString1); throw new ZipException("\u538B\u7F29\u6587\u4EF6\u4E0D\u5408\u6CD5,\u53EF\u80FD\u88AB\u635F\u574F."); } catch (ZipException localZipException) { localZipException.printStackTrace(); localFile = new File(paramString2); if (!localFile.exists()) break label99; } File[] arrayOfFile; int i; if (localFile.isDirectory()) { arrayOfFile = localFile.listFiles(); i = arrayOfFile.length; } for (int j = 0; ; j++) { if (j >= i) { label99: return false; label101: if (localZipFile.isEncrypted()) localZipFile.setPassword("ISPiano Zhang"); List localList = localZipFile.getFileHeaders(); long l2 = 0L; for (int k = 0; ; k++) { if (k >= localList.size()) { if (l2 <= mh.b()) break; return false; } l2 += ((FileHeader)localList.get(k)).getUncompressedSize(); } localZipFile.extractAll(paramString2); mh.b(paramString1); System.out.println("\u89E3\u538B\u8017\u65F6\uFF1A" + (System.currentTimeMillis() - l1)); return true; } arrayOfFile[j].delete(); } } public static boolean a(String paramString1, String paramString2, String paramString3) { System.out.println("unzipUnfinishFile," + paramString1); while (true) { int i; try { String str1 = mh.c() + "/ispiano/package_cache/" + paramString1; ZipFile localZipFile = new ZipFile(str1); if (!localZipFile.isValidZipFile()) return false; localZipFile.setPassword("ISPiano Zhang"); List localList = localZipFile.getFileHeaders(); Algorithm localAlgorithm = new Algorithm(); i = 0; if (i < localList.size()) continue; eg localeg = new eg(); localeg.a(Long.parseLong(paramString3.substring(0, 8) + "00"), paramString2); localeg.g(); mh.b(str1); new File(mh.c() + "/ispiano/package_cache/" + "dir_" + paramString1).delete(); return true; FileHeader localFileHeader = (FileHeader)localList.get(i); String str2 = localFileHeader.getFileName(); long l = localFileHeader.getUncompressedSize(); String str3 = localAlgorithm.getFileName(paramString2 + paramString3 + str2); File localFile = new File(mh.c() + "/ispiano/video_cache/" + str3); mi.c("jing", str3 + "," + str2 + " " + localFile.length() + "," + l); if ((!localFile.exists()) || (localFile.length() != l)) { mh.b(mh.c() + "/ispiano/video_cache/" + str3); if (mh.b() >= l) continue; Toast.makeText(ISApp.a(), 2131230828, 0).show(); return false; mh.a(mh.c() + "/ispiano/package_cache/" + "dir_" + paramString1); mh.a(mh.c() + "/ispiano/video_cache/"); localZipFile.extractFile(str2, mh.c() + "/ispiano/package_cache/" + "dir_" + paramString1); new File(mh.c() + "/ispiano/package_cache/" + "dir_" + paramString1 + "/" + str2).renameTo(new File(mh.c() + "/ispiano/video_cache/" + str3)); } } catch (ZipException localZipException) { localZipException.printStackTrace(); return false; } i++; } } public static boolean b(String paramString1, String paramString2) { try { ZipFile localZipFile = new ZipFile(paramString2); ZipParameters localZipParameters = new ZipParameters(); localZipParameters.setCompressionMethod(8); localZipParameters.setCompressionLevel(5); localZipFile.addFolder(paramString1, localZipParameters); return true; } catch (ZipException localZipException) { localZipException.printStackTrace(); } return false; } public static boolean c(String paramString1, String paramString2) { try { new ZipFile(paramString1).extractAll(paramString2); return true; } catch (ZipException localZipException) { localZipException.printStackTrace(); } return false; } } ``` 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览