Files
rr3-apk/decompiled/sources/com/mbridge/msdk/video/module/MBridgeVideoView.java
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

3066 lines
128 KiB
Java
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.mbridge.msdk.video.module;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.drawable.GradientDrawable;
import android.os.Handler;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AlphaAnimation;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.core.app.NotificationCompat;
import com.applovin.impl.sdk.utils.JsonUtils;
import com.iab.omid.library.mmadbridge.adsession.AdSession;
import com.iab.omid.library.mmadbridge.adsession.FriendlyObstructionPurpose;
import com.iab.omid.library.mmadbridge.adsession.media.InteractionType;
import com.iab.omid.library.mmadbridge.adsession.media.MediaEvents;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import com.ironsource.v8;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.c.g;
import com.mbridge.msdk.dycreator.baseview.cusview.MBridgeBaitClickView;
import com.mbridge.msdk.dycreator.baseview.cusview.MBridgeSegmentsProgressBar;
import com.mbridge.msdk.dycreator.baseview.cusview.SoundImageView;
import com.mbridge.msdk.dycreator.baseview.rewardpopview.AcquireRewardPopViewBehaviourListener;
import com.mbridge.msdk.dycreator.baseview.rewardpopview.AcquireRewardPopViewParameters;
import com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.d.d;
import com.mbridge.msdk.foundation.same.report.d.e;
import com.mbridge.msdk.foundation.same.report.i;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.ah;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.foundation.tools.ap;
import com.mbridge.msdk.foundation.tools.aq;
import com.mbridge.msdk.foundation.tools.p;
import com.mbridge.msdk.foundation.tools.x;
import com.mbridge.msdk.mbsignalcommon.commonwebview.CollapsibleWebView;
import com.mbridge.msdk.mbsignalcommon.commonwebview.CommonWebView;
import com.mbridge.msdk.playercommon.DefaultVideoPlayerStatusListener;
import com.mbridge.msdk.playercommon.PlayerView;
import com.mbridge.msdk.video.dynview.e.f;
import com.mbridge.msdk.video.dynview.e.h;
import com.mbridge.msdk.video.signal.j;
import com.mbridge.msdk.widget.FeedBackButton;
import com.mbridge.msdk.widget.dialog.MBAlertDialog;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class MBridgeVideoView extends MBridgeBaseView implements j {
private static long aQ = 0;
private static int m = 0;
private static int n = 0;
private static int o = 0;
private static int p = 0;
private static int q = 0;
private static boolean r = false;
private com.mbridge.msdk.video.module.a.a A;
private a B;
private boolean C;
private com.mbridge.msdk.video.dynview.e.a D;
private f E;
private int F;
private boolean G;
private FrameLayout H;
private MBridgeClickCTAView I;
private com.mbridge.msdk.video.signal.factory.b J;
private int K;
private int L;
private RelativeLayout M;
private boolean N;
private boolean O;
private boolean P;
private String Q;
private int R;
private int S;
private int T;
private MBAlertDialog U;
private com.mbridge.msdk.widget.dialog.a V;
private String W;
private boolean aA;
private boolean aB;
private boolean aC;
private AlphaAnimation aD;
private MBridgeBaitClickView aE;
private int aF;
private int aG;
private int aH;
private int aI;
private AcquireRewardPopViewParameters aJ;
private MBAcquireRewardPopView aK;
private boolean aL;
private RelativeLayout aM;
private CollapsibleWebView aN;
private RelativeLayout aO;
private boolean aP;
private int aR;
private boolean aS;
private boolean aT;
private c aU;
private boolean aV;
private Runnable aW;
private final Runnable aX;
private double aa;
private double ab;
private boolean ac;
private boolean ad;
private boolean ae;
private boolean af;
private boolean ag;
private boolean ah;
private boolean ai;
private boolean aj;
private boolean ak;
private int al;
private boolean am;
private int an;
private AdSession ao;
private MediaEvents ap;
private String aq;
private int ar;
private int as;
private int at;
private boolean au;
private boolean av;
private boolean aw;
private boolean ax;
private boolean ay;
private boolean az;
public List<CampaignEx> mCampOrderViewData;
public int mCampaignSize;
public int mCurrPlayNum;
public int mCurrentPlayProgressTime;
public int mMuteSwitch;
public PlayerView mPlayerView;
public SoundImageView mSoundImageView;
private TextView s;
private View t;
public TextView tvFlag;
private RelativeLayout u;
private ImageView v;
private ProgressBar w;
private FeedBackButton x;
private ImageView y;
private MBridgeSegmentsProgressBar z;
public interface a {
void a();
}
@Override // com.mbridge.msdk.video.signal.j
public int getBorderViewHeight() {
return q;
}
@Override // com.mbridge.msdk.video.signal.j
public int getBorderViewLeft() {
return o;
}
@Override // com.mbridge.msdk.video.signal.j
public int getBorderViewRadius() {
return m;
}
@Override // com.mbridge.msdk.video.signal.j
public int getBorderViewTop() {
return n;
}
@Override // com.mbridge.msdk.video.signal.j
public int getBorderViewWidth() {
return p;
}
public int getCloseAlert() {
return this.T;
}
public int getMute() {
return this.an;
}
public String getUnitId() {
return this.W;
}
public int getVideoSkipTime() {
return this.R;
}
@Override // com.mbridge.msdk.video.module.MBridgeBaseView
public void init(Context context) {
}
public boolean isInstDialogShowing() {
return this.aL;
}
public boolean isMiniCardShowing() {
return this.af;
}
public boolean isRewardPopViewShowing() {
return this.P;
}
public boolean isShowingAlertView() {
return this.O;
}
public boolean isShowingTransparent() {
return this.ak;
}
@Override // com.mbridge.msdk.video.signal.j
public void notifyCloseBtn(int i) {
if (i == 0) {
this.ah = true;
this.aj = false;
} else if (i == 1) {
this.ai = true;
}
}
public void setAdSession(AdSession adSession) {
this.ao = adSession;
}
public void setBufferTimeout(int i) {
this.S = i;
}
public void setCloseAlert(int i) {
this.T = i;
}
public void setContainerViewOnNotifyListener(com.mbridge.msdk.video.module.a.a aVar) {
this.A = aVar;
}
public void setIPlayVideoViewLayoutCallBack(f fVar) {
this.E = fVar;
}
public void setIVRewardEnable(int i, int i2, int i3) {
this.ar = i;
this.as = i2;
this.at = i3;
}
@Override // com.mbridge.msdk.video.signal.j
public void setMiniEndCardState(boolean z) {
this.af = z;
}
public void setPlayURL(String str) {
this.Q = str;
}
public void setPlayerViewAttachListener(a aVar) {
this.B = aVar;
}
@Override // com.mbridge.msdk.video.signal.j
public void setScaleFitXY(int i) {
this.al = i;
}
public void setShowingTransparent(boolean z) {
this.ak = z;
}
public void setSoundState(int i) {
this.an = i;
}
public void setVideoSkipTime(int i) {
this.R = i;
}
public static /* synthetic */ int aa(MBridgeVideoView mBridgeVideoView) {
int i = mBridgeVideoView.aG;
mBridgeVideoView.aG = i - 1;
return i;
}
public MBridgeVideoView(Context context) {
super(context);
this.mCampaignSize = 1;
this.mCurrPlayNum = 1;
this.mCurrentPlayProgressTime = 0;
this.mMuteSwitch = 0;
this.C = false;
this.F = 0;
this.N = false;
this.O = false;
this.P = false;
this.W = "";
this.ac = false;
this.ad = false;
this.ae = false;
this.af = false;
this.ag = false;
this.ah = false;
this.ai = false;
this.aj = false;
this.ak = false;
this.am = false;
this.an = 2;
this.au = false;
this.av = false;
this.aw = false;
this.ax = true;
this.ay = false;
this.az = false;
this.aA = false;
this.aB = false;
this.aC = false;
this.aF = 0;
this.aG = 5;
this.aH = 5;
this.aI = 5;
this.aL = false;
this.aP = false;
this.aR = 0;
this.aS = false;
this.aT = false;
this.aU = new c(this);
this.aV = false;
this.aW = new Runnable() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.1
@Override // java.lang.Runnable
public final void run() {
if (MBridgeVideoView.this.H != null) {
MBridgeVideoView.this.H.setVisibility(8);
}
}
};
this.aX = new Runnable() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.13
@Override // java.lang.Runnable
public final void run() {
if (MBridgeVideoView.this.aG <= 0) {
MBridgeVideoView.this.showRewardPopView();
MBridgeVideoView mBridgeVideoView = MBridgeVideoView.this;
mBridgeVideoView.removeCallbacks(mBridgeVideoView.aX);
} else {
MBridgeVideoView.aa(MBridgeVideoView.this);
MBridgeVideoView mBridgeVideoView2 = MBridgeVideoView.this;
mBridgeVideoView2.postDelayed(mBridgeVideoView2.aX, 1000L);
}
}
};
}
public MBridgeVideoView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.mCampaignSize = 1;
this.mCurrPlayNum = 1;
this.mCurrentPlayProgressTime = 0;
this.mMuteSwitch = 0;
this.C = false;
this.F = 0;
this.N = false;
this.O = false;
this.P = false;
this.W = "";
this.ac = false;
this.ad = false;
this.ae = false;
this.af = false;
this.ag = false;
this.ah = false;
this.ai = false;
this.aj = false;
this.ak = false;
this.am = false;
this.an = 2;
this.au = false;
this.av = false;
this.aw = false;
this.ax = true;
this.ay = false;
this.az = false;
this.aA = false;
this.aB = false;
this.aC = false;
this.aF = 0;
this.aG = 5;
this.aH = 5;
this.aI = 5;
this.aL = false;
this.aP = false;
this.aR = 0;
this.aS = false;
this.aT = false;
this.aU = new c(this);
this.aV = false;
this.aW = new Runnable() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.1
@Override // java.lang.Runnable
public final void run() {
if (MBridgeVideoView.this.H != null) {
MBridgeVideoView.this.H.setVisibility(8);
}
}
};
this.aX = new Runnable() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.13
@Override // java.lang.Runnable
public final void run() {
if (MBridgeVideoView.this.aG <= 0) {
MBridgeVideoView.this.showRewardPopView();
MBridgeVideoView mBridgeVideoView = MBridgeVideoView.this;
mBridgeVideoView.removeCallbacks(mBridgeVideoView.aX);
} else {
MBridgeVideoView.aa(MBridgeVideoView.this);
MBridgeVideoView mBridgeVideoView2 = MBridgeVideoView.this;
mBridgeVideoView2.postDelayed(mBridgeVideoView2.aX, 1000L);
}
}
};
}
public void setCamPlayOrderCallback(com.mbridge.msdk.video.dynview.e.a aVar, List<CampaignEx> list, int i, int i2) {
MBridgeSegmentsProgressBar mBridgeSegmentsProgressBar;
this.D = aVar;
this.mCampaignSize = list.size();
this.mCurrPlayNum = i;
this.F = i2;
this.mCampOrderViewData = list;
CampaignEx campaignEx = this.b;
if (campaignEx == null || campaignEx.getDynamicTempCode() != 5) {
CampaignEx campaignEx2 = this.b;
if (campaignEx2 == null || campaignEx2.getProgressBarShow() != 1 || (mBridgeSegmentsProgressBar = this.z) == null) {
return;
}
mBridgeSegmentsProgressBar.init(1, 3);
this.z.setVisibility(0);
return;
}
MBridgeSegmentsProgressBar mBridgeSegmentsProgressBar2 = this.z;
if (mBridgeSegmentsProgressBar2 == null || this.mCampOrderViewData == null) {
return;
}
if (this.mCampaignSize > 1) {
mBridgeSegmentsProgressBar2.setVisibility(0);
this.z.init(this.mCampaignSize, 2);
for (int i3 = 0; i3 < this.mCampOrderViewData.size(); i3++) {
int videoPlayProgress = this.mCampOrderViewData.get(i3).getVideoPlayProgress();
if (videoPlayProgress > 0) {
this.z.setProgress(videoPlayProgress, i3);
}
if (this.mCampOrderViewData.get(i3).isRewardPopViewShowed) {
this.N = true;
}
}
return;
}
CampaignEx campaignEx3 = this.b;
if (campaignEx3 == null || campaignEx3.getProgressBarShow() != 1) {
this.z.setVisibility(8);
return;
}
MBridgeSegmentsProgressBar mBridgeSegmentsProgressBar3 = this.z;
if (mBridgeSegmentsProgressBar3 != null) {
mBridgeSegmentsProgressBar3.init(1, 3);
this.z.setVisibility(0);
}
}
public void setUnitId(String str) {
this.W = str;
c cVar = this.aU;
if (cVar != null) {
cVar.a(str);
}
}
public void setVideoLayout(CampaignEx campaignEx) {
if (campaignEx != null) {
this.b = campaignEx;
this.h = campaignEx.isDynamicView();
}
if (this.h) {
final com.mbridge.msdk.video.dynview.c a2 = new com.mbridge.msdk.video.dynview.j.c().a(this, campaignEx);
com.mbridge.msdk.video.dynview.b.a().a(a2, new h() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.12
@Override // com.mbridge.msdk.video.dynview.e.h
public final void viewInflaterSuccess(com.mbridge.msdk.video.dynview.a aVar) {
if (aVar != null) {
if (this != null && aVar.a() != null) {
aVar.a().setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
this.addView(aVar.a());
}
if (aVar.b() != null) {
Iterator<View> it = aVar.b().iterator();
while (it.hasNext()) {
it.next().setOnClickListener(new com.mbridge.msdk.widget.a() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.12.1
@Override // com.mbridge.msdk.widget.a
public final void onNoDoubleClick(View view) {
if (view instanceof TextView) {
MBridgeVideoView.this.b.setTriggerClickSource(1);
} else {
MBridgeVideoView.this.b.setTriggerClickSource(2);
}
if (MBridgeVideoView.this.b.getRewardTemplateMode() != null && MBridgeVideoView.this.b.getRewardTemplateMode().f() == 902) {
MBridgeVideoView.b(MBridgeVideoView.this);
} else {
MBridgeVideoView.a(MBridgeVideoView.this, "video_play_click");
}
}
});
}
}
MBridgeVideoView.this.aC = aVar.c();
MBridgeVideoView.this.b();
boolean unused = MBridgeVideoView.r = false;
MBridgeVideoView mBridgeVideoView = MBridgeVideoView.this;
CampaignEx campaignEx2 = mBridgeVideoView.b;
if (campaignEx2 != null) {
campaignEx2.setTemplateRenderSucc(mBridgeVideoView.aC);
}
MBridgeVideoView.this.K = a2.j();
MBridgeVideoView.this.L = a2.m();
}
}
@Override // com.mbridge.msdk.video.dynview.e.h
public final void viewInflaterFail(com.mbridge.msdk.video.dynview.c.a aVar) {
af.b(MBridgeBaseView.TAG, "errorMsg" + aVar.b());
}
});
return;
}
int findLayout = findLayout("mbridge_reward_videoview_item");
if (findLayout > 0) {
this.c.inflate(findLayout, this);
b();
}
r = false;
CampaignEx campaignEx2 = this.b;
if (campaignEx2 == null || campaignEx2.getAdSpaceT() != 2 || this.tvFlag == null) {
return;
}
String language = Locale.getDefault().getLanguage();
if (!TextUtils.isEmpty(language) && language.equals("zh")) {
this.tvFlag.setText("广告");
} else {
this.tvFlag.setText("AD");
}
}
/* JADX INFO: Access modifiers changed from: private */
public void b() {
PlayerView playerView;
boolean f = f();
this.e = f;
if (!f) {
af.b(MBridgeBaseView.TAG, "MBridgeVideoView init fail");
}
if (ah.a().a("i_l_s_t_r_i", false) && (playerView = this.mPlayerView) != null) {
playerView.setNotifyListener(new PlayerView.OnPlayerViewVisibleListener() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.14
@Override // com.mbridge.msdk.playercommon.PlayerView.OnPlayerViewVisibleListener
public final void playerViewVisibleCallback() {
if (MBridgeVideoView.this.C) {
return;
}
MBridgeVideoView.this.C = true;
MBridgeVideoView mBridgeVideoView = MBridgeVideoView.this;
if (mBridgeVideoView.notifyListener == null || mBridgeVideoView.B == null) {
return;
}
MBridgeVideoView mBridgeVideoView2 = MBridgeVideoView.this;
mBridgeVideoView2.notifyListener.a(20, mBridgeVideoView2.B);
}
});
}
c();
AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 100.0f);
this.aD = alphaAnimation;
alphaAnimation.setDuration(200L);
}
public void setIsIV(boolean z) {
this.am = z;
c cVar = this.aU;
if (cVar != null) {
cVar.a(z);
}
}
@Override // com.mbridge.msdk.video.module.MBridgeBaseView
public void setCampaign(CampaignEx campaignEx) {
int r2;
super.setCampaign(campaignEx);
c cVar = this.aU;
if (cVar != null) {
cVar.a(campaignEx);
c cVar2 = this.aU;
if (campaignEx != null) {
if (campaignEx.getReady_rate() != -1) {
r2 = campaignEx.getReady_rate();
} else {
r2 = com.mbridge.msdk.videocommon.d.b.a().a(com.mbridge.msdk.foundation.controller.c.m().k(), this.W, false).r();
}
} else {
r2 = com.mbridge.msdk.videocommon.d.b.a().a(com.mbridge.msdk.foundation.controller.c.m().k(), this.W, false).r();
}
cVar2.a(r2, com.mbridge.msdk.videocommon.d.b.a().a(com.mbridge.msdk.foundation.controller.c.m().k(), this.W, false).s());
}
}
@Override // com.mbridge.msdk.video.module.MBridgeBaseView
public final void c() {
super.c();
if (this.e) {
if (this.h) {
if (com.mbridge.msdk.video.dynview.i.a.a(this.b) == -1 || com.mbridge.msdk.video.dynview.i.a.a(this.b) == 100) {
this.mPlayerView.setOnClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.15
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
if (MBridgeVideoView.this.notifyListener != null) {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put(com.mbridge.msdk.foundation.same.a.j, MBridgeVideoView.this.mPlayerView.buildH5JsonObject(0));
} catch (Exception e) {
e.printStackTrace();
}
MBridgeVideoView.this.b.setClickTempSource(1);
MBridgeVideoView.this.b.setTriggerClickSource(2);
MBridgeVideoView.this.notifyListener.a(1, jSONObject);
}
if (MBridgeVideoView.this.ap != null) {
try {
MBridgeVideoView.this.ap.adUserInteraction(InteractionType.CLICK);
af.a("omsdk", "play video view: click");
} catch (Exception e2) {
af.b("omsdk", e2.getMessage());
}
}
MBridgeVideoView.this.setCTALayoutVisibleOrGone();
}
});
}
} else {
this.mPlayerView.setOnClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.16
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
MBridgeVideoView.this.b.setClickTempSource(1);
MBridgeVideoView.this.b.setTriggerClickSource(2);
d.a().a("m_player_click", MBridgeVideoView.this.b);
if (MBridgeVideoView.this.notifyListener != null) {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put(com.mbridge.msdk.foundation.same.a.j, MBridgeVideoView.this.mPlayerView.buildH5JsonObject(0));
} catch (Exception e) {
e.printStackTrace();
}
MBridgeVideoView.this.notifyListener.a(1, jSONObject);
}
}
});
}
SoundImageView soundImageView = this.mSoundImageView;
if (soundImageView != null) {
soundImageView.setOnClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.17
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
e eVar = new e();
Integer num = 2;
PlayerView playerView = MBridgeVideoView.this.mPlayerView;
if (playerView != null) {
eVar.a("mute_state", Boolean.valueOf(playerView.isSilent()));
if (MBridgeVideoView.this.mPlayerView.isSilent()) {
num = 1;
}
}
if (num.intValue() == 1) {
MBridgeVideoView.this.mMuteSwitch = 2;
} else {
MBridgeVideoView.this.mMuteSwitch = 1;
}
com.mbridge.msdk.video.module.a.a aVar = MBridgeVideoView.this.notifyListener;
if (aVar != null) {
aVar.a(5, num);
}
d.a().a("m_sound_click", MBridgeVideoView.this.b, eVar);
}
});
}
this.t.setOnClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.18
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
try {
e eVar = new e();
eVar.a("type", 1);
d.a().a("2000152", eVar);
d.a().a("2000148", MBridgeVideoView.this.b, eVar);
} catch (Exception e) {
if (MBridgeConstans.DEBUG) {
e.printStackTrace();
}
}
if (MBridgeVideoView.this.am) {
MBridgeVideoView.this.aB = true;
CampaignEx campaignEx = MBridgeVideoView.this.b;
if (campaignEx == null || campaignEx.getRewardTemplateMode() == null || MBridgeVideoView.this.b.getRewardTemplateMode().f() != 5002010 || !MBridgeVideoView.this.ay) {
if (MBridgeVideoView.this.ax) {
MBridgeVideoView.this.e();
return;
}
com.mbridge.msdk.video.module.a.a aVar = MBridgeVideoView.this.notifyListener;
if (aVar != null) {
aVar.a(123, "");
return;
}
return;
}
MBridgeVideoView mBridgeVideoView = MBridgeVideoView.this;
if (mBridgeVideoView.notifyListener != null) {
mBridgeVideoView.aS = true;
MBridgeVideoView mBridgeVideoView2 = MBridgeVideoView.this;
mBridgeVideoView2.notifyListener.a(2, mBridgeVideoView2.b(mBridgeVideoView2.ay));
return;
}
return;
}
CampaignEx campaignEx2 = MBridgeVideoView.this.b;
if (campaignEx2 == null || campaignEx2.getRewardTemplateMode() == null || MBridgeVideoView.this.b.getRewardTemplateMode().f() != 5002010 || !MBridgeVideoView.this.ay) {
MBridgeVideoView.this.e();
return;
}
MBridgeVideoView mBridgeVideoView3 = MBridgeVideoView.this;
if (mBridgeVideoView3.notifyListener != null) {
mBridgeVideoView3.aS = true;
MBridgeVideoView mBridgeVideoView4 = MBridgeVideoView.this;
mBridgeVideoView4.notifyListener.a(2, mBridgeVideoView4.b(mBridgeVideoView4.ay));
}
}
});
}
}
/* JADX INFO: Access modifiers changed from: private */
/* JADX WARN: Code restructure failed: missing block: B:125:0x013c, code lost:
if (r5 < r0) goto L102;
*/
/* JADX WARN: Code restructure failed: missing block: B:126:0x013e, code lost:
if (r0 == 0) goto L102;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public void e() {
/*
Method dump skipped, instructions count: 369
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.video.module.MBridgeVideoView.e():void");
}
@Override // com.mbridge.msdk.video.signal.j
public void hideAlertView(int i) {
if (this.O) {
this.O = false;
this.au = true;
setShowingAlertViewCover(false);
com.mbridge.msdk.videocommon.d.b.a().a(com.mbridge.msdk.foundation.controller.c.m().k(), this.W, false);
i.a(this.a, this.b, com.mbridge.msdk.videocommon.d.c.a, this.W, 1, i, 1);
if (i == 0) {
h();
if (this.am) {
int i2 = this.ar;
if (i2 == com.mbridge.msdk.foundation.same.a.I || i2 == com.mbridge.msdk.foundation.same.a.H) {
this.av = true;
com.mbridge.msdk.video.module.a.a aVar = this.notifyListener;
if (aVar != null) {
aVar.a(124, "");
}
CampaignEx campaignEx = this.b;
if (campaignEx != null && campaignEx.getRewardTemplateMode() != null && this.b.getRewardTemplateMode().f() == 5002010) {
j();
return;
} else {
this.aA = true;
gonePlayingCloseView();
return;
}
}
return;
}
return;
}
this.aw = true;
boolean z = this.am;
if (z && this.ar == com.mbridge.msdk.foundation.same.a.I) {
h();
return;
}
if (z && this.ar == com.mbridge.msdk.foundation.same.a.H) {
com.mbridge.msdk.video.module.a.a aVar2 = this.notifyListener;
if (aVar2 != null) {
this.aS = true;
aVar2.a(2, b(this.ay));
return;
}
return;
}
com.mbridge.msdk.video.module.a.a aVar3 = this.notifyListener;
if (aVar3 != null) {
this.aS = true;
aVar3.a(2, "");
}
}
}
@Override // com.mbridge.msdk.video.signal.j
public void alertWebViewShowed() {
this.O = true;
setShowingAlertViewCover(true);
}
@Override // com.mbridge.msdk.video.signal.j
public void dismissAllAlert() {
MBAlertDialog mBAlertDialog = this.U;
if (mBAlertDialog != null) {
mBAlertDialog.dismiss();
}
com.mbridge.msdk.video.module.a.a aVar = this.notifyListener;
if (aVar != null) {
aVar.a(125, "");
}
}
public void setInstDialogState(boolean z) {
PlayerView playerView;
this.aL = z;
if (!com.mbridge.msdk.e.b.a() || (playerView = this.mPlayerView) == null) {
return;
}
playerView.setIsCovered(z);
}
@Override // com.mbridge.msdk.video.signal.j
public void showAlertView() {
CampaignEx campaignEx;
if (this.af) {
return;
}
if (this.V == null) {
this.V = new com.mbridge.msdk.widget.dialog.a() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.19
@Override // com.mbridge.msdk.widget.dialog.a
public final void c() {
}
@Override // com.mbridge.msdk.widget.dialog.a
public final void a() {
MBridgeVideoView.this.O = false;
MBridgeVideoView mBridgeVideoView = MBridgeVideoView.this;
mBridgeVideoView.setShowingAlertViewCover(mBridgeVideoView.O);
if (MBridgeVideoView.this.am && (MBridgeVideoView.this.ar == com.mbridge.msdk.foundation.same.a.I || MBridgeVideoView.this.ar == com.mbridge.msdk.foundation.same.a.H)) {
MBridgeVideoView.this.av = true;
com.mbridge.msdk.video.module.a.a aVar = MBridgeVideoView.this.notifyListener;
if (aVar != null) {
aVar.a(124, "");
}
MBridgeVideoView.this.aA = true;
MBridgeVideoView.this.gonePlayingCloseView();
}
MBridgeVideoView.this.h();
MBridgeVideoView mBridgeVideoView2 = MBridgeVideoView.this;
i.a(mBridgeVideoView2.a, mBridgeVideoView2.b, mBridgeVideoView2.aq, MBridgeVideoView.this.W, 1, 0, 1);
}
@Override // com.mbridge.msdk.widget.dialog.a
public final void b() {
MBridgeVideoView.this.O = false;
MBridgeVideoView.this.aw = true;
MBridgeVideoView mBridgeVideoView = MBridgeVideoView.this;
mBridgeVideoView.setShowingAlertViewCover(mBridgeVideoView.O);
MBridgeVideoView mBridgeVideoView2 = MBridgeVideoView.this;
i.a(mBridgeVideoView2.a, mBridgeVideoView2.b, mBridgeVideoView2.aq, MBridgeVideoView.this.W, 1, 1, 1);
if (!MBridgeVideoView.this.am || MBridgeVideoView.this.ar != com.mbridge.msdk.foundation.same.a.H) {
if (MBridgeVideoView.this.am && MBridgeVideoView.this.ar == com.mbridge.msdk.foundation.same.a.I) {
MBridgeVideoView.this.h();
return;
}
MBridgeVideoView mBridgeVideoView3 = MBridgeVideoView.this;
if (mBridgeVideoView3.notifyListener != null) {
mBridgeVideoView3.aS = true;
MBridgeVideoView.this.notifyListener.a(2, "");
return;
}
return;
}
MBridgeVideoView mBridgeVideoView4 = MBridgeVideoView.this;
if (mBridgeVideoView4.notifyListener != null) {
mBridgeVideoView4.aS = true;
MBridgeVideoView mBridgeVideoView5 = MBridgeVideoView.this;
mBridgeVideoView5.notifyListener.a(2, mBridgeVideoView5.b(mBridgeVideoView5.ay));
}
}
};
}
if (this.U == null) {
MBAlertDialog mBAlertDialog = new MBAlertDialog(getContext(), this.V);
this.U = mBAlertDialog;
AdSession adSession = this.ao;
if (adSession != null) {
adSession.addFriendlyObstruction(mBAlertDialog.getWindow().getDecorView(), FriendlyObstructionPurpose.NOT_VISIBLE, null);
}
}
if (this.am) {
this.U.makeIVAlertView(this.ar, this.W);
} else {
this.U.makeRVAlertView(this.W);
}
PlayerView playerView = this.mPlayerView;
if (playerView != null) {
if (playerView.isComplete() && ((campaignEx = this.b) == null || campaignEx.getRewardTemplateMode() == null || this.b.getRewardTemplateMode().f() != 5002010)) {
return;
}
this.U.show();
this.au = true;
this.O = true;
setShowingAlertViewCover(true);
com.mbridge.msdk.videocommon.d.b.a().a(com.mbridge.msdk.foundation.controller.c.m().k(), this.W, false);
String str = com.mbridge.msdk.videocommon.d.c.a;
this.aq = str;
i.a(this.a, this.b, str, this.W, 1, 1);
}
}
public void preLoadData(com.mbridge.msdk.video.signal.factory.b bVar) {
this.J = bVar;
if (!this.e) {
com.mbridge.msdk.video.module.a.a aVar = this.notifyListener;
if (aVar != null) {
aVar.a(12, "MBridgeVideoView initSuccess false");
}
} else if (!TextUtils.isEmpty(this.Q) && this.b != null) {
AdSession adSession = this.ao;
if (adSession != null) {
adSession.registerAdView(this.mPlayerView);
SoundImageView soundImageView = this.mSoundImageView;
if (soundImageView != null) {
this.ao.addFriendlyObstruction(soundImageView, FriendlyObstructionPurpose.OTHER, null);
}
this.ao.addFriendlyObstruction(this.s, FriendlyObstructionPurpose.OTHER, null);
this.ao.addFriendlyObstruction(this.t, FriendlyObstructionPurpose.VIDEO_CONTROLS, null);
}
CampaignEx campaignEx = this.b;
if (campaignEx != null && ap.b(campaignEx.getVideoResolution())) {
String videoResolution = this.b.getVideoResolution();
af.c(MBridgeBaseView.TAG, "MBridgeBaseView videoResolution:" + videoResolution);
String[] split = videoResolution.split("x");
if (split.length == 2) {
if (ak.m(split[0]) > 0.0d) {
this.aa = ak.m(split[0]);
}
if (ak.m(split[1]) > 0.0d) {
this.ab = ak.m(split[1]);
}
af.c(MBridgeBaseView.TAG, "MBridgeBaseView mVideoW:" + this.aa + " mVideoH:" + this.ab);
}
if (this.aa <= 0.0d) {
this.aa = 1280.0d;
}
if (this.ab <= 0.0d) {
this.ab = 720.0d;
}
}
this.mPlayerView.initBufferIngParam(this.S);
this.mPlayerView.initVFPData(this.Q, this.b.getVideoUrlEncode(), this.aU);
soundOperate(this.an, -1, null);
}
r = false;
}
@Override // com.mbridge.msdk.video.module.MBridgeBaseView
public void defaultShow() {
super.defaultShow();
this.ac = true;
showVideoLocation(0, 0, ak.f(this.a), ak.e(this.a), 0, 0, 0, 0, 0);
videoOperate(1);
if (this.R == 0) {
closeVideoOperate(-1, 2);
}
}
@Override // com.mbridge.msdk.video.signal.j
public void showVideoLocation(int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9) {
float f;
af.c(MBridgeBaseView.TAG, "showVideoLocation marginTop:" + i + " marginLeft:" + i2 + " width:" + i3 + " height:" + i4 + " radius:" + i5 + " borderTop:" + i6 + " borderLeft:" + i7 + " borderWidth:" + i8 + " borderHeight:" + i9);
if (this.e) {
this.u.setPadding(0, 0, 0, 0);
setVisibility(0);
if (this.u.getVisibility() != 0) {
this.u.setVisibility(0);
}
if (this.s.getVisibility() == 0) {
n();
}
int f2 = ak.f(this.a);
int e = ak.e(this.a);
if (i3 > 0 && i4 > 0 && f2 >= i3 && e >= i4 && !this.ac) {
n = i6;
o = i7;
p = i8 + 4;
q = i9 + 4;
float f3 = i3 / i4;
try {
f = (float) (this.aa / this.ab);
} catch (Throwable th) {
af.b(MBridgeBaseView.TAG, th.getMessage(), th);
f = 0.0f;
}
if (i5 > 0) {
m = i5;
if (i5 > 0) {
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setCornerRadius(ak.a(getContext(), i5));
gradientDrawable.setColor(-1);
gradientDrawable.setStroke(1, 0);
setBackground(gradientDrawable);
this.mPlayerView.setBackground(gradientDrawable);
setClipToOutline(true);
this.mPlayerView.setClipToOutline(true);
}
}
if (Math.abs(f3 - f) <= 0.1f || this.al == 1) {
k();
if (this.ak) {
setLayoutCenter(i3, i4);
if (r) {
this.notifyListener.a(114, "");
return;
} else {
this.notifyListener.a(116, "");
return;
}
}
setLayoutParam(i2, i, i3, i4);
return;
}
k();
videoOperate(1);
return;
}
k();
}
}
@Override // com.mbridge.msdk.video.signal.j
public void soundOperate(int i, int i2) {
soundOperate(i, i2, "2");
}
@Override // com.mbridge.msdk.video.signal.j
public void soundOperate(int i, int i2, String str) {
com.mbridge.msdk.video.module.a.a aVar;
SoundImageView soundImageView;
if (this.e) {
this.an = i;
if (i == 1) {
SoundImageView soundImageView2 = this.mSoundImageView;
if (soundImageView2 != null) {
soundImageView2.setSoundStatus(false);
}
this.mPlayerView.closeSound();
try {
MediaEvents mediaEvents = this.ap;
if (mediaEvents != null) {
mediaEvents.volumeChange(0.0f);
af.a("omsdk", "play video view: mute");
}
} catch (Exception e) {
af.a("OMSDK", e.getMessage());
}
} else if (i == 2) {
SoundImageView soundImageView3 = this.mSoundImageView;
if (soundImageView3 != null) {
soundImageView3.setSoundStatus(true);
}
this.mPlayerView.openSound();
try {
MediaEvents mediaEvents2 = this.ap;
if (mediaEvents2 != null) {
mediaEvents2.volumeChange(1.0f);
af.a("omsdk", "play video view: unmute");
}
} catch (Exception e2) {
af.a("OMSDK", e2.getMessage());
}
}
CampaignEx campaignEx = this.b;
if (campaignEx != null && campaignEx.isDynamicView()) {
SoundImageView soundImageView4 = this.mSoundImageView;
if (soundImageView4 != null) {
soundImageView4.setVisibility(0);
}
} else if (i2 == 1) {
SoundImageView soundImageView5 = this.mSoundImageView;
if (soundImageView5 != null) {
soundImageView5.setVisibility(8);
}
} else if (i2 == 2 && (soundImageView = this.mSoundImageView) != null) {
soundImageView.setVisibility(0);
}
}
if (str == null || !str.equals("2") || (aVar = this.notifyListener) == null) {
return;
}
aVar.a(7, Integer.valueOf(i));
}
@Override // com.mbridge.msdk.video.signal.j
public void videoOperate(int i) {
af.a(MBridgeBaseView.TAG, "VideoView videoOperate:" + i);
if (this.e) {
if (i == 1) {
if (getVisibility() == 0 && isfront()) {
af.a(MBridgeBaseView.TAG, "VideoView videoOperate:play");
RelativeLayout relativeLayout = this.aO;
if ((relativeLayout != null && relativeLayout.getVisibility() != 0) || this.O || com.mbridge.msdk.foundation.d.b.c) {
return;
}
if (!com.mbridge.msdk.e.b.a()) {
h();
return;
} else {
if (this.af || this.aL) {
return;
}
h();
return;
}
}
return;
}
if (i == 2) {
if (getVisibility() == 0 && isfront()) {
af.a(MBridgeBaseView.TAG, "VideoView videoOperate:pause");
g();
return;
}
return;
}
if (i == 3) {
if (this.ae) {
return;
}
this.mPlayerView.stop();
CampaignEx campaignEx = this.b;
if (campaignEx == null || campaignEx.getRewardTemplateMode() == null || this.b.getRewardTemplateMode().f() != 5002010) {
this.mPlayerView.release();
this.ae = true;
e eVar = new e();
eVar.a(IronSourceConstants.EVENTS_DURATION, Long.valueOf(System.currentTimeMillis() - aQ));
d.a().a("2000146", this.b, eVar);
return;
}
return;
}
if (i == 5) {
if (com.mbridge.msdk.e.b.a()) {
this.aL = true;
if (this.ae) {
return;
}
g();
return;
}
return;
}
if (i == 4) {
if (com.mbridge.msdk.e.b.a()) {
this.aL = false;
if (this.ae || isMiniCardShowing()) {
return;
}
h();
return;
}
return;
}
if (i != 6 || this.ae) {
return;
}
this.mPlayerView.release();
this.ae = true;
e eVar2 = new e();
eVar2.a(IronSourceConstants.EVENTS_DURATION, Long.valueOf(System.currentTimeMillis() - aQ));
d.a().a("2000146", this.b, eVar2);
}
}
@Override // com.mbridge.msdk.video.signal.j
public void closeVideoOperate(int i, int i2) {
if (i == 1) {
this.aB = true;
if (getVisibility() == 0) {
e();
}
try {
e eVar = new e();
eVar.a("type", 1);
d.a().a("2000152", eVar);
d.a().a("2000148", this.b, eVar);
} catch (Throwable th) {
if (MBridgeConstans.DEBUG) {
th.printStackTrace();
}
}
}
if (i2 == 1) {
gonePlayingCloseView();
} else if (i2 == 2) {
if (this.aA && getVisibility() == 0) {
return;
}
j();
}
}
@Override // com.mbridge.msdk.video.signal.j
public void progressBarOperate(int i) {
ProgressBar progressBar;
if (this.e) {
if (i == 1) {
ProgressBar progressBar2 = this.w;
if (progressBar2 != null) {
progressBar2.setVisibility(8);
return;
}
return;
}
if (i != 2 || (progressBar = this.w) == null) {
return;
}
progressBar.setVisibility(0);
}
}
@Override // com.mbridge.msdk.video.signal.j
public void progressOperate(int i, int i2) {
if (this.e) {
af.c(MBridgeBaseView.TAG, "progressOperate progress:" + i);
CampaignEx campaignEx = this.b;
int videoLength = campaignEx != null ? campaignEx.getVideoLength() : 0;
if (i > 0 && i <= videoLength && this.mPlayerView != null) {
af.c(MBridgeBaseView.TAG, "progressOperate progress:" + i);
this.mPlayerView.seekTo(i * 1000);
}
if (i2 == 1) {
this.s.setVisibility(8);
} else if (i2 == 2) {
this.s.setVisibility(0);
}
if (this.s.getVisibility() == 0) {
n();
}
}
}
@Override // com.mbridge.msdk.video.signal.j
public String getCurrentProgress() {
try {
int a2 = this.aU.a();
CampaignEx campaignEx = this.b;
int videoLength = campaignEx != null ? campaignEx.getVideoLength() : 0;
JSONObject jSONObject = new JSONObject();
jSONObject.put(NotificationCompat.CATEGORY_PROGRESS, a(a2, videoLength));
jSONObject.put("time", a2);
jSONObject.put(IronSourceConstants.EVENTS_DURATION, videoLength + "");
return jSONObject.toString();
} catch (Throwable th) {
af.b(MBridgeBaseView.TAG, th.getMessage(), th);
return JsonUtils.EMPTY_JSON;
}
}
@Override // com.mbridge.msdk.video.signal.j
public void setVisible(int i) {
setVisibility(i);
}
@Override // com.mbridge.msdk.video.signal.j
public void setCover(boolean z) {
if (this.e) {
this.mPlayerView.setIsCovered(z);
}
}
public void setShowingAlertViewCover(boolean z) {
MBAcquireRewardPopView mBAcquireRewardPopView;
if (z && (mBAcquireRewardPopView = this.aK) != null && this.P && this.O) {
mBAcquireRewardPopView.onPause();
}
this.mPlayerView.setIsCovered(z);
}
@Override // com.mbridge.msdk.video.signal.j
public boolean isH5Canvas() {
return getLayoutParams().height < ak.e(this.a.getApplicationContext());
}
@Override // com.mbridge.msdk.video.module.MBridgeBaseView, android.view.View
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
CampaignEx campaignEx = this.b;
if ((campaignEx == null || !campaignEx.isDynamicView()) && this.e && this.ac) {
k();
}
}
private String a(int i, int i2) {
if (i2 != 0) {
try {
return ak.a(Double.valueOf(i / i2)) + "";
} catch (Throwable th) {
th.printStackTrace();
}
}
return i2 + "";
}
private boolean f() {
try {
this.mPlayerView = (PlayerView) findViewById(filterFindViewId(this.aC, "mbridge_vfpv"));
this.mSoundImageView = (SoundImageView) findViewById(filterFindViewId(this.aC, "mbridge_sound_switch"));
this.s = (TextView) findViewById(filterFindViewId(this.aC, "mbridge_tv_count"));
View findViewById = findViewById(filterFindViewId(this.aC, "mbridge_rl_playing_close"));
this.t = findViewById;
if (findViewById != null) {
findViewById.setVisibility(4);
}
this.u = (RelativeLayout) findViewById(filterFindViewId(this.aC, "mbridge_top_control"));
this.v = (ImageView) findViewById(filterFindViewId(this.aC, "mbridge_videoview_bg"));
this.w = (ProgressBar) findViewById(filterFindViewId(this.aC, "mbridge_video_progress_bar"));
this.x = (FeedBackButton) findViewById(filterFindViewId(this.aC, "mbridge_native_endcard_feed_btn"));
this.y = (ImageView) findViewById(filterFindViewId(this.aC, "mbridge_iv_link"));
this.aM = (RelativeLayout) findViewById(filterFindViewId(this.aC, "mbridge_reward_scale_webview_layout"));
this.aO = (RelativeLayout) findViewById(filterFindViewId(this.aC, "mbridge_reward_header_layout"));
if (this.aM != null) {
CollapsibleWebView collapsibleWebView = new CollapsibleWebView(getContext());
this.aN = collapsibleWebView;
this.aM.addView(collapsibleWebView, new RelativeLayout.LayoutParams(-1, -1));
}
ak.a(1, this.y, this.b, this.a, false, new com.mbridge.msdk.foundation.d.a() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.20
@Override // com.mbridge.msdk.foundation.d.a
public final void showed() {
MBridgeVideoView.this.g();
}
@Override // com.mbridge.msdk.foundation.d.a
public final void close() {
MBridgeVideoView.this.h();
}
@Override // com.mbridge.msdk.foundation.d.a
public final void summit(String str) {
MBridgeVideoView.this.h();
}
});
this.z = (MBridgeSegmentsProgressBar) findViewById(filterFindViewId(this.aC, "mbridge_reward_segment_progressbar"));
this.H = (FrameLayout) findViewById(filterFindViewId(this.aC, "mbridge_reward_cta_layout"));
this.aE = (MBridgeBaitClickView) findViewById(filterFindViewId(this.aC, "mbridge_animation_click_view"));
this.M = (RelativeLayout) findViewById(filterFindViewId(this.aC, "mbridge_reward_moreoffer_layout"));
this.aK = (MBAcquireRewardPopView) findViewById(filterFindViewId(this.aC, "mbridge_reward_popview"));
this.tvFlag = (TextView) findViewById(filterFindViewId(this.aC, "mbridge_tv_flag"));
return isNotNULL(this.mPlayerView, this.mSoundImageView, this.s, this.t);
} catch (Throwable th) {
af.b(MBridgeBaseView.TAG, th.getMessage(), th);
return false;
}
}
public boolean isfront() {
ViewGroup viewGroup = (ViewGroup) getParent();
if (viewGroup == null) {
return false;
}
int indexOfChild = viewGroup.indexOfChild(this);
int childCount = viewGroup.getChildCount();
int i = indexOfChild + 1;
boolean z = false;
while (i <= childCount - 1) {
if (viewGroup.getChildAt(i).getVisibility() == 0 && this.af) {
return false;
}
i++;
z = true;
}
return z;
}
/* JADX INFO: Access modifiers changed from: private */
public void g() {
boolean z;
try {
PlayerView playerView = this.mPlayerView;
if (playerView != null) {
playerView.onPause();
CampaignEx campaignEx = this.b;
if (campaignEx != null && !campaignEx.isRewardPopViewShowed) {
removeCallbacks(this.aX);
}
if (com.mbridge.msdk.e.b.a()) {
PlayerView playerView2 = this.mPlayerView;
if (!this.aL && !this.O && !this.P) {
z = false;
playerView2.setIsCovered(z);
}
z = true;
playerView2.setIsCovered(z);
}
CampaignEx campaignEx2 = this.b;
if (campaignEx2 == null || campaignEx2.getNativeVideoTracking() == null || this.b.isHasReportAdTrackPause()) {
return;
}
this.b.setHasReportAdTrackPause(true);
Context c2 = com.mbridge.msdk.foundation.controller.c.m().c();
CampaignEx campaignEx3 = this.b;
com.mbridge.msdk.click.a.a(c2, campaignEx3, this.W, campaignEx3.getNativeVideoTracking().m(), false, false);
}
} catch (Throwable th) {
af.b(MBridgeBaseView.TAG, th.getMessage(), th);
}
}
/* JADX INFO: Access modifiers changed from: private */
public void h() {
c cVar;
RelativeLayout relativeLayout;
try {
CampaignEx campaignEx = this.b;
if (campaignEx == null || campaignEx.getRewardTemplateMode() == null || this.b.getRewardTemplateMode().f() != 5002010 || (relativeLayout = this.aO) == null || relativeLayout.getVisibility() == 0) {
if (!this.ad) {
boolean playVideo = this.mPlayerView.playVideo();
CampaignEx campaignEx2 = this.b;
if (campaignEx2 != null && campaignEx2.getPlayable_ads_without_video() != 2 && !playVideo && (cVar = this.aU) != null) {
cVar.onPlayError("play video failed");
}
this.ad = true;
return;
}
MBAcquireRewardPopView mBAcquireRewardPopView = this.aK;
if (mBAcquireRewardPopView != null && this.P) {
mBAcquireRewardPopView.onResume();
}
if (this.P) {
return;
}
if (!com.mbridge.msdk.e.b.a()) {
i();
} else {
if (this.aL || this.O) {
return;
}
this.mPlayerView.setIsCovered(false);
i();
}
}
} catch (Exception e) {
af.b(MBridgeBaseView.TAG, e.getMessage(), e);
}
}
private void i() {
if (this.ay) {
if (!this.az) {
this.mPlayerView.seekToEndFrame();
}
this.az = true;
} else {
this.mPlayerView.onResume();
}
CampaignEx campaignEx = this.b;
if (campaignEx == null || campaignEx.isRewardPopViewShowed) {
return;
}
post(this.aX);
}
/* JADX INFO: Access modifiers changed from: private */
public void j() {
if (!this.e || this.t.getVisibility() == 0) {
return;
}
if (!this.h || this.G) {
this.t.setVisibility(0);
}
this.ag = true;
}
public void gonePlayingCloseView() {
if (this.e && this.t.getVisibility() != 8) {
this.t.setVisibility(8);
this.ag = false;
}
if (this.aV || this.aj || this.ah) {
return;
}
this.aV = true;
int i = this.R;
if (i < 0) {
return;
}
if (i == 0) {
this.aj = true;
} else {
new Handler().postDelayed(new Runnable() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.2
@Override // java.lang.Runnable
public final void run() {
MBridgeVideoView.this.aj = true;
}
}, this.R * 1000);
}
}
private void k() {
CampaignEx campaignEx = this.b;
if (campaignEx == null || campaignEx.getAdSpaceT() == 2) {
return;
}
l();
}
private void l() {
int i;
int i2;
float f = ak.f(this.a);
float e = ak.e(this.a);
double d = this.aa;
if (d > 0.0d) {
double d2 = this.ab;
if (d2 > 0.0d && f > 0.0f && e > 0.0f) {
double d3 = d / d2;
double d4 = f / e;
af.c(MBridgeBaseView.TAG, "videoWHDivide:" + d3 + " screenWHDivide:" + d4);
double a2 = ak.a(Double.valueOf(d3));
double a3 = ak.a(Double.valueOf(d4));
af.c(MBridgeBaseView.TAG, "videoWHDivideFinal:" + a2 + " screenWHDivideFinal:" + a3);
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) this.mPlayerView.getLayoutParams();
if (a2 > a3) {
double d5 = (f * this.ab) / this.aa;
layoutParams.width = -1;
layoutParams.height = (int) d5;
layoutParams.gravity = 17;
} else if (a2 < a3) {
layoutParams.width = (int) (e * d3);
layoutParams.height = -1;
layoutParams.gravity = 17;
} else {
layoutParams.width = -1;
layoutParams.height = -1;
}
try {
CampaignEx campaignEx = this.b;
if (campaignEx != null && campaignEx.isDynamicView()) {
if (this.b.getRewardTemplateMode() != null) {
i2 = this.b.getRewardTemplateMode().f();
i = this.b.getRewardTemplateMode().b();
} else {
i = this.a.getResources().getConfiguration().orientation;
i2 = 904;
}
if (i2 == 102 || i2 == 202) {
if (i == 1) {
layoutParams.width = -1;
layoutParams.gravity = 17;
layoutParams.height = (int) (this.ab / (this.aa / f));
} else {
layoutParams.height = -1;
layoutParams.gravity = 17;
layoutParams.width = (int) (e * d3);
}
}
if (i2 == 202 && !TextUtils.isEmpty(this.b.getImageUrl())) {
a(this.b.getImageUrl());
}
if (i2 == 302 || i2 == 802 || i2 == 5002010) {
double d6 = this.aa;
double d7 = this.ab;
if (d6 / d7 > 1.0d) {
layoutParams.width = -1;
layoutParams.height = (int) ((d7 * f) / d6);
} else {
int a4 = ak.a(getContext(), 220.0f);
layoutParams.width = (int) ((this.aa * a4) / this.ab);
layoutParams.height = a4;
}
}
}
} catch (Throwable th) {
af.b(MBridgeBaseView.TAG, th.getMessage());
}
this.mPlayerView.setLayoutParams(layoutParams);
setMatchParent();
return;
}
}
m();
}
private void m() {
try {
setLayoutParam(0, 0, -1, -1);
if (isLandscape() || !this.e) {
return;
}
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) this.mPlayerView.getLayoutParams();
int f = ak.f(this.a);
layoutParams.width = -1;
layoutParams.height = (f * 9) / 16;
layoutParams.gravity = 17;
} catch (Throwable th) {
th.printStackTrace();
}
}
public void onBackPress() {
boolean z;
if (this.af || this.O || this.av) {
return;
}
CampaignEx campaignEx = this.b;
if (campaignEx != null && campaignEx.getRewardTemplateMode() != null && this.b.getRewardTemplateMode().f() == 5002010 && (z = this.ay)) {
com.mbridge.msdk.video.module.a.a aVar = this.notifyListener;
if (aVar != null) {
this.aS = true;
aVar.a(2, b(z));
return;
}
return;
}
if (this.ag) {
e();
return;
}
boolean z2 = this.ah;
if (z2 && this.ai) {
e();
} else {
if (z2 || !this.aj) {
return;
}
e();
}
}
@Override // com.mbridge.msdk.video.signal.j
public void showIVRewardAlertView(String str) {
this.notifyListener.a(8, "");
}
public void notifyVideoClose() {
this.aS = true;
this.notifyListener.a(2, "");
}
public void setVideoEvents(MediaEvents mediaEvents) {
this.ap = mediaEvents;
c cVar = this.aU;
if (cVar != null) {
cVar.f = mediaEvents;
}
PlayerView playerView = this.mPlayerView;
if (playerView != null) {
playerView.setVideoEvents(mediaEvents);
}
}
public void setDialogRole(int i) {
this.ax = i == 1;
af.b(MBridgeBaseView.TAG, i + " " + this.ax);
}
/* JADX INFO: Access modifiers changed from: private */
public String b(boolean z) {
if (!this.am) {
return "";
}
try {
JSONObject jSONObject = new JSONObject();
if (!this.au) {
jSONObject.put("Alert_window_status", com.mbridge.msdk.foundation.same.a.F);
}
if (this.aw) {
jSONObject.put("Alert_window_status", com.mbridge.msdk.foundation.same.a.D);
}
if (this.av) {
jSONObject.put("Alert_window_status", com.mbridge.msdk.foundation.same.a.E);
}
jSONObject.put("complete_info", z ? 1 : 2);
return jSONObject.toString();
} catch (Exception unused) {
af.b(MBridgeBaseView.TAG, "getIVRewardStatusString ERROR");
return "";
}
}
public void setNotchPadding(final int i, final int i2, final int i3, final int i4) {
RelativeLayout relativeLayout;
try {
af.b(MBridgeBaseView.TAG, "NOTCH VideoView " + String.format("%1s-%2s-%3s-%4s", Integer.valueOf(i), Integer.valueOf(i2), Integer.valueOf(i3), Integer.valueOf(i4)));
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) getLayoutParams();
int i5 = layoutParams.leftMargin;
int i6 = layoutParams.rightMargin;
int i7 = layoutParams.topMargin;
int i8 = layoutParams.bottomMargin;
this.aR = i3;
if (Math.max(Math.max(i5, i6), Math.max(i7, i8)) <= Math.max(Math.max(i, i2), Math.max(i3, i4)) && (relativeLayout = this.u) != null) {
relativeLayout.postDelayed(new Runnable() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.3
@Override // java.lang.Runnable
public final void run() {
if (MBridgeVideoView.this.u == null) {
return;
}
MBridgeVideoView.this.u.setVisibility(0);
CampaignEx campaignEx = MBridgeVideoView.this.b;
if (campaignEx == null || campaignEx.getAdSpaceT() == 2) {
return;
}
MBridgeVideoView.this.u.setPadding(i, i3, i2, i4);
MBridgeVideoView.this.u.startAnimation(MBridgeVideoView.this.aD);
}
}, 200L);
}
if (this.s.getVisibility() == 0) {
n();
}
} catch (Exception e) {
af.b(MBridgeBaseView.TAG, e.getMessage());
}
}
/* JADX INFO: Access modifiers changed from: private */
public void n() {
CampaignEx campaignEx = this.b;
if (campaignEx != null) {
campaignEx.setCampaignUnitId(this.W);
com.mbridge.msdk.foundation.d.b.a().a(this.W + "_1", this.b);
}
if (!com.mbridge.msdk.foundation.d.b.a().b()) {
FeedBackButton feedBackButton = this.x;
if (feedBackButton != null) {
feedBackButton.setVisibility(8);
return;
}
return;
}
if (this.x != null) {
com.mbridge.msdk.foundation.d.b.a().a(this.W + "_1", this.x);
}
}
/* renamed from: com.mbridge.msdk.video.module.MBridgeVideoView$4, reason: invalid class name */
public class AnonymousClass4 implements com.mbridge.msdk.foundation.same.c.c {
public AnonymousClass4() {
}
@Override // com.mbridge.msdk.foundation.same.c.c
public final void onSuccessLoad(final Bitmap bitmap, String str) {
if (bitmap != null) {
try {
if (bitmap.isRecycled() || MBridgeVideoView.this.v == null) {
return;
}
com.mbridge.msdk.foundation.same.f.a.a().execute(new Runnable() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.4.1
@Override // java.lang.Runnable
public final void run() {
try {
final Bitmap a = p.a(bitmap, 10);
MBridgeVideoView.this.v.post(new Runnable() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.4.1.1
@Override // java.lang.Runnable
public final void run() {
MBridgeVideoView.this.v.setVisibility(0);
MBridgeVideoView.this.v.setImageBitmap(a);
}
});
} catch (Exception e) {
af.b(MBridgeBaseView.TAG, e.getMessage());
}
}
});
} catch (Throwable th) {
af.b(MBridgeBaseView.TAG, th.getMessage());
}
}
}
@Override // com.mbridge.msdk.foundation.same.c.c
public final void onFailedLoad(String str, String str2) {
af.b(MBridgeBaseView.TAG, str);
}
}
private void a(String str) {
com.mbridge.msdk.foundation.same.c.b.a(com.mbridge.msdk.foundation.controller.c.m().c()).a(str, new AnonymousClass4());
}
public void addCTAView() {
if (this.H == null) {
return;
}
if (this.I == null) {
MBridgeClickCTAView mBridgeClickCTAView = new MBridgeClickCTAView(getContext());
this.I = mBridgeClickCTAView;
mBridgeClickCTAView.setCampaign(this.b);
this.I.setUnitId(this.W);
com.mbridge.msdk.video.module.a.a aVar = this.A;
if (aVar != null) {
this.I.setNotifyListener(new com.mbridge.msdk.video.module.a.a.i(aVar));
}
this.I.preLoadData(this.J);
}
this.H.addView(this.I);
}
public void setCTALayoutVisibleOrGone() {
CampaignEx campaignEx = this.b;
if (campaignEx == null || this.H == null) {
return;
}
if (campaignEx.getRewardTemplateMode() == null || this.b.getRewardTemplateMode().f() != 902) {
int i = this.L;
if (i != -5) {
if (i == -3) {
return;
}
if (this.I == null) {
addCTAView();
}
if (this.L == -1) {
if (this.H.getVisibility() != 0) {
this.H.setVisibility(0);
postDelayed(this.aW, 3000L);
} else {
this.H.setVisibility(8);
getHandler().removeCallbacks(this.aW);
}
}
if (this.L >= 0) {
this.H.setVisibility(0);
return;
}
return;
}
if (this.K < -1) {
return;
}
if (this.I == null) {
addCTAView();
}
int i2 = this.K;
if (i2 >= 0) {
this.H.setVisibility(0);
return;
}
if (i2 == -1) {
if (this.H.getVisibility() != 0) {
this.H.setVisibility(0);
postDelayed(this.aW, 3000L);
} else {
this.H.setVisibility(8);
getHandler().removeCallbacks(this.aW);
}
}
}
}
public void showMoreOfferInPlayTemplate() {
CampaignEx campaignEx = this.b;
if (campaignEx == null || this.M == null || !campaignEx.isDynamicView() || this.b.getRewardTemplateMode() == null) {
return;
}
String e = this.b.getRewardTemplateMode().e();
if (TextUtils.isEmpty(e)) {
return;
}
try {
String a2 = aq.a(e, "mof");
if (TextUtils.isEmpty(a2) || Integer.parseInt(a2) != 1) {
return;
}
com.mbridge.msdk.video.dynview.moffer.a.a().a(this.b, this, new com.mbridge.msdk.video.module.a.a.i(this.A), 1);
} catch (Exception e2) {
af.b(MBridgeBaseView.TAG, e2.getMessage());
}
}
public void showBaitClickView() {
int parseInt;
MBridgeBaitClickView mBridgeBaitClickView;
CampaignEx campaignEx = this.b;
if (campaignEx == null || !campaignEx.isDynamicView() || this.b.getRewardTemplateMode() == null) {
return;
}
String e = this.b.getRewardTemplateMode().e();
if (TextUtils.isEmpty(e)) {
return;
}
try {
String a2 = aq.a(e, "bait_click");
if (TextUtils.isEmpty(a2) || (parseInt = Integer.parseInt(a2)) == 0 || (mBridgeBaitClickView = this.aE) == null) {
return;
}
mBridgeBaitClickView.setVisibility(0);
this.aE.init(parseInt);
this.aE.startAnimation();
this.aE.setOnClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.10
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
MBridgeVideoView mBridgeVideoView = MBridgeVideoView.this;
if (mBridgeVideoView.notifyListener != null) {
mBridgeVideoView.b.setTriggerClickSource(2);
MBridgeVideoView.a(MBridgeVideoView.this, "bait_click_clicked");
}
}
});
} catch (Exception e2) {
af.b(MBridgeBaseView.TAG, e2.getMessage());
}
}
public void showRewardPopView() {
AcquireRewardPopViewParameters acquireRewardPopViewParameters;
MBAcquireRewardPopView mBAcquireRewardPopView = this.aK;
if (mBAcquireRewardPopView == null || (acquireRewardPopViewParameters = this.aJ) == null) {
return;
}
try {
mBAcquireRewardPopView.init(acquireRewardPopViewParameters);
this.aK.setVisibility(0);
setCover(true);
g();
this.P = true;
CampaignEx campaignEx = this.b;
if (campaignEx != null) {
campaignEx.isRewardPopViewShowed = true;
}
} catch (Exception e) {
af.b(MBridgeBaseView.TAG, e.getMessage());
}
}
public void onActivityResume() {
try {
MBAcquireRewardPopView mBAcquireRewardPopView = this.aK;
if (mBAcquireRewardPopView != null) {
mBAcquireRewardPopView.onResume();
}
} catch (Throwable th) {
af.b(MBridgeBaseView.TAG, th.getMessage());
}
}
public void onActivityPause() {
try {
MBAcquireRewardPopView mBAcquireRewardPopView = this.aK;
if (mBAcquireRewardPopView != null) {
mBAcquireRewardPopView.onPause();
}
} catch (Throwable th) {
af.b(MBridgeBaseView.TAG, th.getMessage());
}
}
public void onActivityStop() {
try {
MBAcquireRewardPopView mBAcquireRewardPopView = this.aK;
if (mBAcquireRewardPopView != null) {
mBAcquireRewardPopView.onStop();
}
} catch (Throwable th) {
af.b(MBridgeBaseView.TAG, th.getMessage());
}
}
/* JADX INFO: Access modifiers changed from: private */
public int o() {
int p2;
CampaignEx campaignEx;
int i = 0;
try {
p2 = p();
campaignEx = this.b;
} catch (Throwable th) {
af.b(MBridgeBaseView.TAG, th.getMessage());
}
if (campaignEx == null) {
return p2;
}
i = campaignEx.getVideoCompleteTime();
if (this.b.getDynamicTempCode() != 5 && i > p2) {
i = p2;
}
if (i <= 0) {
return p2;
}
return i;
}
private int p() {
try {
c cVar = this.aU;
int b2 = cVar != null ? cVar.b() : 0;
return b2 == 0 ? this.b.getVideoLength() : b2;
} catch (Throwable th) {
af.b(MBridgeBaseView.TAG, th.getMessage());
return 0;
}
}
@Override // android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
try {
if (this.aW != null) {
getHandler().removeCallbacks(this.aW);
}
if (this.aF != 0) {
removeCallbacks(this.aX);
}
} catch (Throwable th) {
af.b(MBridgeBaseView.TAG, th.getMessage());
}
}
public void releasePlayer() {
try {
PlayerView playerView = this.mPlayerView;
if (playerView != null && !this.ae) {
playerView.release();
e eVar = new e();
eVar.a(IronSourceConstants.EVENTS_DURATION, Long.valueOf(System.currentTimeMillis() - aQ));
d.a().a("2000146", this.b, eVar);
}
c cVar = this.aU;
if (cVar != null) {
cVar.c();
}
if (this.A != null) {
this.A = null;
}
} catch (Exception e) {
af.b(MBridgeBaseView.TAG, e.getMessage());
}
}
public static final class c extends DefaultVideoPlayerStatusListener {
private MBridgeVideoView a;
private int b;
private int c;
private int d;
private boolean e;
private MediaEvents f;
private boolean k;
private String l;
private CampaignEx m;
private int n;
private int o;
private b g = new b();
private boolean h = false;
private boolean i = false;
private boolean j = false;
private boolean p = false;
public final int a() {
return this.b;
}
public final void a(CampaignEx campaignEx) {
this.m = campaignEx;
}
public final void a(String str) {
this.l = str;
}
public final void a(boolean z) {
this.k = z;
}
public final int b() {
return this.d;
}
public c(MBridgeVideoView mBridgeVideoView) {
this.a = mBridgeVideoView;
if (mBridgeVideoView != null) {
this.l = mBridgeVideoView.getUnitId();
this.m = mBridgeVideoView.getCampaign();
}
}
@Override // com.mbridge.msdk.playercommon.DefaultVideoPlayerStatusListener, com.mbridge.msdk.playercommon.VideoPlayerStatusListener
public final void onPlayStarted(int i) {
PlayerView playerView;
CampaignEx campaignEx;
super.onPlayStarted(i);
MBridgeVideoView mBridgeVideoView = this.a;
if (mBridgeVideoView != null) {
MBridgeVideoView.C(mBridgeVideoView);
}
if (!this.e) {
MBridgeVideoView mBridgeVideoView2 = this.a;
if (mBridgeVideoView2 != null) {
mBridgeVideoView2.G = true;
this.a.notifyListener.a(10, this.g);
}
this.e = true;
}
this.d = i;
CampaignEx campaignEx2 = this.m;
if (campaignEx2 != null) {
int videoCompleteTime = campaignEx2.getVideoCompleteTime();
if (videoCompleteTime <= 0) {
videoCompleteTime = i;
}
String str = "mbridge_reward_shape_progress";
if (this.m.isDynamicView()) {
MBridgeVideoView mBridgeVideoView3 = this.a;
if (mBridgeVideoView3 != null && mBridgeVideoView3.s != null) {
if (this.m.getDynamicTempCode() == 5) {
MBridgeVideoView mBridgeVideoView4 = this.a;
if (mBridgeVideoView4.mCurrPlayNum > 1 && videoCompleteTime <= 0) {
mBridgeVideoView4.s.setBackgroundResource(x.a(com.mbridge.msdk.foundation.controller.c.m().c(), "mbridge_reward_video_time_count_num_bg", "drawable"));
d();
}
}
if (videoCompleteTime > 0) {
if (!this.k || this.m.getDynamicTempCode() == 5) {
d();
}
str = "mbridge_reward_video_time_count_num_bg";
}
CampaignEx campaignEx3 = this.m;
if (campaignEx3 != null && campaignEx3.getUseSkipTime() == 1 && this.k) {
d();
}
this.a.s.setBackgroundResource(x.a(com.mbridge.msdk.foundation.controller.c.m().c(), str, "drawable"));
}
} else if (videoCompleteTime > 0) {
this.a.s.setBackgroundResource(x.a(com.mbridge.msdk.foundation.controller.c.m().c(), "mbridge_reward_video_time_count_num_bg", "drawable"));
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-2, ak.a(com.mbridge.msdk.foundation.controller.c.m().c(), 30.0f));
int a = ak.a(com.mbridge.msdk.foundation.controller.c.m().c(), 5.0f);
layoutParams.addRule(1, x.a(com.mbridge.msdk.foundation.controller.c.m().c(), "mbridge_native_endcard_feed_btn", "id"));
layoutParams.setMargins(a, 0, 0, 0);
this.a.s.setPadding(a, 0, a, 0);
this.a.s.setLayoutParams(layoutParams);
} else {
this.a.s.setBackgroundResource(x.a(com.mbridge.msdk.foundation.controller.c.m().c(), "mbridge_reward_shape_progress", "drawable"));
}
}
MBridgeVideoView mBridgeVideoView5 = this.a;
if (mBridgeVideoView5 != null && mBridgeVideoView5.w != null) {
this.a.w.setMax(i);
}
MBridgeVideoView mBridgeVideoView6 = this.a;
if (mBridgeVideoView6 != null && mBridgeVideoView6.u != null && (campaignEx = this.m) != null && campaignEx.getAdSpaceT() == 2) {
this.a.u.setVisibility(0);
}
MBridgeVideoView mBridgeVideoView7 = this.a;
if (mBridgeVideoView7 != null && mBridgeVideoView7.s != null && this.a.s.getVisibility() == 0) {
this.a.n();
}
boolean unused = MBridgeVideoView.r = false;
if (this.a != null && this.m.isDynamicView()) {
if (this.a.L != -5) {
if (this.a.L == 0) {
this.a.setCTALayoutVisibleOrGone();
}
} else if (this.a.K == 0) {
this.a.setCTALayoutVisibleOrGone();
}
}
MBridgeVideoView mBridgeVideoView8 = this.a;
if (mBridgeVideoView8 != null) {
mBridgeVideoView8.showMoreOfferInPlayTemplate();
this.a.showBaitClickView();
MBridgeVideoView.I(this.a);
}
if (this.f != null) {
try {
MBridgeVideoView mBridgeVideoView9 = this.a;
this.f.start(i, (mBridgeVideoView9 == null || (playerView = mBridgeVideoView9.mPlayerView) == null) ? 0.0f : playerView.getVolume());
af.a("omsdk", "play video view: videoEvents.start");
} catch (Exception e) {
af.b("omsdk", e.getMessage());
}
}
}
private void d() {
MBridgeVideoView mBridgeVideoView = this.a;
if (mBridgeVideoView == null) {
return;
}
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) mBridgeVideoView.s.getLayoutParams();
if (layoutParams != null) {
layoutParams.width = -2;
layoutParams.height = ak.a(com.mbridge.msdk.foundation.controller.c.m().c(), 25.0f);
this.a.s.setLayoutParams(layoutParams);
}
int a = ak.a(com.mbridge.msdk.foundation.controller.c.m().c(), 5.0f);
this.a.s.setPadding(a, 0, a, 0);
}
@Override // com.mbridge.msdk.playercommon.DefaultVideoPlayerStatusListener, com.mbridge.msdk.playercommon.VideoPlayerStatusListener
public final void onPlayCompleted() {
MBridgeVideoView mBridgeVideoView;
super.onPlayCompleted();
this.a.ay = true;
CampaignEx campaignEx = this.m;
if (campaignEx == null) {
this.a.s.setText("0");
} else {
if (!this.k || campaignEx.getRewardTemplateMode() == null || this.m.getRewardTemplateMode().f() != 5002010) {
this.a.s.setText(x.a(com.mbridge.msdk.foundation.controller.c.m().c(), "mbridge_reward_video_view_reward_time_complete", "string"));
} else {
this.a.s.setText("0");
}
this.m.setVideoPlayProgress(100);
if (this.m.getAdSpaceT() == 2) {
this.a.t.setVisibility(4);
if (this.a.x != null) {
this.a.x.setClickable(false);
}
SoundImageView soundImageView = this.a.mSoundImageView;
if (soundImageView != null) {
soundImageView.setClickable(false);
}
}
}
MediaEvents mediaEvents = this.f;
if (mediaEvents != null) {
mediaEvents.complete();
af.a("omsdk", "play: videoEvents.complete()");
}
this.a.mPlayerView.setClickable(false);
String b = this.a.b(true);
CampaignEx campaignEx2 = this.m;
if (campaignEx2 != null && campaignEx2.getRewardTemplateMode() != null && this.m.getRewardTemplateMode().f() == 5002010) {
this.a.j();
}
CampaignEx campaignEx3 = this.m;
if (campaignEx3 != null && campaignEx3.getDynamicTempCode() == 5 && (mBridgeVideoView = this.a) != null && mBridgeVideoView.D != null) {
MBridgeVideoView mBridgeVideoView2 = this.a;
if (mBridgeVideoView2.mCampaignSize > mBridgeVideoView2.mCurrPlayNum) {
HashMap hashMap = new HashMap();
hashMap.put(v8.h.L, Integer.valueOf(this.a.mCurrPlayNum));
int i = this.a.mMuteSwitch;
if (i != 0) {
hashMap.put(CampaignEx.JSON_NATIVE_VIDEO_MUTE, Integer.valueOf(i));
}
this.a.D.a(hashMap);
return;
}
}
MBridgeVideoView mBridgeVideoView3 = this.a;
if (mBridgeVideoView3 != null) {
mBridgeVideoView3.notifyListener.a(121, "");
this.a.notifyListener.a(11, b);
}
int i2 = this.c;
this.b = i2;
this.a.mCurrentPlayProgressTime = i2;
boolean unused = MBridgeVideoView.r = true;
}
@Override // com.mbridge.msdk.playercommon.DefaultVideoPlayerStatusListener, com.mbridge.msdk.playercommon.VideoPlayerStatusListener
public final void onPlayError(String str) {
af.b("DefaultVideoPlayerStatusListener", "errorStr" + str);
super.onPlayError(str);
MBridgeVideoView mBridgeVideoView = this.a;
if (mBridgeVideoView != null) {
mBridgeVideoView.notifyListener.a(12, str);
}
}
@Override // com.mbridge.msdk.playercommon.DefaultVideoPlayerStatusListener, com.mbridge.msdk.playercommon.VideoPlayerStatusListener
public final void onPlayProgress(int i, int i2) {
int i3;
String str;
CampaignEx campaignEx;
int i4;
StringBuilder sb;
String str2;
int i5;
StringBuilder sb2;
super.onPlayProgress(i, i2);
if (MBridgeVideoView.aQ == 0) {
long unused = MBridgeVideoView.aQ = System.currentTimeMillis();
}
if (!this.a.aT && this.a.E != null) {
this.a.aT = true;
this.a.E.a();
}
if (this.a.e) {
CampaignEx campaignEx2 = this.m;
int i6 = 0;
if (campaignEx2 != null) {
i4 = campaignEx2.getVideoCompleteTime();
if (i4 <= 0) {
i4 = i2;
}
com.mbridge.msdk.foundation.d.b.a().b(this.m.getCampaignUnitId() + "_1", i);
} else {
i4 = 0;
}
CampaignEx campaignEx3 = this.m;
String str3 = "0";
if (campaignEx3 != null && campaignEx3.isDynamicView() && this.m.getDynamicTempCode() == 5) {
try {
int i7 = this.a.F;
MBridgeVideoView mBridgeVideoView = this.a;
if (mBridgeVideoView != null) {
String str4 = (String) mBridgeVideoView.getContext().getResources().getText(x.a(com.mbridge.msdk.foundation.controller.c.m().c(), "mbridge_reward_video_view_reward_time_complete", "string"));
String str5 = (String) this.a.getContext().getResources().getText(x.a(com.mbridge.msdk.foundation.controller.c.m().c(), "mbridge_reward_video_view_reward_time_left", "string"));
if (i4 >= 0) {
if (this.m.getUseSkipTime() == 1) {
int min = Math.min(this.a.R, i4);
if (min >= i4 || min <= 0) {
i5 = i4 - i;
if (this.k) {
if (i5 <= 0) {
this.a.s.setVisibility(4);
} else {
str5 = (String) this.a.getContext().getResources().getText(x.a(com.mbridge.msdk.foundation.controller.c.m().c(), "mbridge_reward_video_view_reward_time_left_skip_time", "string"));
}
}
} else {
i5 = min - i;
if (i5 <= 0) {
i5 = i4 - i;
if (this.k) {
this.a.s.setVisibility(4);
}
} else {
str5 = (String) this.a.getContext().getResources().getText(x.a(com.mbridge.msdk.foundation.controller.c.m().c(), "mbridge_reward_video_view_reward_time_left_skip_time", "string"));
}
}
} else {
i5 = i4 - i;
}
if (i5 > 0) {
str4 = i5 + str5;
}
} else {
i5 = i7 - i;
if (i5 > 0) {
if (i4 <= 0) {
sb2 = new StringBuilder();
sb2.append(i5);
sb2.append("");
} else {
sb2 = new StringBuilder();
sb2.append(i5);
sb2.append(str5);
}
str4 = sb2.toString();
} else if (i4 <= 0) {
this.g.a = i;
this.a.s.setText(str3);
if (this.a.w != null && this.a.w.getVisibility() == 0) {
this.a.w.setProgress(i);
}
if (i5 < this.a.aI && this.a.aK != null && this.a.P) {
this.a.aK.onTimeLessThanReduce(i5);
}
}
}
str3 = str4;
this.g.a = i;
this.a.s.setText(str3);
if (this.a.w != null) {
this.a.w.setProgress(i);
}
if (i5 < this.a.aI) {
this.a.aK.onTimeLessThanReduce(i5);
}
}
} catch (Exception e) {
af.b("DefaultVideoPlayerStatusListener", e.getMessage());
}
} else {
MBridgeVideoView mBridgeVideoView2 = this.a;
if (mBridgeVideoView2 != null) {
if (!this.k) {
if (i4 > i2) {
i4 = i2;
}
int i8 = i4 <= 0 ? i2 - i : i4 - i;
if (i8 > 0) {
if (i4 <= 0) {
sb = new StringBuilder();
sb.append(i8);
sb.append("");
} else {
sb = new StringBuilder();
sb.append(i8);
sb.append((String) this.a.getContext().getResources().getText(x.a(com.mbridge.msdk.foundation.controller.c.m().c(), "mbridge_reward_video_view_reward_time_left", "string")));
}
str3 = sb.toString();
i6 = i8;
} else if (i4 > 0) {
str3 = (String) mBridgeVideoView2.getContext().getResources().getText(x.a(com.mbridge.msdk.foundation.controller.c.m().c(), "mbridge_reward_video_view_reward_time_complete", "string"));
}
if (i6 < this.a.aI && this.a.aK != null && this.a.P) {
this.a.aK.onTimeLessThanReduce(i6);
}
str2 = str3;
} else {
str2 = String.format("%s", Integer.valueOf(i2 - i));
}
CampaignEx campaignEx4 = this.m;
if (campaignEx4 != null && campaignEx4.getUseSkipTime() == 1) {
int min2 = Math.min(this.a.R, i2);
if (min2 >= i4 || min2 < 0) {
int i9 = i4 - i;
if (this.k) {
if (i9 > 0) {
str2 = i9 + ((String) this.a.getContext().getResources().getText(x.a(com.mbridge.msdk.foundation.controller.c.m().c(), "mbridge_reward_video_view_reward_time_left_skip_time", "string")));
} else if (i9 == 0) {
this.a.s.setVisibility(4);
}
}
} else {
int i10 = min2 - i;
if (i10 > 0) {
str2 = i10 + ((String) this.a.getContext().getResources().getText(x.a(com.mbridge.msdk.foundation.controller.c.m().c(), "mbridge_reward_video_view_reward_time_left_skip_time", "string")));
} else if (this.k && i10 == 0) {
this.a.s.setVisibility(4);
}
}
}
this.a.s.setText(str2);
if (this.a.w != null && this.a.w.getVisibility() == 0) {
this.a.w.setProgress(i);
}
}
this.g.a = i;
}
}
this.c = i2;
b bVar = this.g;
bVar.b = i2;
bVar.c = this.a.aA;
this.b = i;
if (this.a.y != null) {
this.a.y.setTag("" + this.b);
}
MBridgeVideoView mBridgeVideoView3 = this.a;
mBridgeVideoView3.mCurrentPlayProgressTime = i;
mBridgeVideoView3.notifyListener.a(15, this.g);
MediaEvents mediaEvents = this.f;
if (mediaEvents != null) {
int i11 = (i * 100) / i2;
int i12 = ((i + 1) * 100) / i2;
if (i11 <= 25 && 25 < i12 && !this.h) {
this.h = true;
mediaEvents.firstQuartile();
af.a("omsdk", "play: videoEvents.firstQuartile()");
} else if (i11 <= 50 && 50 < i12 && !this.i) {
this.i = true;
mediaEvents.midpoint();
af.a("omsdk", "play: videoEvents.midpoint()");
} else if (i11 <= 75 && 75 < i12 && !this.j) {
this.j = true;
mediaEvents.thirdQuartile();
af.a("omsdk", "play: videoEvents.thirdQuartile()");
}
}
if (this.a.am && !this.a.au && this.a.ar == com.mbridge.msdk.foundation.same.a.I) {
this.a.e();
}
try {
MBridgeVideoView mBridgeVideoView4 = this.a;
if (mBridgeVideoView4 != null && mBridgeVideoView4.z != null) {
int i13 = (i * 100) / i2;
this.a.z.setProgress(i13, this.a.mCurrPlayNum - 1);
this.m.setVideoPlayProgress(i13);
}
MBridgeVideoView mBridgeVideoView5 = this.a;
if (mBridgeVideoView5 != null) {
int i14 = mBridgeVideoView5.L != -5 ? this.a.L : this.a.K;
if (i14 != -1 && i == i14 && (campaignEx = this.a.b) != null && campaignEx.isDynamicView()) {
this.a.setCTALayoutVisibleOrGone();
}
}
} catch (Throwable th) {
af.b("DefaultVideoPlayerStatusListener", th.getMessage());
}
int i15 = this.n;
if (i15 == 100 || this.p || i15 == 0) {
return;
}
if (this.o > i15) {
this.o = i15 / 2;
}
int i16 = this.o;
if (i16 < 0 || i < (i3 = (i2 * i16) / 100)) {
return;
}
if (this.m.getAdType() == 94 || this.m.getAdType() == 287) {
str = this.m.getRequestId() + this.m.getId() + this.m.getVideoUrlEncode();
} else {
str = this.m.getId() + this.m.getVideoUrlEncode() + this.m.getBidToken();
}
com.mbridge.msdk.videocommon.download.a a = com.mbridge.msdk.videocommon.download.b.getInstance().a(this.l, str);
if (a != null) {
a.p();
this.p = true;
af.b("DefaultVideoPlayerStatusListener", "CDRate is : " + i3 + " and start download !");
}
}
@Override // com.mbridge.msdk.playercommon.DefaultVideoPlayerStatusListener, com.mbridge.msdk.playercommon.VideoPlayerStatusListener
public final void onBufferingStart(String str) {
try {
super.onBufferingStart(str);
if (this.f != null) {
af.a("omsdk", "play: videoEvents.bufferStart()");
this.f.bufferStart();
}
this.a.notifyListener.a(13, "");
} catch (Exception e) {
e.printStackTrace();
}
}
@Override // com.mbridge.msdk.playercommon.DefaultVideoPlayerStatusListener, com.mbridge.msdk.playercommon.VideoPlayerStatusListener
public final void onBufferingEnd() {
try {
super.onBufferingEnd();
MediaEvents mediaEvents = this.f;
if (mediaEvents != null) {
mediaEvents.bufferFinish();
af.a("omsdk", "play: videoEvents.bufferFinish()");
}
this.a.notifyListener.a(14, "");
} catch (Exception e) {
e.printStackTrace();
}
}
@Override // com.mbridge.msdk.playercommon.DefaultVideoPlayerStatusListener, com.mbridge.msdk.playercommon.VideoPlayerStatusListener
public final void onPlaySetDataSourceError(String str) {
super.onPlaySetDataSourceError(str);
}
public final void c() {
this.a = null;
boolean unused = MBridgeVideoView.r = false;
}
/* JADX WARN: Removed duplicated region for block: B:21:0x0095 A[Catch: Exception -> 0x0063, TryCatch #0 {Exception -> 0x0063, blocks: (B:13:0x002b, B:15:0x0033, B:18:0x003e, B:19:0x0089, B:21:0x0095, B:23:0x009f, B:29:0x0065), top: B:12:0x002b }] */
/* JADX WARN: Removed duplicated region for block: B:28:? A[RETURN, SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void a(int r3, int r4) {
/*
r2 = this;
java.lang.String r0 = "DefaultVideoPlayerStatusListener"
r2.n = r3
r2.o = r4
com.mbridge.msdk.foundation.tools.ah r3 = com.mbridge.msdk.foundation.tools.ah.a()
java.lang.String r4 = "h_c_r_w_p_c"
r1 = 0
boolean r3 = r3.a(r4, r1)
if (r3 != 0) goto L15
goto Lb0
L15:
int r3 = r2.n
r4 = 100
if (r3 == r4) goto Lb0
int r4 = r2.o
if (r4 != 0) goto Lb0
boolean r4 = r2.p
if (r4 != 0) goto Lb0
if (r3 == 0) goto Lb0
com.mbridge.msdk.foundation.entity.CampaignEx r3 = r2.m
if (r3 != 0) goto L2b
goto Lb0
L2b:
int r3 = r3.getAdType() // Catch: java.lang.Exception -> L63
r4 = 94
if (r3 == r4) goto L65
com.mbridge.msdk.foundation.entity.CampaignEx r3 = r2.m // Catch: java.lang.Exception -> L63
int r3 = r3.getAdType() // Catch: java.lang.Exception -> L63
r4 = 287(0x11f, float:4.02E-43)
if (r3 != r4) goto L3e
goto L65
L3e:
java.lang.StringBuilder r3 = new java.lang.StringBuilder // Catch: java.lang.Exception -> L63
r3.<init>() // Catch: java.lang.Exception -> L63
com.mbridge.msdk.foundation.entity.CampaignEx r4 = r2.m // Catch: java.lang.Exception -> L63
java.lang.String r4 = r4.getId() // Catch: java.lang.Exception -> L63
r3.append(r4) // Catch: java.lang.Exception -> L63
com.mbridge.msdk.foundation.entity.CampaignEx r4 = r2.m // Catch: java.lang.Exception -> L63
java.lang.String r4 = r4.getVideoUrlEncode() // Catch: java.lang.Exception -> L63
r3.append(r4) // Catch: java.lang.Exception -> L63
com.mbridge.msdk.foundation.entity.CampaignEx r4 = r2.m // Catch: java.lang.Exception -> L63
java.lang.String r4 = r4.getBidToken() // Catch: java.lang.Exception -> L63
r3.append(r4) // Catch: java.lang.Exception -> L63
java.lang.String r3 = r3.toString() // Catch: java.lang.Exception -> L63
goto L89
L63:
r3 = move-exception
goto La5
L65:
java.lang.StringBuilder r3 = new java.lang.StringBuilder // Catch: java.lang.Exception -> L63
r3.<init>() // Catch: java.lang.Exception -> L63
com.mbridge.msdk.foundation.entity.CampaignEx r4 = r2.m // Catch: java.lang.Exception -> L63
java.lang.String r4 = r4.getRequestId() // Catch: java.lang.Exception -> L63
r3.append(r4) // Catch: java.lang.Exception -> L63
com.mbridge.msdk.foundation.entity.CampaignEx r4 = r2.m // Catch: java.lang.Exception -> L63
java.lang.String r4 = r4.getId() // Catch: java.lang.Exception -> L63
r3.append(r4) // Catch: java.lang.Exception -> L63
com.mbridge.msdk.foundation.entity.CampaignEx r4 = r2.m // Catch: java.lang.Exception -> L63
java.lang.String r4 = r4.getVideoUrlEncode() // Catch: java.lang.Exception -> L63
r3.append(r4) // Catch: java.lang.Exception -> L63
java.lang.String r3 = r3.toString() // Catch: java.lang.Exception -> L63
L89:
com.mbridge.msdk.videocommon.download.b r4 = com.mbridge.msdk.videocommon.download.b.getInstance() // Catch: java.lang.Exception -> L63
java.lang.String r1 = r2.l // Catch: java.lang.Exception -> L63
com.mbridge.msdk.videocommon.download.a r3 = r4.a(r1, r3) // Catch: java.lang.Exception -> L63
if (r3 == 0) goto Lb0
r3.p() // Catch: java.lang.Exception -> L63
r3 = 1
r2.p = r3 // Catch: java.lang.Exception -> L63
boolean r3 = com.mbridge.msdk.MBridgeConstans.DEBUG // Catch: java.lang.Exception -> L63
if (r3 == 0) goto Lb0
java.lang.String r3 = "CDRate is : 0 and start download when player create!"
com.mbridge.msdk.foundation.tools.af.b(r0, r3) // Catch: java.lang.Exception -> L63
goto Lb0
La5:
boolean r4 = com.mbridge.msdk.MBridgeConstans.DEBUG
if (r4 == 0) goto Lb0
java.lang.String r3 = r3.getMessage()
com.mbridge.msdk.foundation.tools.af.b(r0, r3)
Lb0:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.video.module.MBridgeVideoView.c.a(int, int):void");
}
}
public static class b {
public int a;
public int b;
public boolean c;
public final String toString() {
return "ProgressData{curPlayPosition=" + this.a + ", allDuration=" + this.b + '}';
}
}
public static /* synthetic */ void b(MBridgeVideoView mBridgeVideoView) {
CampaignEx campaignEx = mBridgeVideoView.b;
if (campaignEx == null || !campaignEx.isDynamicView() || mBridgeVideoView.H == null) {
return;
}
if (mBridgeVideoView.I == null) {
mBridgeVideoView.addCTAView();
}
if (mBridgeVideoView.H.getVisibility() != 0) {
mBridgeVideoView.H.setVisibility(0);
mBridgeVideoView.postDelayed(mBridgeVideoView.aW, 3000L);
} else {
mBridgeVideoView.H.setVisibility(8);
mBridgeVideoView.getHandler().removeCallbacks(mBridgeVideoView.aW);
}
}
/* JADX WARN: Removed duplicated region for block: B:24:0x0080 A[EXC_TOP_SPLITTER, SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:32:? A[RETURN, SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static /* synthetic */ void a(com.mbridge.msdk.video.module.MBridgeVideoView r9, java.lang.String r10) {
/*
com.mbridge.msdk.video.module.a.a r0 = r9.A
if (r0 == 0) goto L9c
com.mbridge.msdk.foundation.entity.CampaignEx r0 = r9.b
if (r0 == 0) goto L55
r1 = 1
r0.setClickTempSource(r1)
com.mbridge.msdk.foundation.entity.CampaignEx r0 = r9.b // Catch: java.lang.Exception -> L2b
com.mbridge.msdk.foundation.entity.CampaignEx$c r0 = r0.getRewardTemplateMode() // Catch: java.lang.Exception -> L2b
java.lang.String r1 = ""
if (r0 == 0) goto L29
java.lang.StringBuilder r2 = new java.lang.StringBuilder // Catch: java.lang.Exception -> L2b
r2.<init>() // Catch: java.lang.Exception -> L2b
int r0 = r0.f() // Catch: java.lang.Exception -> L2b
r2.append(r0) // Catch: java.lang.Exception -> L2b
r2.append(r1) // Catch: java.lang.Exception -> L2b
java.lang.String r1 = r2.toString() // Catch: java.lang.Exception -> L2b
L29:
r7 = r1
goto L2d
L2b:
r10 = move-exception
goto L52
L2d:
android.content.Context r0 = r9.a // Catch: java.lang.Exception -> L2b
com.mbridge.msdk.foundation.entity.CampaignEx r1 = r9.b // Catch: java.lang.Exception -> L2b
java.lang.String r2 = r1.getCampaignUnitId() // Catch: java.lang.Exception -> L2b
com.mbridge.msdk.foundation.entity.CampaignEx r1 = r9.b // Catch: java.lang.Exception -> L2b
boolean r3 = r1.isBidCampaign() // Catch: java.lang.Exception -> L2b
com.mbridge.msdk.foundation.entity.CampaignEx r1 = r9.b // Catch: java.lang.Exception -> L2b
java.lang.String r4 = r1.getRequestId() // Catch: java.lang.Exception -> L2b
com.mbridge.msdk.foundation.entity.CampaignEx r1 = r9.b // Catch: java.lang.Exception -> L2b
java.lang.String r5 = r1.getRequestIdNotice() // Catch: java.lang.Exception -> L2b
com.mbridge.msdk.foundation.entity.CampaignEx r1 = r9.b // Catch: java.lang.Exception -> L2b
java.lang.String r6 = r1.getId() // Catch: java.lang.Exception -> L2b
r1 = r10
com.mbridge.msdk.foundation.same.report.i.a(r0, r1, r2, r3, r4, r5, r6, r7) // Catch: java.lang.Exception -> L2b
goto L55
L52:
r10.printStackTrace()
L55:
r10 = 0
org.json.JSONObject r0 = new org.json.JSONObject // Catch: org.json.JSONException -> L68
r0.<init>() // Catch: org.json.JSONException -> L68
java.lang.String r10 = com.mbridge.msdk.foundation.same.a.j // Catch: org.json.JSONException -> L66
r1 = 0
org.json.JSONObject r1 = r9.a(r1) // Catch: org.json.JSONException -> L66
r0.put(r10, r1) // Catch: org.json.JSONException -> L66
goto L6f
L66:
r10 = move-exception
goto L6c
L68:
r0 = move-exception
r8 = r0
r0 = r10
r10 = r8
L6c:
r10.printStackTrace()
L6f:
com.mbridge.msdk.video.module.a.a r10 = r9.A
r1 = 105(0x69, float:1.47E-43)
r10.a(r1, r0)
com.mbridge.msdk.foundation.controller.c r10 = com.mbridge.msdk.foundation.controller.c.m()
android.content.Context r10 = r10.c()
if (r10 == 0) goto L9c
com.mbridge.msdk.foundation.controller.c r10 = com.mbridge.msdk.foundation.controller.c.m() // Catch: java.lang.Exception -> L92
android.content.Context r10 = r10.c() // Catch: java.lang.Exception -> L92
android.content.Context r10 = r10.getApplicationContext() // Catch: java.lang.Exception -> L92
com.mbridge.msdk.foundation.entity.CampaignEx r9 = r9.b // Catch: java.lang.Exception -> L92
com.mbridge.msdk.video.module.b.b.d(r10, r9) // Catch: java.lang.Exception -> L92
goto L9c
L92:
r9 = move-exception
java.lang.String r10 = "MBridgeBaseView"
java.lang.String r9 = r9.getMessage()
com.mbridge.msdk.foundation.tools.af.b(r10, r9)
L9c:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.video.module.MBridgeVideoView.a(com.mbridge.msdk.video.module.MBridgeVideoView, java.lang.String):void");
}
public static /* synthetic */ void C(MBridgeVideoView mBridgeVideoView) {
CollapsibleWebView collapsibleWebView = mBridgeVideoView.aN;
if (collapsibleWebView == null || mBridgeVideoView.b == null || !TextUtils.isEmpty(collapsibleWebView.getUrl())) {
return;
}
mBridgeVideoView.aN.loadUrl(mBridgeVideoView.b.getClickURL());
mBridgeVideoView.aN.setToolBarTitle(mBridgeVideoView.b.getAppName());
g b2 = com.mbridge.msdk.c.h.a().b(com.mbridge.msdk.foundation.controller.c.m().k());
if (b2 == null) {
com.mbridge.msdk.c.h.a();
b2 = com.mbridge.msdk.c.i.a();
}
mBridgeVideoView.aN.setPageLoadTimtout((int) b2.ar());
mBridgeVideoView.aN.setPageLoadListener(new CollapsibleWebView.a() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.5
@Override // com.mbridge.msdk.mbsignalcommon.commonwebview.CollapsibleWebView.a
public final void b(View view, Map<String, String> map) {
}
@Override // com.mbridge.msdk.mbsignalcommon.commonwebview.CollapsibleWebView.a
public final void a(View view, String str) {
JSONObject jSONObject;
if (MBridgeVideoView.this.aP) {
return;
}
MBridgeVideoView.this.aP = true;
if (MBridgeVideoView.this.aM != null && MBridgeVideoView.this.aM.getVisibility() != 0) {
MBridgeVideoView.this.aM.setVisibility(0);
}
Context context = MBridgeVideoView.this.getContext();
MBridgeVideoView mBridgeVideoView2 = MBridgeVideoView.this;
com.mbridge.msdk.click.a.a(context, mBridgeVideoView2.b, mBridgeVideoView2.getUnitId(), MBridgeVideoView.this.b.getNoticeUrl(), true, false, com.mbridge.msdk.click.a.a.i);
com.mbridge.msdk.video.module.b.b.d(com.mbridge.msdk.foundation.controller.c.m().c().getApplicationContext(), MBridgeVideoView.this.b);
e eVar = new e();
eVar.a("result", 1);
if (MBridgeVideoView.this.A != null) {
JSONObject jSONObject2 = null;
try {
jSONObject = new JSONObject();
try {
jSONObject.put(com.mbridge.msdk.foundation.same.a.j, MBridgeVideoView.this.a(0));
} catch (JSONException e) {
e = e;
jSONObject2 = jSONObject;
e.printStackTrace();
jSONObject = jSONObject2;
MBridgeVideoView.this.A.a(131, jSONObject);
MBridgeVideoView.this.b.setClickType(1);
MBridgeVideoView.this.b.setClickTempSource(1);
MBridgeVideoView.this.b.setTriggerClickSource(2);
d.a().a("2000149", MBridgeVideoView.this.b);
eVar.a("type", 9);
ArrayList arrayList = new ArrayList();
arrayList.add("web_view");
eVar.a("click_path", arrayList.toString());
d.a().a("2000150", MBridgeVideoView.this.b, eVar);
eVar.a("url", str);
d.a().a("m_webview_render", MBridgeVideoView.this.b, eVar);
}
} catch (JSONException e2) {
e = e2;
}
MBridgeVideoView.this.A.a(131, jSONObject);
MBridgeVideoView.this.b.setClickType(1);
MBridgeVideoView.this.b.setClickTempSource(1);
MBridgeVideoView.this.b.setTriggerClickSource(2);
d.a().a("2000149", MBridgeVideoView.this.b);
eVar.a("type", 9);
ArrayList arrayList2 = new ArrayList();
arrayList2.add("web_view");
eVar.a("click_path", arrayList2.toString());
d.a().a("2000150", MBridgeVideoView.this.b, eVar);
}
eVar.a("url", str);
d.a().a("m_webview_render", MBridgeVideoView.this.b, eVar);
}
@Override // com.mbridge.msdk.mbsignalcommon.commonwebview.CollapsibleWebView.a
public final void a(View view, Map<String, String> map) {
String str;
String str2;
str = "";
if (map != null) {
String str3 = map.get("url");
str = str3 != null ? str3 : "";
str2 = map.get("description");
} else {
str2 = "";
}
a(str, str2);
}
@Override // com.mbridge.msdk.mbsignalcommon.commonwebview.CollapsibleWebView.a
public final void b(View view, String str) {
a(str, "timeout");
}
private void a(String str, String str2) {
if (MBridgeVideoView.this.aP) {
return;
}
MBridgeVideoView.this.aP = true;
if (str == null) {
str = "";
}
if (MBridgeVideoView.this.aM != null && MBridgeVideoView.this.aM.getVisibility() == 0) {
MBridgeVideoView.this.aM.setVisibility(8);
}
e eVar = new e();
eVar.a("result", 2);
eVar.a("url", str);
eVar.a("reason", str2);
d.a().a("m_webview_render", MBridgeVideoView.this.b, eVar);
}
});
mBridgeVideoView.aN.setWebViewClient(new WebViewClient() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.6
@Override // android.webkit.WebViewClient
public final void onPageFinished(WebView webView, String str) {
}
@Override // android.webkit.WebViewClient
public final void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
}
});
mBridgeVideoView.aN.setCollapseListener(new CommonWebView.a() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.7
@Override // com.mbridge.msdk.mbsignalcommon.commonwebview.CommonWebView.a
public final void a() {
if (MBridgeVideoView.this.aO != null) {
MBridgeVideoView.this.aO.setVisibility(0);
e eVar = new e();
eVar.a("status", 1);
d.a().a("m_webview_zoom", MBridgeVideoView.this.b, eVar);
}
if (MBridgeVideoView.this.aN != null) {
MBridgeVideoView.this.aN.setCustomizedToolBarMarginWidthPixel(0, 0, 0, 0);
}
MBridgeVideoView.this.h();
}
});
mBridgeVideoView.aN.setExpandListener(new CommonWebView.a() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.8
@Override // com.mbridge.msdk.mbsignalcommon.commonwebview.CommonWebView.a
public final void a() {
if (MBridgeVideoView.this.aO != null) {
MBridgeVideoView.this.aO.setVisibility(8);
e eVar = new e();
eVar.a("status", 2);
d.a().a("m_webview_zoom", MBridgeVideoView.this.b, eVar);
}
if (MBridgeVideoView.this.aN != null) {
MBridgeVideoView.this.aN.setCustomizedToolBarMarginWidthPixel(0, MBridgeVideoView.this.aR, 0, 0);
}
MBridgeVideoView.this.g();
}
});
mBridgeVideoView.aN.setExitsClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.9
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
if (MBridgeVideoView.this.aO != null) {
MBridgeVideoView.this.aO.setVisibility(0);
}
if (MBridgeVideoView.this.aM != null) {
MBridgeVideoView.this.aM.setVisibility(8);
}
if (MBridgeVideoView.this.ay) {
return;
}
MBridgeVideoView.this.h();
}
});
}
public static /* synthetic */ void I(MBridgeVideoView mBridgeVideoView) {
String e;
CampaignEx campaignEx = mBridgeVideoView.b;
if (campaignEx == null || !campaignEx.isDynamicView() || mBridgeVideoView.N) {
return;
}
if (!TextUtils.isEmpty(mBridgeVideoView.b.getMof_template_url())) {
e = mBridgeVideoView.b.getMof_template_url();
} else if (mBridgeVideoView.b.getRewardTemplateMode() == null) {
return;
} else {
e = mBridgeVideoView.b.getRewardTemplateMode().e();
}
if (TextUtils.isEmpty(e)) {
return;
}
try {
String a2 = aq.a(e, "guideShow");
String a3 = aq.a(e, "guideDelay");
String a4 = aq.a(e, "guideTime");
String a5 = aq.a(e, "guideRewardTime");
if (!TextUtils.isEmpty(a2)) {
mBridgeVideoView.aF = Integer.parseInt(a2);
}
if (!TextUtils.isEmpty(a3)) {
int parseInt = Integer.parseInt(a3);
mBridgeVideoView.aG = parseInt;
if (parseInt > 10 || parseInt < 3) {
mBridgeVideoView.aG = 5;
}
}
if (!TextUtils.isEmpty(a4)) {
int parseInt2 = Integer.parseInt(a4);
mBridgeVideoView.aH = parseInt2;
if (parseInt2 > 10 || parseInt2 < 3) {
mBridgeVideoView.aH = 5;
}
}
if (!TextUtils.isEmpty(a5)) {
int parseInt3 = Integer.parseInt(a5);
mBridgeVideoView.aI = parseInt3;
if (parseInt3 > 10 || parseInt3 < 5) {
mBridgeVideoView.aI = 5;
}
}
int i = mBridgeVideoView.aF;
if (i > 0 && i <= 2) {
int o2 = mBridgeVideoView.o();
if (o2 == 0 || o2 > mBridgeVideoView.aG) {
int i2 = o2 - mBridgeVideoView.aG;
if (i2 >= 0 && mBridgeVideoView.aI > i2) {
mBridgeVideoView.aI = i2;
}
int p2 = mBridgeVideoView.p();
if (mBridgeVideoView.aI >= p2) {
mBridgeVideoView.aI = p2 - mBridgeVideoView.aG;
}
if (mBridgeVideoView.aG >= p2) {
return;
}
ArrayList<String> arrayList = new ArrayList<>();
arrayList.add(mBridgeVideoView.b.getAppName());
g a6 = com.mbridge.msdk.c.h.a().a(com.mbridge.msdk.foundation.controller.c.m().k());
mBridgeVideoView.aJ = new AcquireRewardPopViewParameters.Builder("", mBridgeVideoView.W, mBridgeVideoView.aF, a6 != null ? a6.r() : "US").setAutoDismissTime(mBridgeVideoView.aH).setReduceTime(mBridgeVideoView.aI).setBehaviourListener(new AcquireRewardPopViewBehaviourListener() { // from class: com.mbridge.msdk.video.module.MBridgeVideoView.11
@Override // com.mbridge.msdk.dycreator.baseview.rewardpopview.AcquireRewardPopViewBehaviourListener
public final void onReceivedSuccess(int i3) {
MBridgeVideoView.this.P = false;
if (com.mbridge.msdk.e.b.b()) {
MBridgeVideoView.this.setCover(false);
}
int o3 = MBridgeVideoView.this.o() - i3;
MBridgeVideoView.this.b.setVideoCompleteTime(o3);
MBridgeVideoView.this.h();
com.mbridge.msdk.video.module.a.a aVar = MBridgeVideoView.this.notifyListener;
if (aVar != null) {
aVar.a(130, Integer.valueOf(o3));
}
MBridgeVideoView mBridgeVideoView2 = MBridgeVideoView.this;
i.a(mBridgeVideoView2.b, mBridgeVideoView2.W, MBridgeVideoView.this.aF, 1, "");
}
@Override // com.mbridge.msdk.dycreator.baseview.rewardpopview.AcquireRewardPopViewBehaviourListener
public final void onReceivedFail(String str) {
MBridgeVideoView.this.P = false;
if (com.mbridge.msdk.e.b.b()) {
MBridgeVideoView.this.setCover(false);
}
MBridgeVideoView.this.h();
MBridgeVideoView mBridgeVideoView2 = MBridgeVideoView.this;
i.a(mBridgeVideoView2.b, mBridgeVideoView2.W, MBridgeVideoView.this.aF, 2, str);
}
@Override // com.mbridge.msdk.dycreator.baseview.rewardpopview.AcquireRewardPopViewBehaviourListener
public final void onOutOfContentClicked(float f, float f2) {
if (MBridgeVideoView.this.A != null) {
MBridgeVideoView.this.A.a(105, "");
}
}
}).setRightAnswerList(arrayList).build();
mBridgeVideoView.postDelayed(mBridgeVideoView.aX, 1000L);
}
}
} catch (Throwable th) {
af.b(MBridgeBaseView.TAG, th.getMessage());
}
}
}