我正在尝试从以下位置运行mp4parser示例: https://mp4parser.googlecode.com/svn/trunk/examples/src/main/java/com/googlecode/mp4parser/
并且在运行期间转到以下函数,在函数内部我们尝试从isoparser_default.properties加载每个URL。错误是我们尝试启动MalformedUrl。
这是功能:
public PropertyBoxParserImpl(Context ctx, String... customProperties) {
InputStream ins = ctx.getResources().openRawResource(
ctx.getResources().getIdentifier("raw/isoparser_default", "raw", ctx.getPackageName()));
InputStream is = new BufferedInputStream(ins);
try {
mapping = new Properties();
try {
mapping.load(is);
Collection<Object> urls = mapping.values();
Enumeration<Object> enumeration = Collections.enumeration(urls);
while (enumeration.hasMoreElements()) {
// URL url = new URL((String) enumeration.nextElement());
URL url = new URL("ilst-desc=com.coremedia.iso.boxes.apple.AppleDescriptionBox()");
InputStream customIS = new BufferedInputStream(url.openStream());
try {
mapping.load(customIS);
} finally {
customIS.close();
}
}
for (String customProperty : customProperties) {
mapping.load(new BufferedInputStream(getClass().getResourceAsStream(customProperty)));
}
} catch (IOException e) {
e.printStackTrace();
}
} finally {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
// ignore - I can't help
}
}
}
和isoparser_default.properties的内容:
hint=com.coremedia.iso.boxes.TrackReferenceTypeBox(type)
cdsc=com.coremedia.iso.boxes.TrackReferenceTypeBox(type)
meta-ilst=com.coremedia.iso.boxes.apple.AppleItemListBox()
-----name=com.coremedia.iso.boxes.apple.AppleNameBox()
-----mean=com.coremedia.iso.boxes.apple.AppleMeanBox()
-----data=com.coremedia.iso.boxes.apple.AppleDataBox()
rmra=com.coremedia.iso.boxes.apple.AppleReferenceMovieBox()
rmda=com.coremedia.iso.boxes.apple.AppleReferenceMovieDescriptorBox()
rmdr=com.coremedia.iso.boxes.apple.AppleDataRateBox()
rdrf=com.coremedia.iso.boxes.apple.AppleDataReferenceBox()
ilst-cprt=com.coremedia.iso.boxes.apple.AppleCopyrightBox()
ilst-\u00A9cmt=com.coremedia.iso.boxes.apple.AppleCommentBox()
ilst-desc=com.coremedia.iso.boxes.apple.AppleDescriptionBox()
ilst-covr=com.coremedia.iso.boxes.apple.AppleCoverBox()
ilst-\u00A9alb=com.coremedia.iso.boxes.apple.AppleAlbumBox()