use of master.flame.danmaku.danmaku.model.android.Danmakus 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;
}
use of master.flame.danmaku.danmaku.model.android.Danmakus 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;
}
use of master.flame.danmaku.danmaku.model.android.Danmakus in project DanmakuFlameMaster by Bilibili.
the class DrawTask method getVisibleDanmakusOnTime.
@Override
public IDanmakus getVisibleDanmakusOnTime(long time) {
long beginMills = time - mContext.mDanmakuFactory.MAX_DANMAKU_DURATION - 100;
long endMills = time + mContext.mDanmakuFactory.MAX_DANMAKU_DURATION;
IDanmakus subDanmakus = danmakuList.subnew(beginMills, endMills);
final IDanmakus visibleDanmakus = new Danmakus();
if (null != subDanmakus && !subDanmakus.isEmpty()) {
subDanmakus.forEachSync(new IDanmakus.DefaultConsumer<BaseDanmaku>() {
@Override
public int accept(BaseDanmaku danmaku) {
if (danmaku.isShown() && !danmaku.isOutside()) {
visibleDanmakus.addItem(danmaku);
}
return ACTION_CONTINUE;
}
});
}
return visibleDanmakus;
}
use of master.flame.danmaku.danmaku.model.android.Danmakus in project DanmakuFlameMaster by Bilibili.
the class DrawTask method seek.
@Override
public void seek(long mills) {
reset();
mContext.mGlobalFlagValues.updateVisibleFlag();
mContext.mGlobalFlagValues.updateFirstShownFlag();
mContext.mGlobalFlagValues.updateSyncOffsetTimeFlag();
mContext.mGlobalFlagValues.updatePrepareFlag();
mRunningDanmakus = new Danmakus(Danmakus.ST_BY_LIST);
mStartRenderTime = mills < 1000 ? 0 : mills;
mRenderingState.reset();
mRenderingState.endTime = mStartRenderTime;
mLastBeginMills = mLastEndMills = 0;
if (danmakuList != null) {
BaseDanmaku last = danmakuList.last();
if (last != null && !last.isTimeOut()) {
mLastDanmaku = last;
}
}
}
use of master.flame.danmaku.danmaku.model.android.Danmakus in project DanmakuFlameMaster by Bilibili.
the class DanmakuTouchHelper method touchHitDanmaku.
private IDanmakus touchHitDanmaku(final float x, final float y) {
final IDanmakus hitDanmakus = new Danmakus();
mDanmakuBounds.setEmpty();
IDanmakus danmakus = danmakuView.getCurrentVisibleDanmakus();
if (null != danmakus && !danmakus.isEmpty()) {
danmakus.forEachSync(new IDanmakus.DefaultConsumer<BaseDanmaku>() {
@Override
public int accept(BaseDanmaku danmaku) {
if (null != danmaku) {
mDanmakuBounds.set(danmaku.getLeft(), danmaku.getTop(), danmaku.getRight(), danmaku.getBottom());
if (mDanmakuBounds.contains(x, y)) {
hitDanmakus.addItem(danmaku);
}
}
return ACTION_CONTINUE;
}
});
}
return hitDanmakus;
}
Aggregations