use of master.flame.danmaku.danmaku.parser.android.BiliDanmukuParser in project ABPlayer by winkstu.
the class BiliVideoViewActivity method createParser.
private BaseDanmakuParser createParser(String uri) {
InputStream stream = null;
if (uri == null) {
return new BaseDanmakuParser() {
@Override
protected Danmakus parse() {
return new Danmakus();
}
};
}
try {
Response rsp = (Response) Jsoup.connect(uri).execute();
stream = new ByteArrayInputStream(CompressionTools.decompressXML(rsp.bodyAsBytes()));
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (DataFormatException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
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;
}
use of master.flame.danmaku.danmaku.parser.android.BiliDanmukuParser in project ABPlayer by winkstu.
the class BiliVideoViewActivity 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;
}
use of master.flame.danmaku.danmaku.parser.android.BiliDanmukuParser in project ABPlayer by winkstu.
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;
}
Aggregations