本文整理汇总了Java中master.flame.danmaku.danmaku.parser.BaseDanmakuParser类的典型用法代码示例。如果您正苦于以下问题:Java BaseDanmakuParser类的具体用法?Java BaseDanmakuParser怎么用?Java BaseDanmakuParser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BaseDanmakuParser类属于master.flame.danmaku.danmaku.parser包,在下文中一共展示了BaseDanmakuParser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadDanmakus
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser; //导入依赖的package包/类
protected void loadDanmakus(BaseDanmakuParser parser) {
this.danmakuList = parser.setConfig(this.mContext).setDisplayer(this.mDisp).setTimer(this.mTimer).getDanmakus();
if (!(this.danmakuList == null || this.danmakuList.isEmpty() || this.danmakuList.first().flags != null)) {
IDanmakuIterator it = this.danmakuList.iterator();
while (it.hasNext()) {
BaseDanmaku item = it.next();
if (item != null) {
item.flags = this.mContext.mGlobalFlagValues;
}
}
}
this.mContext.mGlobalFlagValues.resetAll();
if (this.danmakuList != null) {
this.mLastDanmaku = this.danmakuList.last();
}
}
示例2: createParser
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser; //导入依赖的package包/类
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;
}
示例3: loadDanmakus
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser; //导入依赖的package包/类
protected void loadDanmakus(BaseDanmakuParser parser) {
danmakuList = parser.setConfig(mContext).setDisplayer(mDisp).setTimer(mTimer).getDanmakus();
if (danmakuList != null && !danmakuList.isEmpty()) {
if (danmakuList.first().flags == null) {
IDanmakuIterator it = danmakuList.iterator();
while (it.hasNext()) {
BaseDanmaku item = it.next();
if (item != null) {
item.flags = mContext.mGlobalFlagValues;
}
}
}
}
mContext.mGlobalFlagValues.resetAll();
if(danmakuList != null) {
mLastDanmaku = danmakuList.last();
}
}
示例4: createParser
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser; //导入依赖的package包/类
/**
* 创建解析器对象,解析输入流
*
* @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;
}
示例5: createParser
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser; //导入依赖的package包/类
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;
}
示例6: createParser
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser; //导入依赖的package包/类
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;
}
示例7: createParser
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser; //导入依赖的package包/类
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;
}
示例8: initDanmaku
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser; //导入依赖的package包/类
protected void initDanmaku(DanmakuSurfaceView danmakuSurfaceView, BaseDanmakuParser parser) {
if (danmakuSurfaceView != null) {
//parser = createParser(null);
danmakuSurfaceView.setCallback(new DrawHandler.Callback() {
@Override public void updateTimer(DanmakuTimer timer) {
}
@Override public void prepared() {
danmakuSurfaceView.start();
}
});
danmakuSurfaceView.prepare(parser);
//danmakuSurfaceView.showFPS(true);
danmakuSurfaceView.enableDanmakuDrawingCache(true);
danmakuSurfaceView.setZOrderOnTop(true);
danmakuSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
}
}
示例9: createParser
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser; //导入依赖的package包/类
protected 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;
}
示例10: testDanMu
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser; //导入依赖的package包/类
protected void testDanMu(DanmakuSurfaceView danmakuSurfaceView, BaseDanmakuParser mParser,
String string, int textColor, int borderColor) {
BaseDanmaku danmaku = DanmakuFactory.createDanmaku(BaseDanmaku.TYPE_SCROLL_RL);
danmaku.text = string;
danmaku.padding = 5;
danmaku.priority = 1;
danmaku.time = mParser.getTimer().currMillisecond + 100;
danmaku.textSize = 25f * (mParser.getDisplayer().getDensity() - 0.6f);
//danmaku.textSize = 25f;
danmaku.textColor = textColor;
danmaku.textShadowColor = Color.WHITE;
//danmaku.underlineColor = Color.GREEN;
danmaku.borderColor = borderColor;
danmakuSurfaceView.addDanmaku(danmaku);
}
示例11: setDisplayer
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser; //导入依赖的package包/类
@Override
public BaseDanmakuParser setDisplayer(IDisplayer disp) {
super.setDisplayer(disp);
mDispScaleX = mDispWidth / DanmakuFactory.BILI_PLAYER_WIDTH;
mDispScaleY = mDispHeight / DanmakuFactory.BILI_PLAYER_HEIGHT;
return this;
}
示例12: downloadXML
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser; //导入依赖的package包/类
public static Observable<BaseDanmakuParser> downloadXML(final String uri) {
return Observable.create(new Observable.OnSubscribe<BaseDanmakuParser>() {
@Override
public void call(final Subscriber<? super BaseDanmakuParser> subscriber) {
if (TextUtils.isEmpty(uri)) {
subscriber.onNext(new BaseDanmakuParser() {
@Override
protected IDanmakus parse() {
return new Danmakus();
}
});
}
ILoader loader = null;
try {
HttpConnection.Response rsp = (HttpConnection.Response)
Jsoup.connect(uri).timeout(20000).execute();
InputStream stream = new ByteArrayInputStream(BiliDanmukuCompressionTools.
decompressXML(rsp.bodyAsBytes()));
loader = DanmakuLoaderFactory.
create(DanmakuLoaderFactory.TAG_BILI);
loader.load(stream);
} catch (IOException | DataFormatException | IllegalDataException e) {
e.printStackTrace();
}
BaseDanmakuParser parser = new BiliDanmukuParser();
assert loader != null;
IDataSource<?> dataSource = loader.getDataSource();
parser.load(dataSource);
subscriber.onNext(parser);
}
}).subscribeOn(Schedulers.io());
}
示例13: setDisplayer
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser; //导入依赖的package包/类
@Override
public BaseDanmakuParser setDisplayer(IDisplayer disp) {
super.setDisplayer(disp);
mDispScaleX = mDispWidth / DanmakuFactory.BILI_PLAYER_WIDTH;
mDispScaleY = mDispHeight / DanmakuFactory.BILI_PLAYER_HEIGHT;
return this;
}
示例14: prepare
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser; //导入依赖的package包/类
public void prepare(BaseDanmakuParser parser, DanmakuContext config) {
prepare();
this.handler.setConfig(config);
this.handler.setParser(parser);
this.handler.setCallback(this.mCallback);
this.handler.prepare();
}
示例15: addDanmukuView
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser; //导入依赖的package包/类
/**
* 添加弹幕
*/
public IjkVideoView addDanmukuView(DanmakuView danmakuView, DanmakuContext context, BaseDanmakuParser parser) {
this.mDanmakuView = danmakuView;
this.mContext = context;
this.mParser = parser;
return this;
}