本文整理汇总了Java中master.flame.danmaku.danmaku.parser.IDataSource类的典型用法代码示例。如果您正苦于以下问题:Java IDataSource类的具体用法?Java IDataSource怎么用?Java IDataSource使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IDataSource类属于master.flame.danmaku.danmaku.parser包,在下文中一共展示了IDataSource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: get
import master.flame.danmaku.danmaku.parser.IDataSource; //导入依赖的package包/类
public static HttpClient get() {
HttpParams httpParams = new BasicHttpParams();
ConnManagerParams.setTimeout(httpParams, 3000);
ConnManagerParams.setMaxConnectionsPerRoute(httpParams, new ConnPerRouteBean(30));
ConnManagerParams.setMaxTotalConnections(httpParams, 30);
HttpClientParams.setRedirecting(httpParams, true);
HttpProtocolParams.setUseExpectContinue(httpParams, true);
HttpConnectionParams.setStaleCheckingEnabled(httpParams, false);
HttpConnectionParams.setSoTimeout(httpParams, 2000);
HttpConnectionParams.setConnectionTimeout(httpParams, 2000);
HttpConnectionParams.setTcpNoDelay(httpParams, true);
HttpConnectionParams.setSocketBufferSize(httpParams, 8192);
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme(IDataSource.SCHEME_HTTP_TAG, PlainSocketFactory.getSocketFactory(), 80));
try {
KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
trustStore.load(null, null);
SSLSocketFactory sf = new MySSLSocketFactory(trustStore);
sf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
schemeRegistry.register(new Scheme(IDataSource.SCHEME_HTTPS_TAG, sf, 443));
} catch (Exception ex) {
ex.printStackTrace();
}
return new DefaultHttpClient(new ThreadSafeClientConnManager(httpParams, schemeRegistry), httpParams);
}
示例2: setDanmakuSource
import master.flame.danmaku.danmaku.parser.IDataSource; //导入依赖的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;
}
示例3: initDataFromIntent
import master.flame.danmaku.danmaku.parser.IDataSource; //导入依赖的package包/类
private void initDataFromIntent() {
Intent intent = getIntent();
this.mPlayType = intent.getIntExtra(PlayConstant.PLAY_TYPE, 0);
this.mLaunchMode = intent.getIntExtra("launchMode", 0);
this.mFromLaunch = intent.getIntExtra("from", 0);
this.mFull = intent.getBooleanExtra(PlayConstant.LIVE_FULL_ONLY, false);
this.mIsPanoramaVideo = intent.getSerializableExtra(PlayConstant.VIDEO_TYPE) == VideoType.Panorama;
if (this.mLaunchMode == 0) {
String path = null;
if (!(getIntent() == null || getIntent().getData() == null)) {
Uri uriPath = getIntent().getData();
String scheme = uriPath.getScheme();
path = (scheme == null || scheme.equals(IDataSource.SCHEME_FILE_TAG)) ? uriPath.getPath() : uriPath.toString();
}
this.mLaunchMode = 1;
intent.putExtra("launchMode", 1);
intent.putExtra(PlayConstant.URI, path);
intent.putExtra("seek", 0);
intent.putExtra(PlayConstant.PLAY_MODE, 1);
}
if (this.mFromLaunch == 13) {
LetvApplication.getInstance().setPush(true);
} else if (intent.getBooleanExtra("isFromPush", false)) {
LetvApplication.getInstance().setPush(true);
} else if (intent.getBooleanExtra("isLiveFromPush", false)) {
LetvApplication.getInstance().setPush(true);
}
}
示例4: shouldOverrideUrlLoading
import master.flame.danmaku.danmaku.parser.IDataSource; //导入依赖的package包/类
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
boolean z = true;
f.b(f.d, "-->(AppbarDialog)shouldOverrideUrlLoading : url = " + str);
if (TextUtils.isEmpty(str)) {
return false;
}
if (str.startsWith(IDataSource.SCHEME_HTTP_TAG) || str.startsWith(IDataSource.SCHEME_HTTPS_TAG)) {
return super.shouldOverrideUrlLoading(webView, str);
}
if (str.startsWith(AppbarJsBridge.JS_BRIDGE_SCHEME)) {
this.a.jsBridge.invoke(str);
return true;
} else if (!str.equals("about:blank;") && !str.equals("about:blank")) {
return false;
} else {
if (VERSION.SDK_INT >= 11) {
z = false;
}
return z;
}
}
示例5: a
import master.flame.danmaku.danmaku.parser.IDataSource; //导入依赖的package包/类
public static String a(String str) {
if (TextUtils.isEmpty(str)) {
return str;
}
URI i = i(str);
if (i == null) {
return str;
}
String scheme = i.getScheme();
if (TextUtils.isEmpty(scheme)) {
return IDataSource.SCHEME_HTTP_TAG + str;
}
String toLowerCase = scheme.toLowerCase();
if (scheme == null || scheme.equals(toLowerCase)) {
return str;
}
int indexOf = str.indexOf(scheme);
return indexOf >= 0 ? toLowerCase + str.substring(scheme.length() + indexOf) : str;
}
示例6: initDataFromIntent
import master.flame.danmaku.danmaku.parser.IDataSource; //导入依赖的package包/类
private boolean initDataFromIntent(Intent data) {
Bundle bundle = data.getExtras();
this.mRequestParam = createBrowserRequestParam(bundle);
if (this.mRequestParam != null) {
this.mUrl = this.mRequestParam.getUrl();
this.mSpecifyTitle = this.mRequestParam.getSpecifyTitle();
} else {
String url = bundle.getString("key_url");
String specifyTitle = bundle.getString("key_specify_title");
if (!TextUtils.isEmpty(url) && url.startsWith(IDataSource.SCHEME_HTTP_TAG)) {
this.mUrl = url;
this.mSpecifyTitle = specifyTitle;
}
}
if (TextUtils.isEmpty(this.mUrl)) {
return false;
}
LogUtil.d(TAG, "LOAD URL : " + this.mUrl);
return true;
}
示例7: createParser
import master.flame.danmaku.danmaku.parser.IDataSource; //导入依赖的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: createParser
import master.flame.danmaku.danmaku.parser.IDataSource; //导入依赖的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;
}
示例9: createParser
import master.flame.danmaku.danmaku.parser.IDataSource; //导入依赖的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;
}
示例10: createParser
import master.flame.danmaku.danmaku.parser.IDataSource; //导入依赖的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;
}
示例11: createParser
import master.flame.danmaku.danmaku.parser.IDataSource; //导入依赖的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;
}
示例12: createParser
import master.flame.danmaku.danmaku.parser.IDataSource; //导入依赖的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;
}
示例13: getUrlWithQueryString
import master.flame.danmaku.danmaku.parser.IDataSource; //导入依赖的package包/类
public static String getUrlWithQueryString(String url, RequestParams params) {
if (params != null) {
String paramString = params.getParamString();
if (url.indexOf("?") == -1) {
url = new StringBuilder(String.valueOf(url)).append("?").append(paramString).toString();
} else {
url = new StringBuilder(String.valueOf(url)).append("&").append(paramString).toString();
}
}
EALogger.i(IDataSource.SCHEME_HTTP_TAG, url);
return url;
}
示例14: getTitleInfo
import master.flame.danmaku.danmaku.parser.IDataSource; //导入依赖的package包/类
public TitleStatus getTitleInfo(String pageflag) {
if (!(this.titleList == null || this.titleList.size() <= 0 || TextUtils.isEmpty(pageflag))) {
for (int i = 0; i < this.titleList.size(); i++) {
if (pageflag.equals(((TitleStatus) this.titleList.get(i)).getPageFlag())) {
TitleStatus titleStatus = (TitleStatus) this.titleList.get(i);
EALogger.i(IDataSource.SCHEME_HTTP_TAG, "标题栏信息:" + titleStatus.getPageFlag() + titleStatus.getTitle() + titleStatus.getHasShare() + titleStatus.getHasMore() + titleStatus.getMenuList().size());
return titleStatus;
}
}
}
return null;
}
示例15: Json2Entity
import master.flame.danmaku.danmaku.parser.IDataSource; //导入依赖的package包/类
public BaseBean Json2Entity(String content) {
this.cashierInfo = new CashierInfo();
EALogger.i(IDataSource.SCHEME_HTTP_TAG, "收银台接口数据:" + content);
try {
JSONObject jo = new JSONObject(content);
this.cashierInfo.setStatus(jo.optString("status"));
this.cashierInfo.setMessage(jo.optString("message"));
JSONObject result = jo.optJSONObject("result");
if (result == null) {
return this.cashierInfo;
}
JSONObject object = result.optJSONObject("payMentResult");
if (object != null) {
this.cashierInfo.setVersion(object.optString("version"));
this.cashierInfo.setService(object.optString(NotificationCompat.CATEGORY_SERVICE));
this.cashierInfo.setMerchant_business_id(object.optString("merchantBusinessId"));
this.cashierInfo.setUser_id(object.optString(UserInfoDb.USER_ID));
this.cashierInfo.setNotify_url(object.optString("notifyUrl"));
this.cashierInfo.setMerchant_no(object.optString("merchantNo"));
this.cashierInfo.setOut_trade_no(object.optString("outTradeNo"));
this.cashierInfo.setPrice(object.optString("price"));
this.cashierInfo.setCurrency(object.optString("currency"));
this.cashierInfo.setPay_expire(object.optString("payExpire"));
this.cashierInfo.setProduct_id(object.optString("productId"));
this.cashierInfo.setProduct_name(object.optString("productName"));
this.cashierInfo.setProduct_desc(object.optString("productDesc"));
this.cashierInfo.setTimestamp(object.optString("timestamp"));
this.cashierInfo.setKey_index(object.optString("keyIndex"));
this.cashierInfo.setInput_charset(object.optString("inputCharset"));
this.cashierInfo.setIp(object.optString("ip"));
this.cashierInfo.setSign_type(object.optString("signType"));
this.cashierInfo.setSign(object.optString(TradeInfo.SIGN));
this.cashierInfo.setHb_fq(object.optString("hbFq"));
}
return this.cashierInfo;
} catch (Exception e) {
e.printStackTrace();
}
}