|
你可以看看
public void jsmethod_configPlayerView(UZModuleContext uzModuleContext) {
JSONObject rect = uzModuleContext.optJSONObject("rect");
if (null != rect) {
x = rect.optInt("x");
y = rect.optInt("y");
w = rect.optInt("w");
h = rect.optInt("h");
LogUtil.logd("[configPlayerView]" + "h== " + h + "; w== " + w);
}
if (null == mplayerView) {
mplayerView = new TXCloudVideoView(context());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
mplayerView.setBackgroundColor(Color.parseColor("#000000"));
}
}
RelativeLayout.LayoutParams rlp = new RelativeLayout.LayoutParams(w, h);
rlp.leftMargin = x;
rlp.topMargin = y;
fixedOn = uzModuleContext.optString("fixedOn");
//fixed参数标识UI模块是否跟随网页滚动
fixed = uzModuleContext.optBoolean("fixed", true);
insertViewToCurWindow(mplayerView, rlp, fixedOn, fixed);
}
public void jsmethod_resizePlayerView(UZModuleContext uzModuleContext) {
JSONObject rect = uzModuleContext.optJSONObject("rect");
if (null != rect) {
x = rect.optInt("x");
y = rect.optInt("y");
w = rect.optInt("w");
h = rect.optInt("h");
LogUtil.logd("[configPlayerView]" + "h== " + h + "; w== " + w);
RelativeLayout.LayoutParams rlp = new RelativeLayout.LayoutParams(w, h);
rlp.leftMargin = x;
rlp.topMargin = y;
insertViewToCurWindow(mplayerView, rlp, fixedOn, fixed);
}
} |
|