本文整理汇总了Java中master.flame.danmaku.danmaku.loader.IllegalDataException类的典型用法代码示例。如果您正苦于以下问题:Java IllegalDataException类的具体用法?Java IllegalDataException怎么用?Java IllegalDataException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IllegalDataException类属于master.flame.danmaku.danmaku.loader包,在下文中一共展示了IllegalDataException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDanmakuSource
import master.flame.danmaku.danmaku.loader.IllegalDataException; //导入依赖的package包/类
/**
* 设置弹幕资源,默认资源格式需满足 bilibili 的弹幕文件格式,
* 配合{@link #setDanmakuCustomParser}来进行自定义弹幕解析方式,{@link #setDanmakuCustomParser}必须先调用
*
* @param stream 弹幕资源
* @return
*/
public IjkPlayerView setDanmakuSource(InputStream stream) {
if (stream == null) {
return this;
}
if (!mIsEnableDanmaku) {
throw new RuntimeException("Danmaku is disable, use enableDanmaku() first");
}
if (mDanmakuLoader == null) {
mDanmakuLoader = DanmakuLoaderFactory.create(DanmakuLoaderFactory.TAG_BILI);
}
try {
mDanmakuLoader.load(stream);
} catch (IllegalDataException e) {
e.printStackTrace();
}
IDataSource<?> dataSource = mDanmakuLoader.getDataSource();
if (mDanmakuParser == null) {
mDanmakuParser = new BiliDanmukuParser();
}
mDanmakuParser.load(dataSource);
return this;
}
示例2: createParser
import master.flame.danmaku.danmaku.loader.IllegalDataException; //导入依赖的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: createParser
import master.flame.danmaku.danmaku.loader.IllegalDataException; //导入依赖的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;
}
示例4: createParser
import master.flame.danmaku.danmaku.loader.IllegalDataException; //导入依赖的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;
}
示例5: createParser
import master.flame.danmaku.danmaku.loader.IllegalDataException; //导入依赖的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.loader.IllegalDataException; //导入依赖的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.loader.IllegalDataException; //导入依赖的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;
}
示例8: load
import master.flame.danmaku.danmaku.loader.IllegalDataException; //导入依赖的package包/类
@Override
public void load(String uri) throws IllegalDataException {
try {
dataSource = new JsonStrSource(Uri.parse(uri));
} catch (Exception e) {
throw new IllegalDataException(e);
}
}
示例9: load
import master.flame.danmaku.danmaku.loader.IllegalDataException; //导入依赖的package包/类
public void load(String uri) throws IllegalDataException {
try {
this.dataSource = new AndroidFileSource(uri);
} catch (Throwable e) {
throw new IllegalDataException(e);
}
}
示例10: load
import master.flame.danmaku.danmaku.loader.IllegalDataException; //导入依赖的package包/类
public void load(String uri) throws IllegalDataException {
try {
this.dataSource = new JSONSource(Uri.parse(uri));
} catch (Throwable e) {
throw new IllegalDataException(e);
}
}
示例11: load
import master.flame.danmaku.danmaku.loader.IllegalDataException; //导入依赖的package包/类
public void load(String uri) throws IllegalDataException {
try {
dataSource = new AndroidFileSource(uri);
} catch (Exception e) {
throw new IllegalDataException(e);
}
}
示例12: load
import master.flame.danmaku.danmaku.loader.IllegalDataException; //导入依赖的package包/类
@Override
public void load(String uri) throws IllegalDataException {
try {
dataSource = new JSONSource(Uri.parse(uri));
} catch (Exception e) {
throw new IllegalDataException(e);
}
}
示例13: createParser
import master.flame.danmaku.danmaku.loader.IllegalDataException; //导入依赖的package包/类
/**
* 弹幕解析器
*/
private BaseDanmakuParser createParser(String uri) {
if (uri == null) {
return new BaseDanmakuParser() {
@Override
protected Danmakus parse() {
return new Danmakus();
}
};
}
ILoader loader = DanmakuLoaderFactory.create(DanmakuLoaderFactory.TAG_BILI);
try {
if(uri == null){
return null;
}
loader.load(uri);
} catch (IllegalDataException e) {
e.printStackTrace();
}
BaseDanmakuParser parser = new BiliDanmukuParser();
IDataSource<?> dataSource = loader.getDataSource();
parser.load(dataSource);
return parser;
}
示例14: load
import master.flame.danmaku.danmaku.loader.IllegalDataException; //导入依赖的package包/类
public void load(String uri) throws IllegalDataException {
try {
dataSource = new AndroidFileSource(uri);
} catch (Exception e) {
throw new IllegalDataException(e);
}
}
示例15: createParser
import master.flame.danmaku.danmaku.loader.IllegalDataException; //导入依赖的package包/类
public static BaseDanmakuParser createParser(InputStream stream) {
if (stream == null) {
return new BaseDanmakuParser() {
@Override
protected Danmakus parse() {
return new Danmakus();
}
};
}
// ILoader loader = DanmakuLoaderFactory.create(DanmakuLoaderFactory.TAG_BILI);
ILoader loader = DanmakuLoaderFactory.create(DanmakuLoaderFactory.TAG_ACFUN);
try {
loader.load(stream);
} catch (IllegalDataException e) {
e.printStackTrace();
}
// BaseDanmakuParser parser = new BiliDanmukuParser();
BaseDanmakuParser parser = new AcFunDanmakuParser();
IDataSource<?> dataSource = loader.getDataSource();
parser.load(dataSource);
return parser;
}