1

我正在尝试从以下位置运行 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()
4

0 回答 0