Search in sources :

Example 6 with IllegalDataException

use of master.flame.danmaku.danmaku.loader.IllegalDataException in project DanmakuFlameMaster by Bilibili.

the class MainActivity method createParser.

private BaseDanmakuParser createParser(InputStream stream) {
    if (stream == null) {
        return new BaseDanmakuParser() {

            @Override
            protected Danmakus parse() {
                return new Danmakus();
            }
        };
    }
    ILoader loader = DanmakuLoaderFactory.create(DanmakuLoaderFactory.TAG_BILI);
    try {
        loader.load(stream);
    } catch (IllegalDataException e) {
        e.printStackTrace();
    }
    BaseDanmakuParser parser = new BiliDanmukuParser();
    IDataSource<?> dataSource = loader.getDataSource();
    parser.load(dataSource);
    return parser;
}
Also used : BaseDanmakuParser(master.flame.danmaku.danmaku.parser.BaseDanmakuParser) IDanmakus(master.flame.danmaku.danmaku.model.IDanmakus) Danmakus(master.flame.danmaku.danmaku.model.android.Danmakus) ILoader(master.flame.danmaku.danmaku.loader.ILoader) IllegalDataException(master.flame.danmaku.danmaku.loader.IllegalDataException)

Example 7 with IllegalDataException

use of master.flame.danmaku.danmaku.loader.IllegalDataException in project DanmakuFlameMaster by Bilibili.

the class UglyViewCacheStufferSampleActivity method createParser.

private BaseDanmakuParser createParser(InputStream stream) {
    if (stream == null) {
        return new BaseDanmakuParser() {

            @Override
            protected Danmakus parse() {
                return new Danmakus();
            }
        };
    }
    ILoader loader = DanmakuLoaderFactory.create(DanmakuLoaderFactory.TAG_BILI);
    try {
        loader.load(stream);
    } catch (IllegalDataException e) {
        e.printStackTrace();
    }
    BaseDanmakuParser parser = new BiliDanmukuParser();
    IDataSource<?> dataSource = loader.getDataSource();
    parser.load(dataSource);
    return parser;
}
Also used : BaseDanmakuParser(master.flame.danmaku.danmaku.parser.BaseDanmakuParser) IDanmakus(master.flame.danmaku.danmaku.model.IDanmakus) Danmakus(master.flame.danmaku.danmaku.model.android.Danmakus) ILoader(master.flame.danmaku.danmaku.loader.ILoader) IllegalDataException(master.flame.danmaku.danmaku.loader.IllegalDataException)

Aggregations

ILoader (master.flame.danmaku.danmaku.loader.ILoader)7 IllegalDataException (master.flame.danmaku.danmaku.loader.IllegalDataException)7 Danmakus (master.flame.danmaku.danmaku.model.android.Danmakus)7 BaseDanmakuParser (master.flame.danmaku.danmaku.parser.BaseDanmakuParser)7 IDanmakus (master.flame.danmaku.danmaku.model.IDanmakus)4 BiliDanmukuParser (master.flame.danmaku.danmaku.parser.android.BiliDanmukuParser)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 DataFormatException (java.util.zip.DataFormatException)2 BiliDanmukuParser (com.example.gsyvideoplayer.utils.BiliDanmukuParser)1 HttpConnection (org.jsoup.helper.HttpConnection)1 Response (org.jsoup.helper.HttpConnection.Response)1 Subscriber (rx.Subscriber)1