Search in sources :

Example 1 with BiliDanmukuParser

use of com.example.gsyvideoplayer.utils.BiliDanmukuParser in project GSYVideoPlayer by CarGuo.

the class DanmakuVideoPlayer method createParser.

/**
     * 创建解析器对象,解析输入流
     *
     * @param stream
     * @return
     */
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) BiliDanmukuParser(com.example.gsyvideoplayer.utils.BiliDanmukuParser) 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

BiliDanmukuParser (com.example.gsyvideoplayer.utils.BiliDanmukuParser)1 ILoader (master.flame.danmaku.danmaku.loader.ILoader)1 IllegalDataException (master.flame.danmaku.danmaku.loader.IllegalDataException)1 IDanmakus (master.flame.danmaku.danmaku.model.IDanmakus)1 Danmakus (master.flame.danmaku.danmaku.model.android.Danmakus)1 BaseDanmakuParser (master.flame.danmaku.danmaku.parser.BaseDanmakuParser)1