正在查看: Chaupal v3.2 应用的 i.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Chaupal v3.2 应用的 i.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package tc;
import android.R;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.SurfaceView;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.CheckedTextView;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatButton;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.mediarouter.app.MediaRouteButton;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.connectsdk.service.capability.MediaPlayer;
import com.connectsdk.service.command.ServiceCommandError;
import com.google.ads.interactivemedia.v3.api.Ad;
import com.google.ads.interactivemedia.v3.api.AdEvent;
import com.google.ads.interactivemedia.v3.api.AdPodInfo;
import com.google.android.exoplayer2.DefaultRenderersFactory;
import com.google.android.exoplayer2.DeviceInfo;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.MediaMetadata;
import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.PlaybackParameters;
import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.RenderersFactory;
import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.Tracks;
import com.google.android.exoplayer2.audio.AudioAttributes;
import com.google.android.exoplayer2.drm.DefaultDrmSessionManagerProvider;
import com.google.android.exoplayer2.drm.DrmSessionManagerProvider;
import com.google.android.exoplayer2.drm.HttpMediaDrmCallback;
import com.google.android.exoplayer2.ext.ima.ImaAdsLoader;
import com.google.android.exoplayer2.ext.ima.ImaServerSideAdInsertionMediaSource;
import com.google.android.exoplayer2.ext.ima.ImaServerSideAdInsertionUriBuilder;
import com.google.android.exoplayer2.h2;
import com.google.android.exoplayer2.mediacodec.MediaCodecRenderer;
import com.google.android.exoplayer2.mediacodec.MediaCodecUtil;
import com.google.android.exoplayer2.metadata.Metadata;
import com.google.android.exoplayer2.offline.DownloadRequest;
import com.google.android.exoplayer2.source.BehindLiveWindowException;
import com.google.android.exoplayer2.source.DefaultMediaSourceFactory;
import com.google.android.exoplayer2.source.LoadEventInfo;
import com.google.android.exoplayer2.source.MediaLoadData;
import com.google.android.exoplayer2.source.MediaSource;
import com.google.android.exoplayer2.source.MediaSourceEventListener;
import com.google.android.exoplayer2.source.MediaSourceFactory;
import com.google.android.exoplayer2.source.TrackGroupArray;
import com.google.android.exoplayer2.source.ads.AdsLoader;
import com.google.android.exoplayer2.text.CueGroup;
import com.google.android.exoplayer2.trackselection.AdaptiveTrackSelection;
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
import com.google.android.exoplayer2.trackselection.TrackSelectionParameters;
import com.google.android.exoplayer2.ui.PlayerControlView;
import com.google.android.exoplayer2.ui.StyledPlayerView;
import com.google.android.exoplayer2.ui.SubtitleView;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource;
import com.google.android.exoplayer2.upstream.HttpDataSource;
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
import com.google.android.exoplayer2.util.Util;
import com.google.android.exoplayer2.video.VideoSize;
import com.google.android.gms.cast.framework.CastButtonFactory;
import com.google.android.gms.cast.framework.CastContext;
import com.google.android.gms.cast.framework.CastSession;
import com.google.android.gms.cast.framework.CastStateListener;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import com.google.android.gms.tasks.Task;
import com.google.android.material.progressindicator.CircularProgressIndicator;
import com.google.android.play.core.review.ReviewException;
import com.google.android.play.core.review.ReviewInfo;
import com.google.common.collect.ImmutableList;
import com.yupptv.analytics.plugin.impl.StateMachine;
import com.yupptv.ott.MainActivity;
import com.yupptv.ott.OTTApplication;
import com.yupptv.ott.SplashScreenActivity;
import com.yupptv.ott.controllers.GridController;
import com.yupptv.ott.database.WithoutInternetOfflineDownloadsEntity;
import com.yupptv.ott.enums.ButtonType;
import com.yupptv.ott.enums.ConcurrentStreamStatus;
import com.yupptv.ott.enums.DialogType;
import com.yupptv.ott.enums.ListType;
import com.yupptv.ott.enums.ScreenType;
import com.yupptv.ott.player.offlinedownload.MediaDownloadService;
import com.yupptv.ott.player.offlinedownload.OfflineDownloadData;
import com.yupptv.ott.plugin.utils.Ott_AdPosition;
import com.yupptv.ott.previewviews.DownloadImageAndVttFile;
import com.yupptv.ott.views.VerticalSeekBar;
import com.yupptv.ottsdk.OttSDK;
import com.yupptv.ottsdk.managers.MediaCatalog.MediaCatalogManager;
import com.yupptv.ottsdk.managers.Payment.PaymentManager;
import com.yupptv.ottsdk.managers.Preferences.PreferenceManager;
import com.yupptv.ottsdk.managers.User.UserManager;
import com.yupptv.ottsdk.model.Card;
import com.yupptv.ottsdk.model.ContentPage;
import com.yupptv.ottsdk.model.Error;
import com.yupptv.ottsdk.model.Filter;
import com.yupptv.ottsdk.model.LocationInfo;
import com.yupptv.ottsdk.model.PageData;
import com.yupptv.ottsdk.model.PageEventInfo;
import com.yupptv.ottsdk.model.PageInfo;
import com.yupptv.ottsdk.model.Section;
import com.yupptv.ottsdk.model.ShareInfo;
import com.yupptv.ottsdk.model.StreamStatus;
import com.yupptv.ottsdk.model.User;
import com.yupptv.ottsdk.model.ads.AdUrlResponse;
import com.yupptv.ottsdk.model.ads.AdUrlType;
import com.yupptv.ottsdk.model.payments.ActivePackagesResponse;
import com.yupptv.ottsdk.model.stream.Stream;
import com.yupptv.ottsdk.model.stream.StreamResponse;
import com.yupptv.ottsdk.model.user.Configs;
import com.yupptv.ottsdk.model.user.VideoQualitySetting;
import com.yupptv.ottsdk.utils.DeviceUtils;
import com.yupptv.ottsdk.utils.OttLog;
import hd.a;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.ref.WeakReference;
import java.net.CookieHandler;
import java.net.CookieManager;
import java.net.CookiePolicy;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import tc.j;
import xc.a;
public class i extends Fragment implements j.u, oc.a, j.q, Player.Listener, PlayerControlView.VisibilityListener, j.t, vc.a, MediaSourceFactory, DataSource.Factory, MediaSourceEventListener, fd.d {
private static boolean e5;
private static long h5;
private static final CookieManager j5;
public VideoQualitySetting A;
private TextView A0;
private ec.c A1;
TextView A3;
Uri[] B;
private CastStateListener B1;
TextView B3;
private boolean C;
private RelativeLayout C0;
ImageView C3;
public tc.j D0;
ImageView D3;
public DownloadImageAndVttFile E;
private CountDownTimer E0;
ImageView E3;
private ImageView G0;
private n7.a G2;
Dialog G4;
private int H0;
private ReviewInfo H2;
cc.b I2;
private androidx.fragment.app.h J;
private String J1;
private long J2;
uc.c K;
private String K1;
private long K2;
private long L2;
FrameLayout L3;
private long M2;
PageInfo M4;
public LinearLayout N;
private String N2;
TextView N3;
public RecyclerView O;
private String O2;
TextView O3;
public LinearLayoutManager P;
private boolean P1;
private String P2;
TextView P3;
private CountDownTimer P4;
private AdsLoader Q1;
TextView Q3;
private GridController R;
AdEvent.AdEventListener R1;
private Handler R3;
RelativeLayout S3;
public AppCompatButton T;
AppCompatButton T3;
public AppCompatButton U;
private int U2;
AppCompatButton U3;
androidx.fragment.app.d0 V;
StreamResponse V0;
private AdUrlResponse V1;
private int V2;
AppCompatButton V3;
JSONObject W0;
private List<AdUrlType> W1;
View W2;
AppCompatButton W3;
FragmentManager X;
public hd.w X0;
private Uri X1;
public ImageView X2;
AppCompatButton X3;
private TextView X4;
private Handler Y;
hd.k0 Y0;
public ImageView Y2;
public AppCompatButton Y3;
private VerticalSeekBar Y4;
private tc.a Z;
public yc.a Z0;
public ImageView Z2;
public FrameLayout Z3;
nd.a a1;
public ImageView a3;
public TextView a4;
public ImageView b3;
ImageView b4;
PlaybackParameters c;
private int c1;
public ImageView c3;
private String[] d;
public ImageView d3;
private String[] e;
public StyledPlayerView e0;
public ImageView e3;
private DataSource.Factory f0;
public ImageView f3;
public View f4;
private CheckedTextView[] g;
public ExoPlayer g0;
public ImageView g3;
public ImageView g4;
public Dialog h;
private DefaultTrackSelector h0;
Object h1;
public ImageView h3;
public ImageView h4;
int i;
private tc.k i0;
public ContentPage i1;
public ImageView i3;
public ImageView i4;
private RenderersFactory j0;
private ImageView j3;
public ImageView j4;
public StreamResponse k1;
private RelativeLayout k3;
public RelativeLayout k4;
public View l2;
private RelativeLayout l3;
public ImageView l4;
PageEventInfo m1;
public ImageView m2;
private ImageView m3;
public ImageView m4;
private boolean n0;
public boolean n1;
private StreamResponse.SessionInfo n2;
private ImageView n3;
public TextView n4;
private ImmutableList<Tracks.Group> o0;
public ContentPage o3;
public TextView o4;
private boolean p0;
List<Card> p2;
public TextView p3;
public TextView p4;
private int q0;
public boolean q1;
public TextView q3;
private RelativeLayout q4;
private long r0;
private ShareInfo r3;
private RelativeLayout r4;
e1 s;
private long s0;
private Ott_AdPosition s2;
RelativeLayout s3;
public CircularProgressIndicator s4;
private oc.l t0;
com.yupptv.ott.fragments.g t2;
LinearLayout t3;
public TextView t4;
private boolean u0;
private MediaRouteButton u1;
private hd.a0 u2;
LinearLayout u3;
public FrameLayout u4;
public boolean v;
private boolean v0;
private CastContext v1;
private OfflineDownloadData v2;
LinearLayout v3;
List<MediaItem> w;
private int w0;
private vc.c w1;
TextView w3;
public List<VideoQualitySetting> x;
private long x0;
private vc.b x1;
TextView x3;
private int x4;
private Bundle y0;
private FrameLayout y1;
TextView y3;
private ImaServerSideAdInsertionMediaSource.AdsLoader y4;
private TextView z0;
private ArrayList z1;
TextView z3;
private ImaServerSideAdInsertionMediaSource.AdsLoader.State z4;
public static final String b5 = i.class.getSimpleName();
public static final Integer c5 = 98;
public static final Integer d5 = 1;
private static String f5 = "";
public static boolean g5 = false;
private static final DefaultBandwidthMeter i5 = new DefaultBandwidthMeter();
boolean a = false;
public int f = 2;
float j = 0.5f;
float k = 1.0f;
float l = 1.5f;
float m = 2.0f;
private String n = "";
public int o = 0;
public boolean p = false;
public boolean q = false;
private CountDownTimer r = null;
private boolean t = false;
private int u = 0;
public String y = "";
public String z = "";
private boolean D = false;
private boolean F = false;
public boolean G = false;
public ButtonType H = ButtonType.NONE;
private boolean I = false;
private boolean L = false;
private final Handler M = new Handler();
RecyclerView.u Q = new RecyclerView.u();
private int S = 1;
boolean W = false;
public boolean k0 = false;
public String l0 = null;
public boolean m0 = false;
private boolean B0 = false;
private int F0 = -1;
private boolean I0 = true;
String J0 = "";
String K0 = "";
String L0 = "false";
String M0 = "-1";
String N0 = "-1";
String O0 = "";
String P0 = "";
String Q0 = "";
String R0 = "";
String S0 = "";
String T0 = "";
public String U0 = "";
private boolean b1 = false;
Section.SectionData d1 = null;
String e1 = "";
String f1 = "";
String g1 = "";
public int j1 = 0;
private boolean l1 = false;
public boolean o1 = false;
public boolean p1 = false;
private boolean r1 = true;
public boolean s1 = false;
public boolean t1 = false;
public String C1 = "";
private boolean D1 = false;
private String E1 = "";
private String F1 = "";
private int G1 = 0;
private int H1 = 0;
private String I1 = "";
private String L1 = "";
private String M1 = "";
private String N1 = "";
private long O1 = 0;
private boolean S1 = true;
public boolean T1 = false;
public boolean U1 = false;
private boolean Y1 = false;
private boolean Z1 = false;
private boolean a2 = false;
public boolean b2 = false;
public boolean c2 = false;
public boolean d2 = false;
private boolean e2 = false;
private boolean f2 = false;
public boolean g2 = false;
private boolean h2 = true;
private boolean i2 = false;
private String j2 = "";
public List<Filter.FilterItem> k2 = new ArrayList();
private Handler o2 = new Handler();
public boolean q2 = false;
private String r2 = "";
private long w2 = 10000;
private boolean x2 = false;
private String y2 = "";
private String z2 = "";
private String A2 = "";
private String B2 = "";
private String C2 = "";
private String D2 = "";
private boolean E2 = false;
private boolean F2 = false;
private String Q2 = "";
private String R2 = "";
private String S2 = "";
private String T2 = "";
boolean F3 = false;
boolean G3 = false;
String H3 = "";
String I3 = "";
String J3 = "";
private Long K3 = 0L;
boolean M3 = false;
public boolean c4 = false;
public boolean d4 = true;
public boolean e4 = false;
private float v4 = -1.0f;
private float w4 = -1.0f;
boolean A4 = false;
String B4 = "";
boolean C4 = false;
HashMap<String, String> D4 = new HashMap<>();
HashMap<String, String> E4 = new HashMap<>();
hd.p F4 = null;
View.OnClickListener H4 = new a();
boolean I4 = false;
boolean J4 = false;
private int K4 = 1;
private Runnable L4 = new q();
private Handler N4 = new Handler();
private Runnable O4 = new x();
private long Q4 = 0;
private long R4 = 0;
private oc.h S4 = new a0();
MediaCatalogManager.MediaCatalogCallback<StreamResponse> T4 = new o0();
MediaCatalogManager.MediaCatalogCallback<Section.SectionData> U4 = new p0();
private String V4 = "";
private String W4 = "";
VerticalSeekBar Z4 = null;
TextView a5 = null;
class a implements View.OnClickListener {
class C0184a implements oc.d {
C0184a() {
}
@Override
public void a(AppCompatButton appCompatButton, Object obj, ButtonType buttonType) {
}
@Override
public void onDismiss() {
}
}
a() {
}
@Override
public void onClick(View view) {
PageEventInfo pageEventInfo;
i iVar = i.this;
iVar.q2 = false;
if (iVar.getActivity() != null) {
MainActivity activity = i.this.getActivity();
if (activity.V2()) {
return;
}
View view2 = i.this.f4;
if (view2 == null || view2.getVisibility() != 0 || i.this.getActivity().w2() == 1) {
activity.u4(true);
activity.w3.postDelayed(activity.x3, 1000L);
}
switch (view.getId()) {
case 2131427636:
case 2131428928:
i.this.i3();
break;
case 2131427638:
i iVar2 = i.this;
if (!iVar2.d4) {
iVar2.d4 = true;
iVar2.e0.setResizeMode(0);
i iVar3 = i.this;
iVar3.X3.setText(iVar3.getActivity().getResources().getString(2131953006));
break;
} else {
iVar2.d4 = false;
iVar2.e0.setResizeMode(4);
i iVar4 = i.this;
iVar4.X3.setText(iVar4.getActivity().getResources().getString(2131952560));
break;
}
case 2131427641:
i.this.h3();
break;
case 2131427643:
i iVar5 = i.this;
iVar5.q2 = true;
iVar5.Z3();
if (i.this.getActivity() != null) {
i iVar6 = i.this;
ButtonType buttonType = iVar6.H;
if (buttonType != null && buttonType == ButtonType.START_OVER) {
iVar6.getActivity().s4(ButtonType.WATCH_NOW);
break;
} else {
iVar6.getActivity().s4(ButtonType.START_OVER);
break;
}
}
break;
case 2131427753:
case 2131428117:
case 2131429158:
i.this.a();
break;
case 2131427789:
i.this.M1();
break;
case 2131428201:
i.this.s4();
break;
case 2131428931:
case 2131429157:
ContentPage contentPage = i.this.o3;
if (contentPage != null && contentPage.getPageEventInfo() != null && (pageEventInfo = i.this.m1) != null && pageEventInfo.getTargetPath() != null) {
if (i.this.getActivity() != null) {
i.this.getActivity().onBackPressed();
}
if (i.this.getActivity() != null && !i.this.getActivity().isFinishing()) {
i.this.getActivity().O1();
hd.u.t0(i.this.getActivity(), i.this.m1.getTargetPath());
i.this.g4();
break;
}
}
break;
case 2131429104:
ExoPlayer exoPlayer = i.this.g0;
if (exoPlayer != null && exoPlayer.getDuration() != 0 && !i.this.g0.isPlayingAd()) {
cc.c.d().t("player_actions", i.this.I2.A(cc.c.f1));
}
ExoPlayer exoPlayer2 = i.this.g0;
if (exoPlayer2 != null) {
if (exoPlayer2 != null && exoPlayer2.getPlayWhenReady()) {
i.this.g0.setPlayWhenReady(false);
i.this.i4.setVisibility(8);
i.this.g4.setVisibility(0);
i.this.h4.setVisibility(8);
break;
}
}
break;
case 2131429152:
ExoPlayer exoPlayer3 = i.this.g0;
if (exoPlayer3 != null && exoPlayer3.getDuration() != 0 && !i.this.g0.isPlayingAd()) {
cc.c.d().t("player_actions", i.this.I2.A(cc.c.e1));
}
ExoPlayer exoPlayer4 = i.this.g0;
if (exoPlayer4 != null) {
if (!(exoPlayer4 != null && exoPlayer4.getPlayWhenReady())) {
i.this.g0.setPlayWhenReady(true);
i.this.i4.setVisibility(0);
i.this.g4.setVisibility(8);
i.this.h4.setVisibility(8);
break;
}
}
break;
case 2131429174:
i.this.D0.W();
Configs c = hd.a.a.c(OTTApplication.o());
String showStreamBitRate = c != null ? c.getShowStreamBitRate() : "false";
HashMap hashMap = new HashMap();
hashMap.put(hd.e.f, i.this.L1);
hashMap.put(hd.e.g, i.this.N1);
hashMap.put(hd.e.i, i.this.V4);
hashMap.put(hd.e.j, i.this.W4);
hashMap.put("navigation_player_info", "true");
if (i.this.getActivity() != null && showStreamBitRate.equalsIgnoreCase("true") && i.this.Z != null && i.this.Z.d > 0) {
hashMap.put("streamBitRateValue", String.format(i.this.getActivity().getResources().getString(2131952796), "" + i.this.Z.d));
}
if (i.this.getActivity() != null) {
i iVar7 = i.this;
iVar7.t2 = hd.u.K0(iVar7.getActivity(), DialogType.DIALOG_PLAYER_BOTTOM_RENDERING, hashMap, null, new C0184a());
break;
}
break;
case 2131429181:
hd.h.b("recordStatus", "+++++++++++++" + ((String) i.this.b3.getTag()));
break;
case 2131429184:
case 2131429185:
tc.j jVar = i.this.D0;
if (jVar != null) {
jVar.U0(cc.c.s0, cc.c.j1);
}
if (i.this.h0 != null && i.this.h0.getCurrentMappedTrackInfo() != null && i.this.getActivity() != null) {
i iVar8 = i.this;
VideoQualitySetting videoQualitySetting = iVar8.A;
if (videoQualitySetting != null) {
iVar8.z = videoQualitySetting.getDisplayTitle();
i.this.i0.y = true;
}
tc.k kVar = i.this.i0;
androidx.fragment.app.h activity2 = i.this.getActivity();
i iVar9 = i.this;
kVar.t(activity2, iVar9, "Video", iVar9.h0, 0, true);
break;
}
break;
case 2131429188:
case 2131429568:
tc.j jVar2 = i.this.D0;
if (jVar2 != null) {
jVar2.U0(cc.c.s0, cc.c.k1);
}
i.this.W3();
break;
case 2131429352:
i iVar10 = i.this;
iVar10.a = true;
tc.j jVar3 = iVar10.D0;
if (jVar3 != null) {
jVar3.U0(cc.c.s0, cc.c.n1);
}
if (i.this.v1 == null || !i.this.isAdded()) {
i.this.w4(false);
i.this.J1();
i.this.p3();
} else if (i.this.v1.getCastState() == 4) {
i.this.P1 = true;
i iVar11 = i.this;
iVar11.c4(iVar11.h1, iVar11.O1, ButtonType.NONE);
} else if (i.this.getActivity() == null || i.this.v1.getCastState() != 2 || i.this.getActivity().C1) {
i.this.w4(false);
i.this.J1();
i.this.p3();
} else {
i.this.getActivity().q5();
}
i.this.i4.setVisibility(0);
i.this.g4.setVisibility(8);
i.this.h4.setVisibility(8);
break;
case 2131429537:
if (i.this.D0 != null) {
cc.b.B0().h0(null).putAll(cc.b.B0().i());
tc.j jVar4 = i.this.D0;
jVar4.l0(jVar4.H0);
i.this.Y3.setVisibility(8);
i.this.t1 = true;
break;
}
break;
case 2131429699:
cc.c.d().m(ScreenType.PLAYER, null, null, null, i.this.J3, cc.c.x1, null);
if (i.this.getActivity() != null) {
androidx.fragment.app.h activity3 = i.this.getActivity();
String str = hd.r.w1;
i iVar12 = i.this;
hd.u.f0(activity3, str, iVar12.I3, iVar12.J3);
break;
}
break;
case 2131429985:
FrameLayout frameLayout = i.this.Z3;
if (frameLayout != null && frameLayout.getVisibility() == 0) {
i.this.Z3.setVisibility(8);
}
i.this.w4(false);
break;
}
}
}
}
class a0 implements oc.h {
a0() {
}
@Override
public void o(boolean z, int i, HashMap hashMap) {
if (!z) {
i.this.j2 = "";
if (i.this.getActivity() == null) {
i.this.V2();
return;
} else {
i.this.a();
i.this.getActivity().F2();
return;
}
}
if (i == 1) {
hd.u.Q(i.this.getActivity(), ScreenType.FORGOT_PIN, hd.r.g1, "", 9, false, false);
return;
}
i.this.j2 = String.valueOf(i);
i iVar = i.this;
iVar.c4(iVar.h1, iVar.O1, i.this.H);
}
@Override
public void y(boolean z, int i, int i2) {
}
}
class a1 implements View.OnClickListener {
a1() {
}
@Override
public void onClick(View view) {
i.this.n4(cc.d.X);
int i = (i.this.h0 == null || i.this.h0.getCurrentMappedTrackInfo() == null || i.this.h0.getCurrentMappedTrackInfo().getTrackGroups(2) == null || i.this.h0.getCurrentMappedTrackInfo().getTrackGroups(2).length <= 0) ? 1 : 2;
if (i.this.i0 != null) {
tc.k kVar = i.this.i0;
androidx.fragment.app.h activity = i.this.getActivity();
i iVar = i.this;
kVar.u(activity, iVar, "text", iVar.h0, i, true);
}
}
}
class b implements View.OnClickListener {
b() {
}
@Override
public void onClick(View view) {
cc.d.d().f(cc.d.V);
if (i.this.getActivity() != null) {
hd.u.N(i.this.getActivity(), ScreenType.OTP_VERIFY, hd.r.g1, null, 9);
}
}
}
class b0 implements View.OnClickListener {
b0() {
}
@Override
public void onClick(View view) {
i.this.w4(false);
i.this.J1();
i.this.F0 = -1;
tc.j jVar = i.this.D0;
if (jVar != null) {
jVar.U0(cc.c.s0, cc.c.n1);
}
if (i.this.v1.getCastState() != 4) {
i.this.p3();
return;
}
i.this.P1 = true;
i iVar = i.this;
iVar.c4(iVar.h1, iVar.O1, ButtonType.NONE);
}
}
class b1 implements View.OnClickListener {
b1() {
}
@Override
public void onClick(View view) {
LinearLayout linearLayout = i.this.N;
if (linearLayout != null) {
if (linearLayout.getVisibility() == 0) {
i iVar = i.this;
iVar.G2(iVar.N);
i.this.b4.setVisibility(8);
} else {
i iVar2 = i.this;
iVar2.U3(iVar2.N);
i.this.b4.setVisibility(0);
}
}
}
}
class c implements View.OnScrollChangeListener {
c() {
}
@Override
public void onScrollChange(View view, int i, int i2, int i3, int i4) {
}
}
class c0 implements Runnable {
c0() {
}
@Override
public void run() {
if (i.this.getActivity().r2) {
return;
}
View view = i.this.D0.J;
if (view != null && view.getVisibility() == 0) {
i.this.D0.J.setVisibility(8);
}
HashMap hashMap = new HashMap();
Configs D = OTTApplication.D();
if (!com.yupptv.ott.a.h || OTTApplication.i0 == null || D == null || D.getParentalControlPopupMessage() == null || D.getParentalControlPopupMessage().trim().length() <= 0) {
String str = hd.d.e;
if (str == null || str.trim().length() <= 0) {
hashMap.put("msg1", String.format(i.this.getActivity().getResources().getString(2131952594), Integer.valueOf(hd.d.d)));
} else {
hashMap.put("msg1", hd.d.e);
}
} else {
hashMap.put("msg1", D.getParentalControlPopupMessage());
}
hd.u.J0(i.this.getActivity(), DialogType.PARENTAL_CONTROL_PASSCODE_DIALOG, hashMap, i.this.S4);
}
}
class c1 implements View.OnClickListener {
c1() {
}
@Override
public void onClick(View view) {
i.this.Q3(false, "");
i iVar = i.this;
if (iVar.g0 != null) {
TextView textView = iVar.p3;
if (textView != null) {
textView.setVisibility(8);
}
i.this.B3.setVisibility(8);
hd.h.b("pausedPosition", "playerCurrentPosition" + i.this.s0);
i.this.g0.prepare();
i.this.g0.setPlayWhenReady(true);
i iVar2 = i.this;
iVar2.g0.seekTo(iVar2.s0);
}
}
}
class d implements View.OnClickListener {
d() {
}
@Override
public void onClick(View view) {
if (i.this.N.getVisibility() == 0) {
i iVar = i.this;
iVar.G2(iVar.N);
}
}
}
class d0 implements MediaCatalogManager.MediaCatalogCallback<StreamResponse> {
final Object a;
final List b;
final PageInfo c;
final StreamStatus d;
d0(Object obj, List list, PageInfo pageInfo, StreamStatus streamStatus) {
this.a = obj;
this.b = list;
this.c = pageInfo;
this.d = streamStatus;
}
@Override
public void onSuccess(StreamResponse streamResponse) {
i.this.a3(streamResponse, this.a, this.b, this.c, this.d);
}
@Override
public void onFailure(Error error) {
i.this.Z2(this.a, error);
if (error == null || error.getCode() == null || error.getMessage() == null) {
return;
}
cc.c.d().t("playback_errors", cc.b.B0().o(error.getCode().toString(), error.getMessage()));
cc.b.B0().h0(null).putAll(cc.b.B0().p((error.getDetails() == null || error.getDetails().getDescription() == null) ? "" : error.getDetails().getDescription(), error.getMessage()));
}
}
class d1 implements View.OnClickListener {
d1() {
}
@Override
public void onClick(View view) {
if (i.this.getActivity() != null) {
MainActivity activity = i.this.getActivity();
if (activity.V2()) {
return;
}
activity.u4(true);
activity.w3.postDelayed(activity.x3, 1000L);
i.this.L3();
}
}
}
class e implements View.OnClickListener {
e() {
}
@Override
public void onClick(View view) {
i iVar = i.this;
iVar.a = true;
tc.j jVar = iVar.D0;
if (jVar != null) {
jVar.U0(cc.c.s0, cc.c.n1);
}
if (i.this.v1 == null || !i.this.isAdded()) {
if (hd.e0.h0(i.this.getActivity())) {
i.this.w4(false);
i.this.J1();
i.this.p3();
return;
} else {
AppCompatButton appCompatButton = i.this.T;
if (appCompatButton != null) {
appCompatButton.setVisibility(8);
}
i iVar2 = i.this;
iVar2.L2(iVar2.y0);
return;
}
}
if (i.this.v1.getCastState() == 4) {
i.this.P1 = true;
i iVar3 = i.this;
iVar3.c4(iVar3.h1, iVar3.O1, ButtonType.NONE);
return;
}
if (i.this.getActivity() != null && i.this.v1.getCastState() == 2 && !i.this.getActivity().C1) {
i.this.getActivity().q5();
return;
}
if (hd.e0.h0(i.this.getActivity())) {
i.this.w4(false);
i.this.J1();
i.this.p3();
} else {
AppCompatButton appCompatButton2 = i.this.T;
if (appCompatButton2 != null) {
appCompatButton2.setVisibility(8);
}
i iVar4 = i.this;
iVar4.L2(iVar4.y0);
}
}
}
class e0 implements MediaCatalogManager.MediaCatalogCallback<StreamResponse> {
final Object a;
final List b;
final PageInfo c;
final StreamStatus d;
e0(Object obj, List list, PageInfo pageInfo, StreamStatus streamStatus) {
this.a = obj;
this.b = list;
this.c = pageInfo;
this.d = streamStatus;
}
@Override
public void onSuccess(StreamResponse streamResponse) {
i.this.a3(streamResponse, this.a, this.b, this.c, this.d);
}
@Override
public void onFailure(Error error) {
i.this.Z2(this.a, error);
if (error == null || error.getCode() == null || error.getMessage() == null) {
return;
}
cc.c.d().t("playback_errors", cc.b.B0().o(error.getCode().toString(), error.getMessage()));
cc.b.B0().h0(null).putAll(cc.b.B0().p((error.getDetails() == null || error.getDetails().getDescription() == null) ? "" : error.getDetails().getDescription(), error.getMessage()));
}
}
public static abstract class e1 {
public abstract void a();
public abstract void b();
}
class f implements j.v {
f() {
}
@Override
public void onVisibilityChange(int i) {
i.this.j4();
}
}
class f0 implements MediaPlayer.LaunchListener {
f0() {
}
public void onSuccess(MediaPlayer.MediaLaunchObject mediaLaunchObject) {
i.this.A1.S(true);
if (i.this.x1 != null) {
i.this.x1.T();
i.this.x1.I();
}
}
public void onError(ServiceCommandError serviceCommandError) {
}
}
class g implements vc.d {
g() {
}
@Override
public void a() {
i iVar = i.this;
iVar.C1 = "";
iVar.F0 = -1;
OttLog.error("chromecast", "onPlayBackCompleted : " + i.this.G3);
i iVar2 = i.this;
if (!iVar2.G3 || !iVar2.I) {
i.this.X3(true);
return;
}
i.this.p();
if (i.this.getActivity() != null) {
i.this.getActivity().N3();
}
i.this.D4(true);
i.this.o3();
i.this.i3();
cc.c.d().o(cc.b.v1, cc.b.B0().c(i.this.d1));
}
}
class g0 implements Runnable {
final Object a;
class a implements Runnable {
a() {
}
@Override
public void run() {
CastSession currentCastSession = i.this.v1.getSessionManager().getCurrentCastSession();
i iVar = i.this;
String str = iVar.P0;
String str2 = iVar.I1;
String str3 = i.this.L1;
String str4 = i.this.N1;
int i = i.this.G1;
String str5 = i.this.E1;
g0 g0Var = g0.this;
Object obj = g0Var.a;
i iVar2 = i.this;
String str6 = iVar2.J0;
String str7 = iVar2.F1;
i iVar3 = i.this;
hd.b.h(currentCastSession, str, str2, 0L, str3, str4, i, str5, obj, str6, str7, iVar3.T0, iVar3.S0, iVar3.R0, iVar3.W0);
}
}
g0(Object obj) {
this.a = obj;
}
@Override
public void run() {
if (i.this.J1 == null || !i.this.v2.n().equalsIgnoreCase(i.this.J1)) {
if (i.this.M1 == null || !i.this.v2.h().equalsIgnoreCase(i.this.M1)) {
i iVar = i.this;
iVar.J1 = iVar.v2.n();
i iVar2 = i.this;
iVar2.M1 = iVar2.v2.h();
i.this.y0 = new Bundle();
i iVar3 = i.this;
iVar3.r4(iVar3.v2.m(), true);
i.this.y0.putString("playerurl", i.this.P0);
i iVar4 = i.this;
TextView textView = iVar4.N3;
if (textView != null) {
textView.setText(iVar4.L1);
}
i iVar5 = i.this;
TextView textView2 = iVar5.O3;
if (textView2 != null) {
textView2.setText(iVar5.N1);
}
i iVar6 = i.this;
iVar6.I1 = iVar6.v2.k();
String str = i.this.P0;
if (str == null || str.length() <= 0) {
return;
}
new Handler().postDelayed(new a(), 1000L);
}
}
}
}
class h implements uc.d {
h() {
}
@Override
public void a(boolean z) {
hd.h.b("registerAudioFocus", "CommandRelease");
ExoPlayer exoPlayer = i.this.g0;
if (exoPlayer != null) {
exoPlayer.setPlayWhenReady(false);
}
}
@Override
public void b() {
}
@Override
public void c() {
ImageView imageView;
hd.h.b("registerAudioFocus", "CommandPause");
ExoPlayer exoPlayer = i.this.g0;
if (exoPlayer != null) {
exoPlayer.setPlayWhenReady(false);
i iVar = i.this;
if (iVar.i4 == null || (imageView = iVar.g4) == null) {
return;
}
imageView.setVisibility(0);
i.this.i4.setVisibility(8);
}
}
@Override
public void d() {
ExoPlayer exoPlayer = i.this.g0;
if (exoPlayer == null || !exoPlayer.getPlayWhenReady()) {
return;
}
i.this.g0.setPlayWhenReady(true);
i iVar = i.this;
ImageView imageView = iVar.g4;
if (imageView == null || iVar.i4 == null) {
return;
}
imageView.setVisibility(8);
i.this.i4.setVisibility(0);
}
@Override
public void e(float f) {
hd.h.b("registerAudioFocus", "CommandVolume");
}
}
class h0 implements Runnable {
final Long a;
h0(Long l) {
this.a = l;
}
@Override
public void run() {
i iVar = i.this;
iVar.J1 = iVar.v2.n();
i iVar2 = i.this;
iVar2.M1 = iVar2.v2.h();
i.this.y0 = new Bundle();
i.this.x0 = this.a.longValue();
i.this.v0 = true;
if (i.this.v2.l() != null && i.this.v2.l().booleanValue() && i.this.v2.m() != null && i.this.v2.m().trim().length() > 0) {
i iVar3 = i.this;
iVar3.r4(iVar3.E1 = iVar3.v2.m(), true);
i iVar4 = i.this;
iVar4.D3(iVar4.W2);
}
i.this.y0.putString("playerurl", i.this.P0);
if (i.this.getActivity() != null) {
i.this.p0 = true;
i.this.D4(true);
i iVar5 = i.this;
iVar5.L2(iVar5.y0);
i.this.T.setVisibility(8);
}
}
}
class C0185i implements AdEvent.AdEventListener {
C0185i() {
}
public void onAdEvent(AdEvent adEvent) {
AdPodInfo adPodInfo;
long j;
long j2;
AdEvent.AdEventType type = adEvent.getType();
Ad ad2 = adEvent.getAd();
switch (z0.a[type.ordinal()]) {
case 1:
hd.h.a("DEBUG " + i.b5, "Ad Loaded index: " + i.this.r2);
hd.h.b("AdEvent ::", "LOADED : ");
i iVar = i.this;
iVar.U1 = true;
tc.j jVar = iVar.D0;
if (jVar != null) {
jVar.W();
break;
}
break;
case 2:
hd.h.a("DEBUG " + i.b5, "Ad Started");
i iVar2 = i.this;
if (iVar2.X0 != null || iVar2.Z0 != null) {
iVar2.T1 = true;
tc.j jVar2 = iVar2.D0;
if (jVar2 != null) {
jVar2.h1 = false;
jVar2.X();
}
if (ad2 != null && (adPodInfo = ad2.getAdPodInfo()) != null) {
int podIndex = adPodInfo.getPodIndex();
i.this.r2 = podIndex == -1 ? "postroll" : podIndex == 0 ? "preroll" : "midroll";
i.this.s2 = podIndex == -1 ? Ott_AdPosition.POSTROLL : podIndex == 0 ? Ott_AdPosition.PREROLL : Ott_AdPosition.MIDROLL;
hd.h.b("AdEvent ::", "STARTED : " + i.this.r2);
}
i iVar3 = i.this;
iVar3.z2(iVar3.r2, i.this.s2);
break;
}
break;
case 3:
hd.h.a("DEBUG " + i.b5, "Ad Paused");
hd.h.b("AdEvent ::", "PAUSED : " + i.this.r2);
i.this.a2 = false;
hd.w wVar = i.this.X0;
if (wVar != null) {
wVar.t(StateMachine.PlayerState.ADPAUSED);
break;
}
break;
case 4:
hd.h.a("DEBUG " + i.b5, "Ad Resumed");
hd.h.b("AdEvent ::", "RESUMED : " + i.this.r2);
if (!i.this.a2) {
hd.w wVar2 = i.this.X0;
if (wVar2 != null) {
wVar2.t(StateMachine.PlayerState.ADPLAYING);
break;
}
} else {
i iVar4 = i.this;
iVar4.z2(iVar4.r2, i.this.s2);
break;
}
break;
case 5:
hd.h.a("DEBUG " + i.b5, "Ad Ended");
i iVar5 = i.this;
if (iVar5.v && !iVar5.q) {
if (iVar5.g0 != null) {
if (iVar5.w2 > i.this.g0.getDuration()) {
i iVar6 = i.this;
if (!iVar6.n1) {
j = iVar6.g0.getDuration();
iVar5.w2 = j;
long unused = i.h5 = i.this.w2;
}
}
j = i.this.w2;
iVar5.w2 = j;
long unused2 = i.h5 = i.this.w2;
}
long unused3 = i.this.w2;
}
hd.h.b("AdEvent ::", "COMPLETED : " + i.this.r2);
i iVar7 = i.this;
iVar7.T1 = false;
iVar7.U1 = false;
tc.j jVar3 = iVar7.D0;
if (jVar3 != null) {
jVar3.X();
}
i iVar8 = i.this;
iVar8.x2(iVar8.r2);
break;
case 6:
hd.h.a("DEBUG " + i.b5, "Ad Skipped");
i iVar9 = i.this;
if (iVar9.v && !iVar9.q) {
if (iVar9.g0 != null) {
if (iVar9.w2 > i.this.g0.getDuration()) {
i iVar10 = i.this;
if (!iVar10.n1) {
j2 = iVar10.g0.getDuration();
iVar9.w2 = j2;
long unused4 = i.h5 = i.this.w2;
}
}
j2 = i.this.w2;
iVar9.w2 = j2;
long unused42 = i.h5 = i.this.w2;
}
long unused5 = i.this.w2;
}
hd.h.b("AdEvent ::", "SKIPPED : " + i.this.r2);
i iVar11 = i.this;
iVar11.T1 = false;
iVar11.U1 = false;
iVar11.y2(iVar11.r2);
break;
case 7:
hd.h.a("DEBUG " + i.b5, "Ad TAPPED");
hd.h.b("AdEvent ::", "TAPPED : " + i.this.r2);
i iVar12 = i.this;
if (iVar12.D0 != null && iVar12.getActivity().w2() != 2) {
i.this.D0.R0();
break;
} else {
i.this.getActivity().l();
break;
}
break;
case 8:
hd.h.a("DEBUG " + i.b5, "All Ads completed");
i iVar13 = i.this;
iVar13.T1 = false;
iVar13.U1 = false;
hd.h.b("AdEvent ::", "ALL_ADS_COMPLETED : " + i.this.r2);
break;
case 9:
hd.h.a("DEBUG " + i.b5, "Ad Error");
hd.h.b("AdEvent ::", "AD_BREAK_FETCH_ERROR : " + i.this.r2);
i iVar14 = i.this;
iVar14.T1 = false;
iVar14.U1 = false;
iVar14.x2(iVar14.r2);
break;
}
}
}
class i0 implements MediaPlayer.LaunchListener {
i0() {
}
public void onSuccess(MediaPlayer.MediaLaunchObject mediaLaunchObject) {
i.this.A1.S(true);
if (i.this.x1 != null) {
i.this.x1.T();
i.this.x1.I();
}
}
public void onError(ServiceCommandError serviceCommandError) {
}
}
class j implements View.OnClickListener {
j() {
}
@Override
public void onClick(View view) {
i.this.f = ((Integer) view.getTag()).intValue();
i iVar = i.this;
iVar.C3(Float.parseFloat(iVar.e[i.this.f]));
i.this.E4();
}
}
class j0 implements Runnable {
final Object a;
final long c;
final PageInfo d;
j0(Object obj, long j, PageInfo pageInfo) {
this.a = obj;
this.c = j;
this.d = pageInfo;
}
@Override
public void run() {
i iVar = i.this;
iVar.Y2(this.a, this.c, iVar.J0);
i iVar2 = i.this;
iVar2.d1 = null;
if (iVar2.I) {
i.this.g2(this.d.getPath());
}
}
}
class k implements MediaCatalogManager.MediaCatalogCallback<ContentPage> {
k() {
}
@Override
public void onSuccess(ContentPage contentPage) {
if (i.this.getActivity().w2() != 1) {
i.this.getActivity().N3();
}
i.this.c4(contentPage, 0L, ButtonType.NONE);
}
@Override
public void onFailure(Error error) {
i iVar = i.this;
iVar.c4(iVar.h1, 0L, ButtonType.NONE);
if (error == null || error.getCode() == null || error.getMessage() == null) {
return;
}
cc.c.d().t("playback_errors", cc.b.B0().o(error.getCode().toString(), error.getMessage()));
cc.b.B0().h0(null).putAll(cc.b.B0().p((error.getDetails() == null || error.getDetails().getDescription() == null) ? "" : error.getDetails().getDescription(), error.getMessage()));
}
}
class k0 implements Runnable {
final List a;
final PageInfo c;
k0(List list, PageInfo pageInfo) {
this.a = list;
this.c = pageInfo;
}
@Override
public void run() {
i.this.y0.putString("playerurl", i.this.P0);
if (i.this.getActivity() != null) {
i.this.p0 = true;
i iVar = i.this;
iVar.L2(iVar.y0);
i.this.V1(this.a);
i.this.X3(false);
if (this.c.getPath() != null) {
i iVar2 = i.this;
iVar2.d1 = null;
iVar2.g2(this.c.getPath());
}
}
}
}
class l implements Runnable {
final View a;
l(View view) {
this.a = view;
}
@Override
public void run() {
i.this.L3 = (FrameLayout) this.a.findViewById(2131429192);
if (i.this.L3.getChildCount() > 0) {
i.this.L3.removeAllViews();
}
i iVar = i.this;
if (iVar.M3) {
iVar.e0 = LayoutInflater.from(iVar.getActivity()).inflate(2131624106, (ViewGroup) this.a, false);
} else {
iVar.e0 = LayoutInflater.from(iVar.getActivity()).inflate(2131624106, (ViewGroup) this.a, false);
}
i iVar2 = i.this;
iVar2.l2 = com.yupptv.ott.a.O ? (LinearLayout) iVar2.e0.findViewById(2131428759) : (ProgressBar) iVar2.e0.findViewById(2131428758);
i iVar3 = i.this;
iVar3.m2 = (ImageView) iVar3.e0.findViewById(2131428120);
i.this.e0.requestFocus();
i.this.e0.setResizeMode(0);
i.this.e0.setUseController(false);
i.this.e0.setKeepScreenOn(true);
i iVar4 = i.this;
iVar4.L3.addView(iVar4.e0);
i iVar5 = i.this;
iVar5.q3 = (TextView) iVar5.e0.findViewById(2131429230);
i iVar6 = i.this;
iVar6.v3 = (LinearLayout) iVar6.e0.findViewById(2131429231);
}
}
class l0 implements Runnable {
final List a;
final PageInfo c;
l0(List list, PageInfo pageInfo) {
this.a = list;
this.c = pageInfo;
}
@Override
public void run() {
if (i.this.y0 == null) {
i.this.y0 = new Bundle();
}
i.this.y0.putString("playerurl", i.this.P0);
if (i.this.getActivity() != null) {
i.this.p0 = true;
i iVar = i.this;
iVar.L2(iVar.y0);
i.this.V1(this.a);
i.this.X3(false);
i.this.d1 = null;
if (this.c.getPath() != null) {
i.this.g2(this.c.getPath());
}
}
}
}
class m implements View.OnTouchListener {
m() {
}
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
LinearLayout linearLayout = i.this.N;
if (linearLayout != null && linearLayout.getVisibility() == 0) {
return true;
}
hd.h.b("Ads ::", "onTouch playing ad" + i.this.T1);
if (i.this.T1) {
hd.h.b("Ads ::", "onTouch playing ad" + i.this.g0.isPlayingAd());
tc.j jVar = i.this.D0;
if (jVar != null) {
jVar.W();
return true;
}
}
if (motionEvent.getActionMasked() == 0 && i.this.T.getVisibility() != 0) {
if (i.this.D0.c0()) {
i.this.D0.W();
i.this.getActivity().getSupportActionBar().k();
} else {
i.this.D0.C0();
i.this.getActivity().getSupportActionBar().E();
}
}
if (i.this.T.getVisibility() == 0) {
i.this.D0.I0(10000);
}
return true;
}
}
class m0 implements View.OnClickListener {
m0() {
}
@Override
public void onClick(View view) {
if (i.this.E0 != null) {
i.this.E0.cancel();
}
i iVar = i.this;
iVar.G3 = false;
iVar.x();
if (i.this.v1 == null || i.this.v1.getCastState() != 4) {
return;
}
i.this.M3();
i.this.X3(true);
}
}
class n implements UserManager.UserCallback<String> {
n() {
}
@Override
public void onSuccess(String str) {
i.this.o2.removeCallbacks(i.this.L4);
}
@Override
public void onFailure(Error error) {
i.this.o2.removeCallbacks(i.this.L4);
if (error == null || error.getCode() == null || error.getMessage() == null) {
return;
}
cc.c.d().t("playback_errors", cc.b.B0().o(error.getCode().toString(), error.getMessage()));
cc.b.B0().h0(null).putAll(cc.b.B0().p((error.getDetails() == null || error.getDetails().getDescription() == null) ? "" : error.getDetails().getDescription(), error.getMessage()));
}
}
class n0 implements MediaCatalogManager.MediaCatalogCallback<ContentPage> {
final long a;
final oc.f b;
n0(long j, oc.f fVar) {
this.a = j;
this.b = fVar;
}
@Override
public void onSuccess(ContentPage contentPage) {
i iVar = i.this;
iVar.c4(contentPage, this.a, iVar.H);
this.b.C(contentPage);
}
@Override
public void onFailure(Error error) {
if (i.this.getActivity() != null && !i.this.getActivity().isFinishing()) {
i.this.b4(error.getMessage());
}
if (error != null && error.getCode() != null && error.getMessage() != null) {
cc.c.d().t("playback_errors", cc.b.B0().o(error.getCode().toString(), error.getMessage()));
cc.b.B0().h0(null).putAll(cc.b.B0().p((error.getDetails() == null || error.getDetails().getDescription() == null) ? "" : error.getDetails().getDescription(), error.getMessage()));
}
oc.f fVar = this.b;
if (fVar != null) {
fVar.C(null);
}
}
}
class o implements MediaCatalogManager.MediaCatalogCallback<com.google.gson.k> {
final String a;
o(String str) {
this.a = str;
}
@Override
public void onSuccess(com.google.gson.k kVar) {
hd.h.b("klickAnalyticsUrl", " jsonObject: " + kVar);
if (this.a.equalsIgnoreCase("video_impression")) {
i.this.F2 = true;
}
if (this.a.equalsIgnoreCase("video_view")) {
i.this.E2 = true;
}
}
@Override
public void onFailure(Error error) {
if (error == null || error.getMessage() == null) {
return;
}
hd.h.b("klickAnalyticsUrl", " error: " + error.getMessage());
if (error.getCode() == null || error.getMessage() == null) {
return;
}
cc.c.d().t("playback_errors", cc.b.B0().o(error.getCode().toString(), error.getMessage()));
cc.b.B0().h0(null).putAll(cc.b.B0().p((error.getDetails() == null || error.getDetails().getDescription() == null) ? "" : error.getDetails().getDescription(), error.getMessage()));
}
}
class o0 implements MediaCatalogManager.MediaCatalogCallback<StreamResponse> {
o0() {
}
@Override
public void onSuccess(StreamResponse streamResponse) {
}
@Override
public void onFailure(Error error) {
}
}
class p implements Runnable {
final boolean a;
p(boolean z) {
this.a = z;
}
@Override
public void run() {
i.this.D2();
int i = i.this.getActivity() != null ? i.this.getActivity().getResources().getConfiguration().orientation : 1;
hd.h.b("TAG", "orientdd : " + i);
if (i == 1) {
i.this.X2.setVisibility(8);
i.this.f3.setVisibility(8);
i.this.u3.setVisibility(8);
LinearLayout linearLayout = i.this.N;
if (linearLayout != null && linearLayout.getVisibility() == 0) {
i.this.N.setVisibility(8);
i.this.b4.setVisibility(8);
}
RelativeLayout relativeLayout = i.this.k4;
if (relativeLayout != null) {
relativeLayout.setVisibility(8);
}
List<Card> list = i.this.p2;
if (list != null && list.size() > 0) {
i.this.m3.setVisibility(8);
hd.h.b("orientation ", "recommend");
}
if (i.this.t0 != null) {
i.this.t0.F(false);
}
tc.j jVar = i.this.D0;
if (jVar != null) {
jVar.p0.setVisibility(8);
i.this.D0.q0.setVisibility(8);
i.this.D0.p0(false);
return;
}
return;
}
i iVar = i.this;
iVar.X2.setVisibility(iVar.e4 ? 0 : 8);
i.this.f3.setVisibility(0);
RelativeLayout relativeLayout2 = i.this.k4;
if (relativeLayout2 != null) {
relativeLayout2.setVisibility(0);
}
List<Card> list2 = i.this.p2;
if (list2 != null && list2.size() > 0) {
i.this.m3.setVisibility(0);
hd.h.b("orientation ", "recommend");
}
if (i.this.t0 != null) {
i.this.t0.F(true);
}
tc.j jVar2 = i.this.D0;
if (jVar2 != null) {
RelativeLayout relativeLayout3 = jVar2.d0;
if (relativeLayout3 != null) {
relativeLayout3.setVisibility(8);
}
i.this.D0.p0(this.a);
i iVar2 = i.this;
if (iVar2.n1) {
iVar2.D0.F = false;
}
}
}
}
class p0 implements MediaCatalogManager.MediaCatalogCallback<Section.SectionData> {
p0() {
}
@Override
public void onSuccess(Section.SectionData sectionData) {
if (i.this.getActivity() == null || i.this.getActivity().isFinishing()) {
return;
}
i.this.V3.setEnabled(true);
if (sectionData == null || sectionData.getCards() == null || sectionData.getCards().size() <= 0) {
i iVar = i.this;
iVar.d1 = null;
iVar.G3 = false;
} else {
i iVar2 = i.this;
iVar2.G3 = true;
iVar2.d1 = sectionData;
com.bumptech.glide.b.v(iVar2.getActivity()).u(hd.a.a.f(OTTApplication.o()).getImageAbsolutePath(((Card) i.this.d1.getCards().get(0)).getDisplay().getImageUrl())).j(2131231139).F0(i.this.C3);
Section.SectionData sectionData2 = i.this.d1;
if (sectionData2 == null || sectionData2.getCards() == null || i.this.d1.getCards().get(0) == null || ((Card) i.this.d1.getCards().get(0)).getDisplay() == null || ((Card) i.this.d1.getCards().get(0)).getDisplay().getTitle() == null || ((Card) i.this.d1.getCards().get(0)).getDisplay().getTitle().trim().length() <= 0) {
Section.SectionData sectionData3 = i.this.d1;
if (sectionData3 != null && sectionData3.getCards() != null && i.this.d1.getCards().get(0) != null && ((Card) i.this.d1.getCards().get(0)).getDisplay() != null && ((Card) i.this.d1.getCards().get(0)).getDisplay().getSubtitle1() != null && ((Card) i.this.d1.getCards().get(0)).getDisplay().getSubtitle1().trim().length() > 0) {
i iVar3 = i.this;
iVar3.w3.setText(((Card) iVar3.d1.getCards().get(0)).getDisplay().getSubtitle1());
}
} else {
i iVar4 = i.this;
iVar4.w3.setText(((Card) iVar4.d1.getCards().get(0)).getDisplay().getTitle());
}
PageInfo pageInfo = i.this.o3.getPageInfo();
if (pageInfo == null || pageInfo.getAttributes() == null || pageInfo.getAttributes().getRecommendationText() == null) {
i iVar5 = i.this;
iVar5.A3.setText(iVar5.getActivity().getResources().getString(2131951826));
} else {
i.this.A3.setText(pageInfo.getAttributes().getRecommendationText());
}
}
i iVar6 = i.this;
if (iVar6.d1 == null || iVar6.n1) {
iVar6.V3.setVisibility(8);
return;
}
PageInfo pageInfo2 = iVar6.o3.getPageInfo();
if (!((pageInfo2 == null || pageInfo2.getAttributes() == null || pageInfo2.getAttributes().getShowNextButton() == null) ? "true" : pageInfo2.getAttributes().getShowNextButton()).equals("true")) {
i.this.V3.setVisibility(8);
return;
}
if (pageInfo2.getAttributes().getNextButtonTitle() == null || pageInfo2.getAttributes().getNextButtonTitle().trim().length() <= 0) {
i.this.V3.setVisibility(8);
return;
}
i.this.V3.setVisibility(0);
i iVar7 = i.this;
iVar7.V3.setText(iVar7.o3.getPageInfo().getAttributes().getNextButtonTitle());
}
@Override
public void onFailure(Error error) {
if (i.this.getActivity() == null || i.this.getActivity().isFinishing()) {
return;
}
i.this.V3.setEnabled(true);
if (error != null && error.getCode() != null && error.getMessage() != null) {
cc.c.d().t("playback_errors", cc.b.B0().o(error.getCode().toString(), error.getMessage()));
cc.b.B0().h0(null).putAll(cc.b.B0().p((error.getDetails() == null || error.getDetails().getDescription() == null) ? "" : error.getDetails().getDescription(), error.getMessage()));
}
i iVar = i.this;
iVar.d1 = null;
iVar.G3 = false;
}
}
class q implements Runnable {
q() {
}
@Override
public void run() {
if (i.this.K4 != 1) {
i.this.u3(ConcurrentStreamStatus.POLL);
} else {
i.this.u3(ConcurrentStreamStatus.START);
i.this.K4 = 2;
}
}
}
class q0 implements Runnable {
final String a;
q0(String str) {
this.a = str;
}
@Override
public void run() {
i.this.y0.putString("playerurl", i.this.P0);
if (i.this.getActivity() != null) {
i.this.p0 = true;
i iVar = i.this;
iVar.L2(iVar.y0);
i iVar2 = i.this;
ContentPage contentPage = iVar2.o3;
if (contentPage != null) {
iVar2.V1(contentPage.getPageData());
}
i.this.X3(false);
String str = this.a;
if (str != null) {
i iVar3 = i.this;
iVar3.d1 = null;
iVar3.g2(str);
}
}
}
}
class r implements View.OnClickListener {
r() {
}
@Override
public void onClick(View view) {
List cards;
i.this.w4(false);
i.this.J1();
i.this.F0 = -1;
if (i.this.getActivity() == null || i.this.getActivity().isFinishing()) {
return;
}
new ArrayList();
Section.SectionData sectionData = i.this.d1;
if (sectionData == null || (cards = sectionData.getCards()) == null || i.this.d1.getCards().size() <= 0) {
i.this.X3(true);
} else {
hd.u.t0(i.this.getActivity(), ((Card) cards.get(0)).getTarget().getPath());
}
}
}
class r0 implements CastStateListener {
class a implements Runnable {
a() {
}
@Override
public void run() {
i.this.f3();
i.this.l3();
i.this.X2();
i.this.F = false;
i.this.G = true;
}
}
r0() {
}
public void onCastStateChanged(int i) {
if (i.this.v1 == null || !i.this.isAdded()) {
return;
}
if (i.this.v1.getCastState() == 4) {
String str = i.this.P0;
if (str == null || str.length() <= 0 || !i.this.isVisible()) {
return;
}
i.this.m4(false);
new Handler().post(new a());
return;
}
if (i.this.v1.getCastState() == 2 && i.this.isVisible()) {
i.this.u1.setRemoteIndicatorDrawable(i.this.getResources().getDrawable(2131232444));
i.this.p0 = true;
if (i.this.Y1 || i.this.Z1) {
i.this.m4(false);
return;
} else {
i.this.m4(true);
return;
}
}
if (i.this.v1.getCastState() == 3) {
i.this.m4(false);
OttLog.error("connecting state", "+++++++++++" + i.this.getActivity().p.mState);
if (i.this.getActivity().p.mState == 2) {
i.this.getActivity().s();
i.this.getActivity().K4(true);
} else if (i.this.getActivity().p.mState == 0) {
i.this.getActivity().s();
i.this.getActivity().K4(false);
} else {
i.this.V3();
}
i.this.u1.setRemoteIndicatorDrawable(i.this.getResources().getDrawable(2131232287));
}
}
}
class s implements UserManager.UserCallback<String> {
s() {
}
@Override
public void onSuccess(String str) {
hd.h.b("service/api/v1/stream/poll ", "onSuccess");
if (i.this.n2.getPollIntervalInMillis().intValue() > 0) {
i.this.o2.removeCallbacks(i.this.L4);
i.this.o2.postDelayed(i.this.L4, i.this.n2.getPollIntervalInMillis().intValue());
}
}
@Override
public void onFailure(Error error) {
hd.h.b("service/api/v1/stream/poll ", "onFailure");
OttLog.error("poll error", "++++++" + error.toString());
if (error.getCode() != null && error.getMessage() != null) {
cc.c.d().t("playback_errors", cc.b.B0().o(error.getCode().toString(), error.getMessage()));
cc.b.B0().h0(null).putAll(cc.b.B0().p((error.getDetails() == null || error.getDetails().getDescription() == null) ? "" : error.getDetails().getDescription(), error.getMessage()));
}
if (i.this.v1 != null && i.this.v1.getCastState() == 4) {
hd.b.j(i.this.v1.getSessionManager().getCurrentCastSession());
i.this.o3();
}
if (i.this.getActivity() == null || !i.this.isAdded() || i.this.n2 == null) {
return;
}
i.this.K4 = 1;
HashMap hashMap = new HashMap();
hashMap.put(hd.e.f, error.getMessage());
if (error.getDetails() != null) {
hashMap.put(hd.e.i, error.getDetails().getDescription());
} else {
hashMap.put(hd.e.i, "");
}
int intValue = error.getCode().intValue();
if (intValue == -4402) {
i.this.g4();
hashMap.put(hd.e.m, i.this.getString(2131951868));
i iVar = i.this;
iVar.P3(hashMap, "", iVar.n2.getStreamPollKey());
i.this.n2 = null;
return;
}
if (intValue == -4401) {
i.this.g4();
hashMap.put(hd.e.m, i.this.getString(2131951868));
hashMap.put(hd.e.k, i.this.getString(2131952943));
i iVar2 = i.this;
iVar2.P3(hashMap, hd.r.j0, iVar2.n2.getStreamPollKey());
i.this.n2 = null;
return;
}
if (intValue == -4001) {
i.this.g4();
hashMap.put(hd.e.l, i.this.getString(2131952964));
i iVar3 = i.this;
iVar3.P3(hashMap, "", iVar3.n2.getStreamPollKey());
i.this.n2 = null;
return;
}
if (intValue != -4000) {
if (i.this.n2.getPollIntervalInMillis().intValue() > 0) {
i.this.o2.removeCallbacks(i.this.L4);
i.this.o2.postDelayed(i.this.L4, i.this.n2.getPollIntervalInMillis().intValue());
return;
}
return;
}
i.this.g4();
hashMap.put(hd.e.l, i.this.getResources().getString(2131952964));
hashMap.put(hd.e.k, i.this.getResources().getString(2131952943));
i iVar4 = i.this;
iVar4.P3(hashMap, hd.r.j0, iVar4.n2.getStreamPollKey());
i.this.n2 = null;
}
}
class s0 implements Runnable {
s0() {
}
@Override
public void run() {
ExoPlayer exoPlayer = i.this.g0;
if (exoPlayer != null && (exoPlayer.isPlayingAd() || i.this.D1)) {
try {
i.this.e0.getOverlayFrameLayout().setVisibility(0);
} catch (Exception e) {
e.getMessage();
}
}
if (i.this.v1 == null || i.this.v1.getCastState() != 4) {
return;
}
try {
if (i.this.w1 != null && i.this.w1.K() != null) {
i.this.w1.K().setVisibility(0);
}
i.this.f4();
i.this.u1.setRemoteIndicatorDrawable(i.this.getResources().getDrawable(2131232287));
} catch (Exception unused) {
}
}
}
class t implements View.OnClickListener {
class a implements Runnable {
a() {
}
@Override
public void run() {
i.this.getActivity().p.slideHorizontal(true);
}
}
t() {
}
@Override
public void onClick(View view) {
Dialog dialog = i.this.G4;
if (dialog != null) {
dialog.dismiss();
}
i.this.a();
new Handler().postDelayed(new a(), 50L);
}
}
class t0 implements vc.d {
t0() {
}
@Override
public void a() {
}
}
class u implements oc.h {
final String a;
final String c;
class a implements PaymentManager.PaymentCallback<List<ActivePackagesResponse>> {
final String a;
final String b;
a(String str, String str2) {
this.a = str;
this.b = str2;
}
@Override
public void onSuccess(List<ActivePackagesResponse> list) {
int size = list.size();
if (size <= 0) {
hd.u.M(i.this.getActivity(), ScreenType.PAYMENTS, hd.r.g1, 9, "", "");
return;
}
for (int i = 0; i < size; i++) {
if (list.get(i).getGateway().equalsIgnoreCase("rokuinapp")) {
if (u.this.a.equalsIgnoreCase(hd.r.j0)) {
i iVar = i.this;
iVar.R3(iVar.getString(2131952259), this.a.trim().length() > 0 ? this.a : i.this.getString(2131952258));
} else {
i iVar2 = i.this;
iVar2.R3(iVar2.getString(2131952256), i.this.getString(2131952255));
}
} else if (!list.get(i).getGateway().equalsIgnoreCase("amazoninapp")) {
i.this.f2 = true;
hd.u.M(i.this.getActivity(), ScreenType.PAYMENTS, hd.r.g1, 9, hd.r.j0, "");
} else if (u.this.a.equalsIgnoreCase(hd.r.j0)) {
i iVar3 = i.this;
iVar3.R3(iVar3.getString(2131952259), this.b.trim().length() > 0 ? this.b : i.this.getString(2131952257));
} else {
i iVar4 = i.this;
iVar4.R3(iVar4.getString(2131952256), i.this.getString(2131952254));
}
}
}
@Override
public void onFailure(Error error) {
i.this.f2 = true;
hd.u.M(i.this.getActivity(), ScreenType.PAYMENTS, hd.r.g1, 9, "", "");
}
}
class b implements Runnable {
b() {
}
@Override
public void run() {
if (i.this.getActivity().p != null) {
i.this.getActivity().p.mState = 2;
i.this.getActivity().p.slideHorizontal(true);
}
}
}
u(String str, String str2) {
this.a = str;
this.c = str2;
}
@Override
public void o(boolean z, int i, HashMap hashMap) {
a.C0133a c0133a = hd.a.a;
Configs c = c0133a.c(OTTApplication.o());
String rokuPaymentUpgradeMessage = c.getRokuPaymentUpgradeMessage();
String amazonPaymentUpgradeMessage = c.getAmazonPaymentUpgradeMessage();
if (i == 0) {
c0133a.b(OTTApplication.o()).getPaymentManager().getActivePackages(new a(rokuPaymentUpgradeMessage, amazonPaymentUpgradeMessage));
return;
}
if (i == 1) {
i.this.f2 = true;
hd.u.L(i.this.getActivity(), ListType.ACTIVE_SCREEN, null, hd.r.g1, 9, this.c);
} else if (i == 2) {
i.this.a();
new Handler().postDelayed(new b(), 500L);
}
}
@Override
public void y(boolean z, int i, int i2) {
}
}
class u0 implements View.OnClickListener {
u0() {
}
@Override
public void onClick(View view) {
if (i.this.i0 == null) {
return;
}
i.this.n4(cc.d.X);
if (i.this.h0 != null) {
i iVar = i.this;
if (iVar.p1) {
try {
if (iVar.h0.getCurrentMappedTrackInfo() != null) {
i.this.i0.r(i.this.f1);
i.this.i0.q(i.this.g1);
return;
}
return;
} catch (Exception unused) {
return;
}
}
if (iVar.k0) {
hd.a0.y(iVar.getActivity()).a("enableCC", false);
i.this.i0.j();
i iVar2 = i.this;
iVar2.k0 = false;
tc.j jVar = iVar2.D0;
if (jVar != null) {
jVar.U0(cc.c.s0, cc.c.q1);
}
i iVar3 = i.this;
iVar3.Z2.setImageDrawable(iVar3.getResources().getDrawable(2131231903));
return;
}
iVar.i0.r(i.this.f1);
i.this.i0.q(i.this.g1);
if (i.this.i0.k(i.this.h0.getCurrentMappedTrackInfo())) {
hd.a0.y(i.this.getActivity()).a("enableCC", true);
i iVar4 = i.this;
iVar4.k0 = true;
tc.j jVar2 = iVar4.D0;
if (jVar2 != null) {
jVar2.U0(cc.c.s0, cc.c.p1);
}
i iVar5 = i.this;
iVar5.Z2.setImageDrawable(iVar5.getResources().getDrawable(2131231904));
tc.k kVar = i.this.i0;
androidx.fragment.app.h activity = i.this.getActivity();
i iVar6 = i.this;
kVar.u(activity, iVar6, "text", iVar6.h0, 2, true);
}
}
}
}
class v implements UserManager.UserCallback<String> {
final boolean a;
v(boolean z) {
this.a = z;
}
@Override
public void onSuccess(String str) {
if (i.this.getActivity() == null) {
return;
}
i.this.o3.getPageButtons().setIsFavourite(Boolean.valueOf(!this.a));
i.this.t4();
i iVar = i.this;
iVar.o4(cc.c.x0, 0, iVar.o3);
}
@Override
public void onFailure(Error error) {
if (i.this.getActivity() == null) {
return;
}
i.this.b4(error.getMessage());
}
}
class v0 implements MediaCatalogManager.MediaCatalogCallback<ContentPage> {
v0() {
}
@Override
public void onSuccess(ContentPage contentPage) {
i.this.getActivity().s4(ButtonType.NONE);
i.this.getActivity().H2(contentPage);
}
@Override
public void onFailure(Error error) {
if (i.this.getActivity() != null && !i.this.getActivity().isFinishing()) {
i.this.b4(error.getMessage());
}
if (error == null || error.getCode() == null || error.getMessage() == null) {
return;
}
cc.c.d().t("playback_errors", cc.b.B0().o(error.getCode().toString(), error.getMessage()));
cc.b.B0().h0(null).putAll(cc.b.B0().p((error.getDetails() == null || error.getDetails().getDescription() == null) ? "" : error.getDetails().getDescription(), error.getMessage()));
}
}
class w implements UserManager.UserCallback<String> {
final boolean a;
w(boolean z) {
this.a = z;
}
@Override
public void onSuccess(String str) {
if (i.this.getActivity() == null) {
return;
}
i.this.o3.getPageButtons().setIsFavourite(Boolean.valueOf(!this.a));
i.this.t4();
i iVar = i.this;
iVar.o4(cc.c.x0, 1, iVar.o3);
}
@Override
public void onFailure(Error error) {
if (i.this.getActivity() == null) {
return;
}
hd.h.b("Content not available", error.getMessage());
i.this.b4(error.getMessage());
}
}
class w0 extends e3.b {
w0(ImageView imageView) {
super(imageView);
}
public void p(Bitmap bitmap) {
if (i.this.getActivity() != null) {
Drawable a = androidx.core.graphics.drawable.d.a(i.this.getActivity().getResources(), bitmap);
a.e(true);
i.this.m4.setImageDrawable(a);
}
}
}
class x implements Runnable {
x() {
}
@Override
public void run() {
i.this.L1();
if (i.this.N4 != null) {
i.this.A4();
i.this.N4.removeCallbacks(i.this.O4);
i.this.N4.postDelayed(i.this.O4, 1000L);
}
}
}
class x0 implements oc.h {
final long a;
final boolean c;
x0(long j, boolean z) {
this.a = j;
this.c = z;
}
@Override
public void o(boolean z, int i, HashMap hashMap) {
ExoPlayer exoPlayer;
ExoPlayer exoPlayer2;
if (i != 1) {
if (i == 0 && this.c && (exoPlayer = i.this.g0) != null) {
exoPlayer.setPlayWhenReady(true);
return;
}
return;
}
i iVar = i.this;
if (iVar.H == ButtonType.START_OVER && iVar.g0 == null) {
iVar.K(Long.valueOf(this.a), i.this.o3.getPageInfo().getPath());
return;
}
tc.j jVar = iVar.D0;
if (jVar.L0) {
jVar.v0(this.a);
i.this.D0.L0();
i.this.D0.a1();
if (!this.c || (exoPlayer2 = i.this.g0) == null) {
return;
}
exoPlayer2.setPlayWhenReady(true);
}
}
@Override
public void y(boolean z, int i, int i2) {
}
}
class y extends CountDownTimer {
y(long j, long j2) {
super(j, j2);
}
@Override
public void onFinish() {
i iVar = i.this;
iVar.W3.setText(iVar.J3);
i iVar2 = i.this;
iVar2.W3.setBackground(iVar2.getResources().getDrawable(2131230831));
}
@Override
public void onTick(long j) {
Object obj;
Object obj2;
int i = (int) (j / 60000);
int i2 = ((int) (j % 60000)) / 1000;
if (i > 9) {
AppCompatButton appCompatButton = i.this.W3;
StringBuilder sb2 = new StringBuilder();
sb2.append("Test will be enabled in ");
sb2.append(i);
sb2.append(":");
if (i2 > 9) {
obj2 = Integer.valueOf(i2);
} else {
obj2 = "0" + i2;
}
sb2.append(obj2);
appCompatButton.setText(sb2.toString());
return;
}
AppCompatButton appCompatButton2 = i.this.W3;
StringBuilder sb3 = new StringBuilder();
sb3.append("Test will be enabled in 0");
sb3.append(i);
sb3.append(":");
if (i2 > 9) {
obj = Integer.valueOf(i2);
} else {
obj = "0" + i2;
}
sb3.append(obj);
appCompatButton2.setText(sb3.toString());
}
}
class y0 implements DownloadImageAndVttFile.e {
class a implements Runnable {
a() {
}
@Override
public void run() {
hd.h.b(i.b5, "$$$$$ ParsingDownloadComplete");
i.this.D = true;
i iVar = i.this;
if (iVar.g0 != null) {
iVar.E3(iVar.D);
}
}
}
y0() {
}
@Override
public void a() {
hd.h.b(i.b5, "$$$$$ OnParseFailed");
i.this.D = false;
i iVar = i.this;
if (iVar.g0 == null || iVar.D0 == null) {
return;
}
hd.a0.y(iVar.getActivity()).S(false);
i.this.D0.y0(false);
}
@Override
public void b(fd.f fVar) {
new Handler(Looper.getMainLooper()).post(new a());
}
@Override
public void c() {
i.this.D = false;
hd.h.b(i.b5, "$$$$$ OnDownloadFailed");
i iVar = i.this;
if (iVar.g0 == null || iVar.D0 == null) {
return;
}
hd.a0.y(iVar.getActivity()).S(false);
i.this.D0.y0(false);
}
@Override
public void d(DownloadImageAndVttFile.STATE_OF_DOWNLOAD state_of_download) {
hd.h.b(i.b5, "$$$$$ OnDownloadProgress");
}
@Override
public void e(boolean z) {
hd.h.b(i.b5, "$$$$$ OnDownloadSuccess");
}
@Override
public void f(fd.f fVar, boolean z) {
hd.h.b(i.b5, "$$$$$ OnParseComplete - showPreviewBar" + z);
i.this.D = z;
i iVar = i.this;
if (iVar.g0 == null || iVar.D0 == null) {
return;
}
hd.a0.y(iVar.getActivity()).S(z);
i.this.D0.A0(fVar);
i.this.D0.y0(z);
}
}
class z implements MediaCatalogManager.MediaCatalogCallback<ContentPage> {
z() {
}
@Override
public void onSuccess(ContentPage contentPage) {
i.this.W4 = "";
if (contentPage != null) {
i.this.u4(contentPage);
if (i.this.getActivity() != null && i.this.getActivity() != null) {
i.this.getActivity().l5(contentPage);
}
i.this.M4 = contentPage.getPageInfo();
i.this.o3 = contentPage;
PageInfo.Attributes attributes = contentPage.getPageInfo().getAttributes();
if (attributes != null) {
String endTime = attributes.getEndTime();
if (endTime != null && !endTime.equalsIgnoreCase("")) {
i.this.F3(Long.parseLong(endTime));
}
String startTime = attributes.getStartTime();
if (startTime == null || startTime.equalsIgnoreCase("")) {
return;
}
i.this.G3(Long.parseLong(startTime));
}
}
}
@Override
public void onFailure(Error error) {
if (error == null || error.getCode() == null || error.getMessage() == null) {
return;
}
cc.c.d().t("playback_errors", cc.b.B0().o(error.getCode().toString(), error.getMessage()));
cc.b.B0().h0(null).putAll(cc.b.B0().p((error.getDetails() == null || error.getDetails().getDescription() == null) ? "" : error.getDetails().getDescription(), error.getMessage()));
}
}
static class z0 {
static final int[] a;
static {
int[] iArr = new int[AdEvent.AdEventType.values().length];
a = iArr;
try {
iArr[AdEvent.AdEventType.LOADED.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[AdEvent.AdEventType.STARTED.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[AdEvent.AdEventType.PAUSED.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[AdEvent.AdEventType.RESUMED.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[AdEvent.AdEventType.COMPLETED.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[AdEvent.AdEventType.SKIPPED.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
a[AdEvent.AdEventType.TAPPED.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
a[AdEvent.AdEventType.ALL_ADS_COMPLETED.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
a[AdEvent.AdEventType.AD_BREAK_FETCH_ERROR.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
}
}
static {
CookieManager cookieManager = new CookieManager();
j5 = cookieManager;
cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ORIGINAL_SERVER);
}
private void A2(String str) {
String str2;
String str3;
String str4;
String str5;
if (str == null || str.trim().length() == 0) {
return;
}
if (str.equalsIgnoreCase("video_impression")) {
this.F2 = true;
}
if (str.equalsIgnoreCase("video_view")) {
this.E2 = true;
}
a.C0133a c0133a = hd.a.a;
if (c0133a.c(OTTApplication.o()) != null) {
Configs c2 = c0133a.c(OTTApplication.o());
if (c2 != null && c2.getKlikkVideoAnalyticsUrl() != null && c2.getKlikkVideoAnalyticsUrl().trim().length() > 0 && !c2.getKlikkVideoAnalyticsUrl().trim().equalsIgnoreCase("")) {
this.C2 = c2.getKlikkVideoAnalyticsUrl();
}
if (str.trim().length() <= 0 || (str2 = this.A2) == null || str2.trim().length() <= 0 || (str3 = this.B2) == null || str3.trim().length() <= 0 || (str4 = this.C2) == null || str4.trim().length() <= 0) {
return;
}
if (this.C2.contains("{{event}}")) {
this.C2 = this.C2.replace("{{event}}", str);
}
if (this.C2.contains("{{uuid}}") && (str5 = this.D2) != null && str5.trim().length() > 0) {
this.C2 = this.C2.replace("{{uuid}}", this.D2);
}
if (this.C2.contains("{{deviceOS}}")) {
this.C2 = this.C2.replace("{{deviceOS}}", "android");
}
if (this.C2.contains("{{assetId}}")) {
this.C2 = this.C2.replace("{{assetId}}", this.A2);
}
if (this.C2.contains("{{epochTime}}")) {
this.C2 = this.C2.replace("{{epochTime}}", String.valueOf(System.currentTimeMillis()));
}
if (this.C2.contains("{{deviceType}}")) {
this.C2 = this.C2.replace("{{deviceType}}", "mobile");
}
hd.h.b("klickAnalyticsUrl", " url: " + this.C2);
c0133a.f(OTTApplication.o()).sendKlikkCPStreamEvents(this.C2, new o(str));
}
}
private void B4() {
ExoPlayer exoPlayer = this.g0;
if (exoPlayer != null) {
this.q0 = exoPlayer.getCurrentWindowIndex();
this.r0 = this.g0.isCurrentWindowSeekable() ? Math.max(0L, this.g0.getCurrentPosition()) : -9223372036854775807L;
}
}
public void C3(float f2) {
if (this.g0 != null) {
PlaybackParameters playbackParameters = new PlaybackParameters(f2);
this.c = playbackParameters;
this.g0.setPlaybackParameters(playbackParameters);
}
}
private void C4() {
DefaultTrackSelector defaultTrackSelector = this.h0;
if (defaultTrackSelector == null || defaultTrackSelector.getCurrentMappedTrackInfo() == null || getActivity() == null) {
return;
}
MappingTrackSelector.MappedTrackInfo currentMappedTrackInfo = this.h0.getCurrentMappedTrackInfo();
if (currentMappedTrackInfo != null && this.a3 != null && (currentMappedTrackInfo.getTrackGroups(1).length > 1 || currentMappedTrackInfo.getTrackGroups(2).length > 0)) {
this.a3.setImageDrawable(getActivity().getResources().getDrawable(2131232577));
this.a3.setEnabled(true);
} else {
int dimension = (int) getActivity().getResources().getDimension(2131166645);
this.a3.setPadding(dimension, dimension, dimension, dimension);
this.a3.setImageDrawable(getActivity().getResources().getDrawable(2131232576));
this.a3.setEnabled(false);
}
}
public void D3(View view) {
if (getActivity() == null || !isAdded()) {
return;
}
getActivity().runOnUiThread(new l(view));
}
public void E4() {
for (int i = 0; i < this.d.length; i++) {
if (i == this.f) {
this.g[i].setChecked(true);
this.g[i].setBackgroundColor(this.J.getResources().getColor(2131099940));
this.g[i].setCheckMarkDrawable(2131232229);
this.g[i].setTextColor(getResources().getColor(2131100398));
} else {
this.g[i].setBackgroundColor(this.J.getResources().getColor(2131099940));
this.g[i].setChecked(false);
this.g[i].setCheckMarkDrawable(2131230860);
this.g[i].setTextColor(getResources().getColor(2131100494));
}
}
}
private DataSource.Factory F1(boolean z2) {
String str;
String str2 = this.S0;
return (str2 == null || str2.trim().length() <= 0 || (str = this.R0) == null || str.trim().length() <= 0) ? ((OTTApplication) getActivity().getApplication()).g() : ((OTTApplication) getActivity().getApplication()).i(this.S0, this.R0);
}
private void F4() {
if (this.J2 > 0) {
this.K2 += System.currentTimeMillis() - this.J2;
this.J2 = 0L;
}
}
private HttpDataSource.Factory G1(boolean z2) {
return ((OTTApplication) getActivity().getApplication()).k(z2 ? i5 : null);
}
private View H1(LayoutInflater layoutInflater, Context context) {
View inflate = layoutInflater.inflate(2131624370, (ViewGroup) null);
ViewGroup viewGroup = (ViewGroup) inflate.findViewById(2131429387);
ImageView imageView = (ImageView) inflate.findViewById(2131427788);
Typeface g2 = androidx.core.content.res.h.g(this.J, 2131296261);
RelativeLayout relativeLayout = (RelativeLayout) inflate.findViewById(2131429778);
this.i = (int) context.getResources().getDimension(2131167364);
if (com.yupptv.ott.a.Q) {
relativeLayout.setBackground(requireActivity().getResources().getDrawable(2131231131));
imageView.setVisibility(0);
}
this.g = new CheckedTextView[this.d.length];
for (int i = 0; i < this.d.length; i++) {
CheckedTextView checkedTextView = (CheckedTextView) layoutInflater.inflate(R.layout.simple_list_item_single_choice, viewGroup, false);
int i2 = this.i;
checkedTextView.setPadding(i2, 0, i2, 0);
checkedTextView.setText(this.d[i]);
checkedTextView.setTextColor(this.J.getResources().getColor(2131100091));
checkedTextView.setTypeface(g2);
checkedTextView.setTextSize(0, this.J.getResources().getDimension(2131167522));
checkedTextView.setFocusable(true);
checkedTextView.setTag(Integer.valueOf(i));
checkedTextView.setOnClickListener(new j());
this.g[i] = checkedTextView;
viewGroup.addView(checkedTextView);
}
if (imageView != null) {
imageView.setOnClickListener(new tc.d(this));
}
E4();
return inflate;
}
private void J2() {
if (getContext() == null || this.Z0 == null || !com.yupptv.ott.a.p) {
return;
}
String str = "";
if (OttSDK.getInstance() != null && OttSDK.getInstance().getPreferenceManager() != null) {
PreferenceManager preferenceManager = OttSDK.getInstance().getPreferenceManager();
if (preferenceManager.getSessionId() != null) {
str = preferenceManager.getSessionId();
}
}
this.Z0.n(getContext(), str, true);
}
public void K(Long l2, String str) {
ButtonType buttonType;
if (l2.longValue() > 0 || ((buttonType = this.H) != null && (buttonType == ButtonType.RESUME || buttonType == ButtonType.START_OVER))) {
this.x0 = l2.longValue();
}
this.v0 = true;
D4(true);
this.M.post(new q0(str));
}
private void K2() {
if (this.X0 == null && com.yupptv.ott.a.o) {
this.X0 = new hd.w(getActivity());
}
if (this.Z0 == null && com.yupptv.ott.a.p) {
this.Z0 = yc.a.c(getActivity());
}
}
public void L2(Bundle bundle) {
tc.j jVar;
tc.j jVar2;
int i;
int i2;
cc.b.B0().C1("Video Player");
this.t = false;
if (bundle == null) {
return;
}
CastContext castContext = this.v1;
if (castContext != null) {
castContext.addCastStateListener(this.B1);
}
C2();
a.C0133a c0133a = hd.a.a;
PreferenceManager g2 = c0133a.g(OTTApplication.o());
if (this.g0 == null) {
AdaptiveTrackSelection.Factory factory = new AdaptiveTrackSelection.Factory();
e5 = bundle.getBoolean("prefer_extension_decoders", false);
this.j0 = new DefaultRenderersFactory(getActivity()).setExtensionRendererMode((getActivity() == null || ((OTTApplication) getActivity().getApplication()) == null || !((OTTApplication) getActivity().getApplication()).Z()) ? 0 : e5 ? 2 : 1);
this.h0 = new DefaultTrackSelector(getContext(), factory);
this.i0 = new tc.k(getActivity(), this.h0, factory);
Configs c2 = c0133a.c(OTTApplication.o());
if (c2 != null && c2.getMaxBitRate() != null && c2.getMaxBitRate().trim().length() > 0) {
this.j1 = Integer.parseInt(c2.getMaxBitRate());
}
hd.h.b("bitrate ", "maxVideoBitrate :" + this.j1);
if (this.j1 > 0) {
DefaultTrackSelector defaultTrackSelector = this.h0;
defaultTrackSelector.setParameters(defaultTrackSelector.buildUponParameters().setMaxVideoBitrate(this.j1 * 1024));
}
this.z = "";
this.A = null;
this.y = hd.a0.y(getActivity()).x();
List<VideoQualitySetting> videoQualitySettings = g2.getVideoQualitySettings();
this.x = videoQualitySettings;
if (videoQualitySettings != null && c2.getEnableBitrateFeature() != null && c2.getEnableBitrateFeature().trim().equalsIgnoreCase("true")) {
tc.k kVar = this.i0;
if (kVar != null) {
kVar.y = true;
}
String str = this.y;
if (str != null && !str.equalsIgnoreCase("auto")) {
int size = this.x.size();
int i3 = 0;
while (true) {
if (i3 >= size) {
i = 0;
break;
} else if (this.y.equalsIgnoreCase(this.x.get(i3).getCode())) {
this.z = this.x.get(i3).getDisplayTitle();
this.A = this.x.get(i3);
i = this.x.get(i3).getMaxBitRate().intValue();
if (this.x.get(i3).getMinBitRate() != null) {
i2 = this.x.get(i3).getMinBitRate().intValue();
}
} else {
i3++;
}
}
i2 = 0;
if (i > 0) {
StringBuilder sb2 = new StringBuilder();
sb2.append("Selected Bitrate ");
int i4 = i * 1024;
sb2.append(i4);
hd.h.b("Video BitRate ", sb2.toString());
int i6 = i2 * 1024;
new DefaultTrackSelector.ParametersBuilder(getActivity()).setMaxVideoBitrate(i4).setMinVideoBitrate(i6).build();
if (i > 0) {
DefaultTrackSelector defaultTrackSelector2 = this.h0;
defaultTrackSelector2.setParameters(defaultTrackSelector2.buildUponParameters().setMaxVideoBitrate(i4).setMinVideoBitrate(i6));
}
}
}
}
this.A4 = false;
this.B4 = "";
StreamResponse streamResponse = this.V0;
if (streamResponse != null && streamResponse.getStreams() != null && this.V0.getStreams().size() > 0 && this.V0.getStreams().get(0) != null && ((Stream) this.V0.getStreams().get(0)).getParams() != null && ((Stream) this.V0.getStreams().get(0)).getParams().getSsaiEnabled() != null && ((Stream) this.V0.getStreams().get(0)).getParams().getSsaiEnabled().booleanValue() && !TextUtils.isEmpty(((Stream) this.V0.getStreams().get(0)).getParams().getDaiAssetKey())) {
this.A4 = true;
this.B4 = ((Stream) this.V0.getStreams().get(0)).getParams().getDaiAssetKey();
}
if (this.i0 != null) {
this.o0 = null;
}
this.Z = new tc.a(this.h0);
DefaultDrmSessionManagerProvider defaultDrmSessionManagerProvider = new DefaultDrmSessionManagerProvider();
defaultDrmSessionManagerProvider.setDrmHttpDataSourceFactory(G1(false));
DefaultMediaSourceFactory localAdInsertionComponents = new DefaultMediaSourceFactory(getActivity()).setDataSourceFactory(F1(true)).setDrmSessionManagerProvider(defaultDrmSessionManagerProvider).setLocalAdInsertionComponents(new tc.f(this), this.e0);
if (this.A4) {
ImaServerSideAdInsertionMediaSource.AdsLoader N1 = N1();
this.y4 = N1;
localAdInsertionComponents.setServerSideAdInsertionMediaSourceFactory(new ImaServerSideAdInsertionMediaSource.Factory(N1, localAdInsertionComponents));
}
this.g0 = new ExoPlayer.Builder(getContext(), this.j0).setTrackSelector(this.h0).setMediaSourceFactory(new DefaultMediaSourceFactory(B2())).setMediaSourceFactory(localAdInsertionComponents).build();
K2();
J2();
I2(this.g0, false);
this.O0 = cc.b.B0().r1();
this.g0.setHandleAudioBecomingNoisy(true);
this.g0.addListener(this);
this.g0.addListener(this.Z);
if (this.A4) {
this.y4.setPlayer(this.g0);
}
OttLog.error(b5, "Intialize bundle" + this.n1);
if (!this.n1) {
this.D0.V(false);
}
C3(Float.parseFloat(this.e[this.f]));
this.e0.setPlayer(this.g0);
this.D0.Y0(this.g0);
try {
hd.k0 k0Var = this.Y0;
if (k0Var != null && k0Var.g() != null && (jVar2 = this.D0) != null) {
jVar2.B0(this.Y0.g());
}
nd.a aVar = this.a1;
if (aVar != null && aVar.m() != null && (jVar = this.D0) != null) {
jVar.B0(this.a1.m());
}
} catch (NullPointerException unused) {
}
this.D0.n0(this);
this.D0.s0(this);
this.D0.r0(this);
if (this.v0) {
ButtonType buttonType = this.H;
if (buttonType != null && (buttonType == ButtonType.START_OVER || buttonType == ButtonType.RESUME)) {
tc.j jVar3 = this.D0;
if (jVar3 != null) {
jVar3.b1();
}
D4(true);
}
long j2 = this.x0;
if (j2 == -9223372036854775807L) {
this.g0.seekToDefaultPosition(this.w0);
} else {
ButtonType buttonType2 = this.H;
if (buttonType2 != null && buttonType2 == ButtonType.START_OVER) {
this.b2 = true;
}
if (this.a) {
this.a = false;
this.g0.seekTo(this.w0, 0L);
} else {
this.g0.seekTo(this.w0, j2);
}
}
}
this.g0.setPlayWhenReady(this.p0);
this.u0 = true;
}
if (this.u0) {
String string = bundle.getString("playerurl");
if (string == null) {
return;
}
Uri[] uriArr = {Uri.parse(string)};
this.B = uriArr;
if (this.A4) {
this.g0.setMediaItem(MediaItem.fromUri(new ImaServerSideAdInsertionUriBuilder().setAssetKey(this.B4).setFormat(Util.inferContentType(uriArr[0])).build()));
} else {
D1(this.y0);
this.g0.setMediaItems(this.w, false);
}
ExoPlayer exoPlayer = this.g0;
if (exoPlayer != null) {
exoPlayer.prepare();
}
this.u0 = false;
}
this.a3.setVisibility(0);
this.Z2.setVisibility(8);
K3();
tc.j jVar4 = this.D0;
if (jVar4 != null && jVar4.p != null) {
hd.h.b("TAG", "$$$$$ Exoplayer fragment &&&&setPreviewLoader :");
this.D0.p.setPreviewLoader(this);
this.D0.p.setPlayerView(this.g0);
}
if (g2 == null || g2.getLanguagesFilterList() == null || g2.getLanguagesFilterList().getFilterItems() == null) {
return;
}
this.k2 = g2.getLanguagesFilterList().getFilterItems();
}
public void L3() {
String str;
if (this.r3 != null) {
n4(cc.d.W);
Configs c2 = hd.a.a.c(OTTApplication.o());
str = "";
String siteURL = (c2 == null || c2.getSiteURL() == null) ? "" : c2.getSiteURL();
androidx.fragment.app.h activity = getActivity();
StringBuilder sb2 = new StringBuilder();
sb2.append(this.r3.getDescription());
sb2.append(" ");
if (siteURL.length() > 1) {
StringBuilder sb3 = new StringBuilder();
sb3.append(siteURL);
sb3.append(siteURL.endsWith("/") ? "" : "/");
sb3.append(this.o3.getPageInfo().getPath());
str = sb3.toString();
}
sb2.append(str);
hd.e0.o0(activity, null, sb2.toString());
}
}
private void M2() {
if (this.n2 != null) {
if (getActivity() != null && (getActivity() instanceof MainActivity)) {
getActivity().F4(this.n2.getStreamPollKey());
}
this.o2.removeCallbacks(this.L4);
this.o2.postDelayed(this.L4, this.n2.getPollIntervalInMillis().intValue());
}
}
private ImaServerSideAdInsertionMediaSource.AdsLoader N1() {
ImaServerSideAdInsertionMediaSource.AdsLoader.Builder builder = new ImaServerSideAdInsertionMediaSource.AdsLoader.Builder(this.J, this.e0);
ImaServerSideAdInsertionMediaSource.AdsLoader.State state = this.z4;
if (state != null) {
builder.setAdsLoaderState(state);
}
return builder.setAdEventListener(E1()).build();
}
private static boolean N2(ExoPlaybackException exoPlaybackException) {
if (exoPlaybackException.type != 0) {
return false;
}
for (Throwable sourceException = exoPlaybackException.getSourceException(); sourceException != null; sourceException = sourceException.getCause()) {
if (sourceException instanceof BehindLiveWindowException) {
return true;
}
}
return false;
}
private void N3() {
this.V = this.X.q();
if ((getActivity() != null) & isAdded()) {
this.V.s(R.anim.fade_in, R.anim.fade_out);
if (this.x1 == null) {
this.x1 = new vc.b();
}
this.x1.O(this.h1);
this.x1.P(this);
this.x1.N(this.A1);
if (!this.x1.isAdded()) {
this.x1.Q(new t0());
this.V.q(2131427767, this.x1);
this.V.j();
}
}
this.y1.setVisibility(0);
}
private JSONObject O1(PageInfo pageInfo, String str, boolean z2, String str2) {
JSONObject jSONObject = new JSONObject();
hd.p pVar = new hd.p();
try {
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("is_casting", String.valueOf(z2));
jSONObject2.put("include_ads", "true");
jSONObject2.put("pin", str2);
jSONObject2.put("network_type", "");
jSONObject.put("additional_data", jSONObject2);
jSONObject.put("aud_channel", new JSONArray((Collection) pVar.a()));
jSONObject.put("res", new JSONArray((Collection) pVar.g()));
jSONObject.put("vid_codec", new JSONArray((Collection) pVar.f()));
jSONObject.put("drm", new JSONArray((Collection) pVar.c()));
JSONObject jSONObject3 = new JSONObject();
JSONArray jSONArray = new JSONArray();
jSONArray.put(pVar.d());
jSONObject3.put("hdcp", jSONArray);
JSONArray jSONArray2 = new JSONArray();
jSONArray2.put(pVar.h());
jSONObject3.put("widevine_security_level", jSONArray2);
JSONArray jSONArray3 = new JSONArray();
jSONArray3.put(pVar.e());
jSONObject3.put("playready_security_level", jSONArray3);
JSONArray jSONArray4 = new JSONArray();
jSONArray4.put(pVar.b());
jSONObject3.put("clearkey_security_level", jSONArray4);
jSONObject.put("drm_params", jSONObject3);
JSONArray jSONArray5 = new JSONArray();
jSONArray5.put(str);
jSONObject.put("stream_providers", jSONArray5);
System.out.println(jSONObject.toString(4));
} catch (Exception e2) {
e2.printStackTrace();
}
return jSONObject;
}
private void O3() {
}
private HttpMediaDrmCallback P1(String str, String[] strArr) {
HttpMediaDrmCallback httpMediaDrmCallback = new HttpMediaDrmCallback(str, G1(false));
if (strArr != null) {
for (int i = 0; i < strArr.length - 1; i += 2) {
httpMediaDrmCallback.setKeyRequestProperty(strArr[i], strArr[i + 1]);
}
}
return httpMediaDrmCallback;
}
public static void P2(AdEvent adEvent) {
AdEvent.AdEventType type = adEvent.getType();
if (type == AdEvent.AdEventType.AD_PROGRESS) {
return;
}
hd.h.c("DAI", "DAI ad " + ("IMA event: " + type));
}
public void P3(HashMap hashMap, String str, String str2) {
com.yupptv.ott.fragments.g gVar = this.t2;
if (gVar != null) {
gVar.dismiss();
}
hd.u.J0(getActivity(), DialogType.PLAYER_ACTIVE_SCREEN_DIALOG, hashMap, new u(str, str2));
}
private MediaItem Q1(Bundle bundle, Uri uri) {
MediaItem build;
String string = bundle.getString("drm_license_url");
hd.h.a("Exo_Frag>>", "drmLicenseUrl::" + string);
String[] stringArray = bundle.getStringArray("drm_key_request_properties");
P1(string, stringArray);
UUID fromString = bundle.containsKey("drm_scheme_uuid") ? UUID.fromString(bundle.getString("drm_scheme_uuid")) : null;
DownloadRequest h2 = ((OTTApplication) getActivity().getApplication()).t().h(uri);
if (h2 != null) {
HashMap hashMap = new HashMap();
if (fromString != null && stringArray != null) {
for (int i = 0; i < stringArray.length; i += 2) {
hashMap.put(stringArray[i], stringArray[i + 1]);
}
}
return new MediaItem.Builder().setMediaId(h2.id).setUri(h2.uri).setCustomCacheKey(h2.customCacheKey).setMimeType(h2.mimeType).setStreamKeys(h2.streamKeys).setDrmKeySetId(h2.keySetId).setDrmLicenseRequestHeaders(hashMap).setDrmUuid(fromString).setDrmLicenseUri(string).build();
}
String adaptiveMimeTypeForContentType = Util.getAdaptiveMimeTypeForContentType(Util.inferContentType(uri));
if (fromString != null) {
HashMap hashMap2 = new HashMap();
if (stringArray != null) {
for (int i2 = 0; i2 < stringArray.length; i2 += 2) {
hashMap2.put(stringArray[i2], stringArray[i2 + 1]);
}
}
MediaItem.DrmConfiguration build2 = new MediaItem.DrmConfiguration.Builder(fromString).setLicenseUri(Uri.parse(string)).setLicenseRequestHeaders(hashMap2).build();
Uri Y1 = Y1();
hd.h.a("DEBUG", "adtag " + Y1);
if (Y1 != null) {
build = new MediaItem.Builder().setUri(uri).setMimeType(adaptiveMimeTypeForContentType).setAdsConfiguration(new MediaItem.AdsConfiguration.Builder(Y1).build()).setDrmConfiguration(build2).build();
} else {
k3();
build = new MediaItem.Builder().setUri(uri).setMimeType(adaptiveMimeTypeForContentType).setDrmConfiguration(build2).build();
}
} else {
Uri Y12 = Y1();
if (Y12 != null) {
build = new MediaItem.Builder().setUri(uri).setMimeType(adaptiveMimeTypeForContentType).setAdsConfiguration(new MediaItem.AdsConfiguration.Builder(Y12).build()).build();
} else {
k3();
build = new MediaItem.Builder().setUri(uri).setMimeType(adaptiveMimeTypeForContentType).build();
}
}
ArrayList arrayList = new ArrayList();
StreamResponse streamResponse = this.V0;
if (streamResponse != null && streamResponse.getStreams() != null && this.V0.getStreams().size() > 0 && ((Stream) this.V0.getStreams().get(0)).getCloseCaptions() != null && ((Stream) this.V0.getStreams().get(0)).getCloseCaptions().getCcList() != null) {
this.p1 = true;
if (((Stream) this.V0.getStreams().get(0)).getCloseCaptions().getDefaultLang() != null) {
this.f1 = ((Stream) this.V0.getStreams().get(0)).getCloseCaptions().getDefaultLang();
}
for (int i3 = 0; i3 < ((Stream) this.V0.getStreams().get(0)).getCloseCaptions().getCcList().size(); i3++) {
arrayList.add(new MediaItem.SubtitleConfiguration.Builder(Uri.parse(hd.a.a.f(OTTApplication.o()).getImageAbsolutePath(((Stream.CcList) ((Stream) this.V0.getStreams().get(0)).getCloseCaptions().getCcList().get(i3)).getFilePath()))).setMimeType(b2(((Stream.CcList) ((Stream) this.V0.getStreams().get(0)).getCloseCaptions().getCcList().get(i3)).getFileType())).setLanguage(((Stream.CcList) ((Stream) this.V0.getStreams().get(0)).getCloseCaptions().getCcList().get(i3)).getLanguage()).setSelectionFlags(1).build());
}
}
return arrayList.size() > 0 ? build.buildUpon().setSubtitleConfigurations(arrayList).build() : build;
}
public void Q2(View view) {
this.h.dismiss();
}
private java.util.Map<java.lang.String, java.lang.String> R1(java.lang.String r22, java.lang.String r23, java.lang.String r24, java.lang.String r25, java.lang.String r26, java.lang.String r27) {
throw new UnsupportedOperationException("Method not decompiled: tc.i.R1(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String):java.util.Map");
}
public void R2(Task task) {
if (task.isSuccessful()) {
this.H2 = (ReviewInfo) task.getResult();
OttLog.error("In App Review", " review pop up task.isSuccessfull ");
return;
}
OttLog.error("In App Review", " review pop up task is failed " + ((ReviewException) task.getException()).getErrorCode());
}
public void R3(String str, String str2) {
int i = getResources().getDisplayMetrics().heightPixels;
Dialog dialog = new Dialog(getActivity());
this.G4 = dialog;
dialog.requestWindowFeature(1);
this.G4.setContentView(2131624002);
this.G4.getWindow().setLayout((int) (getResources().getDisplayMetrics().widthPixels * 0.9d), -2);
this.G4.setCanceledOnTouchOutside(false);
TextView textView = (TextView) this.G4.findViewById(2131428368);
TextView textView2 = (TextView) this.G4.findViewById(2131427678);
if (str.trim().length() > 0) {
textView.setText(str);
}
if (str2.trim().length() > 0) {
textView2.setText(str2);
}
this.G4.findViewById(2131428940).setOnClickListener(new t());
this.G4.show();
}
public void S2(View view) {
if (OTTApplication.j0) {
return;
}
hd.e0.v0(this.g3, 4, 500L, 5.0f);
OTTApplication.j0 = true;
this.u3.setVisibility(0);
D2();
int requestedOrientation = this.J.getRequestedOrientation();
int rotation = ((WindowManager) this.J.getSystemService("window")).getDefaultDisplay().getRotation();
this.J.setRequestedOrientation(rotation != 1 ? rotation != 3 ? requestedOrientation : 8 : 0);
}
public void T2(View view) {
if (OTTApplication.j0) {
OTTApplication.j0 = false;
I3(2131427523, true);
I3(2131427521, false);
I3(2131427525, false);
this.g3.setColorFilter(getResources().getColor(2131100544));
this.D0.C0();
this.u3.setVisibility(8);
}
}
public void U2() {
this.R3 = null;
y3(8);
}
public void U3(LinearLayout linearLayout) {
e1.j0.a(linearLayout, e1.h0.c(linearLayout.getContext()).e(2132148227));
linearLayout.setVisibility(0);
}
public void V2() {
Intent intent = new Intent((Context) getActivity(), (Class<?>) MainActivity.class);
intent.setAction("android.intent.action.MAIN");
intent.addCategory("android.intent.category.LAUNCHER");
intent.addFlags(67108864);
intent.addFlags(268468224);
getActivity().startActivity(intent);
}
private JSONObject W1(String str, String str2) {
String str3;
String str4;
String str5;
LocationInfo.IpInfo ipInfo;
LocationInfo.ProductInfo productInfo;
LocationInfo.AnalyticsInfo analyticsInfo;
JSONObject jSONObject = new JSONObject();
OttSDK ottSDK = OttSDK.getInstance();
if (ottSDK == null) {
return null;
}
PreferenceManager preferenceManager = ottSDK.getPreferenceManager();
if (preferenceManager != null) {
try {
String str6 = this.P0;
String str7 = "-1";
if (str6 == null) {
str6 = "-1";
}
String[] split = str6.split(Pattern.quote("?"));
String str8 = split.length > 1 ? split[0] : str6;
JSONObject jSONObject2 = new JSONObject(str);
StreamResponse streamResponse = this.V0;
String tvShowName = (streamResponse == null || streamResponse.getPageAttributes() == null || TextUtils.isEmpty(this.V0.getPageAttributes().getTvShowName())) ? "-1" : this.V0.getPageAttributes().getTvShowName();
ContentPage contentPage = this.o3;
if (contentPage == null || contentPage.getPageData() == null) {
str3 = "seasonNumber";
} else {
str3 = "seasonNumber";
int i = 0;
while (i < this.o3.getPageData().size()) {
str4 = str8;
if (((PageData) this.o3.getPageData().get(i)).getPaneType().equalsIgnoreCase("content")) {
str5 = ((PageData) this.o3.getPageData().get(i)).getContent().getTitle();
break;
}
i++;
str8 = str4;
}
}
str4 = str8;
str5 = "-1";
if (preferenceManager.getLocationInfo() != null) {
LocationInfo.AnalyticsInfo analyticsInfo2 = preferenceManager.getLocationInfo().getAnalyticsInfo();
productInfo = preferenceManager.getLocationInfo().getProductInfo();
analyticsInfo = analyticsInfo2;
ipInfo = preferenceManager.getLocationInfo().getIpInfo();
} else {
ipInfo = null;
productInfo = null;
analyticsInfo = null;
}
String product = (productInfo == null || productInfo.getParams() == null || productInfo.getParams().getProduct() == null) ? "-1" : productInfo.getParams().getProduct();
JSONObject jSONObject3 = new JSONObject();
jSONObject3.put("HbRate", (analyticsInfo == null || analyticsInfo.getHbRateInMillis() == null) ? "-1" : analyticsInfo.getHbRateInMillis());
jSONObject3.put("clientId", preferenceManager.getDeviceUniqueId());
jSONObject3.put("authKey", (analyticsInfo == null || analyticsInfo.getAuthKey() == null) ? "-1" : analyticsInfo.getAuthKey());
jSONObject3.put("analytics_id", hd.e0.Q(getContext()));
jSONObject3.put("trueIp", (ipInfo == null || ipInfo.getTrueIP() == null) ? "-1" : ipInfo.getTrueIP());
jSONObject3.put("countryName", (ipInfo == null || ipInfo.getCountry() == null) ? "-1" : ipInfo.getCountry());
jSONObject3.put("state", (ipInfo == null || ipInfo.getRegion() == null) ? "-1" : ipInfo.getRegion());
jSONObject3.put("city", (ipInfo == null || ipInfo.getCity() == null) ? "-1" : ipInfo.getCity());
jSONObject3.put("environment", hd.e0.b0(getContext()));
jSONObject3.put("timeStamp", (analyticsInfo == null || analyticsInfo.getServerTime() == null) ? "-1" : analyticsInfo.getServerTime());
jSONObject3.put("subCategory", jSONObject2.has("subCategory") ? jSONObject2.getString("subCategory") : "-1");
jSONObject3.put("grouplistName", tvShowName);
jSONObject.put("locationData", jSONObject3);
JSONObject jSONObject4 = new JSONObject();
jSONObject4.put("playerName", "ExoPlayer");
jSONObject4.put("playerVersion", "2.18.1");
jSONObject.put("playerMetaData", jSONObject4);
JSONObject jSONObject5 = new JSONObject();
jSONObject5.put("connectionType", "WIFI");
jSONObject5.put("clientIP", (ipInfo == null || ipInfo.getTrueIP() == null) ? "-1" : ipInfo.getTrueIP());
jSONObject5.put("NWProvider", "");
jSONObject5.put("ISProvider", "");
jSONObject5.put("deviceType", "androidMobile");
jSONObject5.put("deviceClient", "Android Mobile");
jSONObject5.put("deviceId", hd.e.z.getValue() != null ? hd.e.z.getValue() : "-1");
jSONObject5.put("deviceOS", "Android");
jSONObject5.put("deviceOSVersion", DeviceUtils.os_version);
jSONObject5.put("deviceBrand", Build.BRAND);
jSONObject5.put("deviceModel", Build.MODEL);
jSONObject.put("clientMetaData", jSONObject5);
JSONObject jSONObject6 = new JSONObject();
jSONObject6.put("channelId", jSONObject2.has("channelId") ? jSONObject2.getString("channelId") : "-1");
jSONObject6.put("channelName", jSONObject2.has("networkName") ? jSONObject2.getString("networkName") : "-1");
StreamResponse streamResponse2 = this.V0;
jSONObject6.put("programId", (streamResponse2 == null || streamResponse2.getAnalyticsInfo() == null) ? "-1" : this.V0.getAnalyticsInfo().getId().toString());
jSONObject6.put("programName", str5);
StreamResponse streamResponse3 = this.V0;
jSONObject6.put("contentType", (streamResponse3 == null || TextUtils.isEmpty(streamResponse3.getPageAttributes().getContentType())) ? "-1" : this.V0.getPageAttributes().getContentType());
jSONObject6.put("subCategory", jSONObject2.has("subCategory") ? jSONObject2.getString("subCategory") : "-1");
ContentPage contentPage2 = this.o3;
if (contentPage2 != null && contentPage2.getPageInfo() != null) {
jSONObject6.put("genre", this.o3.getPageInfo().getAttributes().getGenre() != null ? this.o3.getPageInfo().getAttributes().getGenre() : "-1");
if (this.o3.getPageInfo().getAttributes().getStartTime() != null) {
jSONObject6.put("epgStartTime", this.o3.getPageInfo().getAttributes().getStartTime());
} else {
jSONObject6.put("epgStartTime", "-1");
}
if (this.o3.getPageInfo().getAttributes().getEndTime() != null) {
jSONObject6.put("epgEndTime", this.o3.getPageInfo().getAttributes().getEndTime());
} else {
jSONObject6.put("epgEndTime", "-1");
}
}
StreamResponse streamResponse4 = this.V0;
if (streamResponse4 != null) {
if (streamResponse4.getAnalyticsInfo() != null) {
jSONObject6.put("datCDNetworkaType", this.V0.getAnalyticsInfo().getDataType() != null ? this.V0.getAnalyticsInfo().getDataType() : "-1");
jSONObject6.put("dataKey", this.V0.getAnalyticsInfo().getDataKey() != null ? this.V0.getAnalyticsInfo().getDataKey() : "-1");
}
if (this.V0.getPageAttributes() != null) {
jSONObject6.put("lang", this.V0.getPageAttributes().getLanguage() != null ? this.V0.getPageAttributes().getLanguage() : "-1");
}
}
jSONObject6.put("grouplistName", tvShowName);
jSONObject6.put("isSubscribed", this.N0);
jSONObject6.put("CDNetwork", !this.U0.isEmpty() ? this.U0 : "-1");
jSONObject6.put("navigationFrom", this.K0);
jSONObject6.put("attribute1", str);
jSONObject6.put("attribute2", "-1");
jSONObject6.put("attribute3", "-1");
jSONObject.put("contentMetaData", jSONObject6);
JSONObject jSONObject7 = new JSONObject();
if (preferenceManager.getLoggedUser() == null || preferenceManager.getLoggedUser().getUserId() == null) {
jSONObject7.put("userId", "-1");
} else {
jSONObject7.put("userId", preferenceManager.getLoggedUser().getUserId());
}
jSONObject7.put("boxId", preferenceManager.getDeviceUniqueId());
jSONObject7.put("partnerId", jSONObject2.has("networkId") ? jSONObject2.getString("networkId") : "-1");
jSONObject7.put("partnerName", jSONObject2.has("networkName") ? jSONObject2.getString("networkName") : "-1");
jSONObject.put("userMetaData", jSONObject7);
JSONObject jSONObject8 = new JSONObject();
jSONObject8.put("autoplay", str2);
jSONObject8.put("videoList", "");
jSONObject8.put("productName", product);
jSONObject8.put("streamURL", str4 != null ? str4 : "-1");
String str9 = str3;
jSONObject8.put(str9, jSONObject2.has(str9) ? jSONObject2.getString(str9) : "-1");
jSONObject8.put("episodeNumber", jSONObject2.has("episodeNumber") ? jSONObject2.getString("episodeNumber") : "-1");
jSONObject8.put("isPromotional", "0");
if (!this.n1) {
str7 = "1";
}
jSONObject8.put("vodNumber", str7);
jSONObject.put("videoMetaData", jSONObject8);
hd.a.a.c(getActivity());
JSONObject jSONObject9 = new JSONObject();
jSONObject9.put("v2", com.yupptv.ott.a.o);
jSONObject9.put("videograph", com.yupptv.ott.a.p);
jSONObject.put("enabledAnalyticsServices", jSONObject9);
Log.d("customjson ", jSONObject.toString(4));
} catch (NullPointerException | JSONException unused) {
}
}
return jSONObject;
}
public void W3() {
if (getActivity() != null) {
Dialog dialog = new Dialog(getActivity(), 2132017726);
this.h = dialog;
dialog.requestWindowFeature(1);
Dialog dialog2 = this.h;
dialog2.setContentView(H1(LayoutInflater.from(dialog2.getContext()), getActivity()));
this.h.show();
}
}
public static String X1() {
return UUID.randomUUID().toString();
}
public void X2() {
OttLog.error("loadChromeCast", "loadChromeCast");
this.C1 = this.C1.trim().length() > 0 ? this.C1 : this.J0;
ArrayList arrayList = this.z1;
long j2 = 0;
if (arrayList == null || arrayList.size() <= 0) {
String str = this.P0;
if (str == null || str.length() <= 0) {
Q3(true, "Unable to play");
} else {
ExoPlayer exoPlayer = this.g0;
if (exoPlayer != null && exoPlayer.getCurrentPosition() > 0) {
j2 = this.g0.getCurrentPosition();
}
hd.b.h(this.v1.getSessionManager().getCurrentCastSession(), this.P0, this.I1, j2, this.L1, this.N1, this.G1, this.E1, this.h1, this.C1, this.F1, this.T0, this.S0, this.R0, this.W0);
V3();
}
} else {
ExoPlayer exoPlayer2 = this.g0;
if (exoPlayer2 != null && exoPlayer2.getCurrentPosition() > 0) {
j2 = this.g0.getCurrentPosition();
}
hd.b.i(this.v1.getSessionManager().getCurrentCastSession(), this.z1, this.I1, j2, this.L1, this.N1, this.H1, this.G1, this.E1, this.h1, this.C1, this.F1, this.T0, this.S0, this.R0, this.W0);
V3();
}
this.v1.removeCastStateListener(this.B1);
oc.l lVar = this.t0;
if (lVar != null) {
lVar.s();
}
}
public void X3(boolean z2) {
if (!z2) {
AppCompatButton appCompatButton = this.T;
if (appCompatButton != null) {
appCompatButton.setVisibility(z2 ? 0 : 8);
}
} else if (this.f4.getVisibility() != 0 || getActivity().w2() == 1) {
this.D0.W();
this.f4.setVisibility(8);
AppCompatButton appCompatButton2 = this.T;
if (appCompatButton2 != null) {
appCompatButton2.setVisibility(z2 ? 0 : 8);
}
} else {
this.f4.setVisibility(0);
this.T.setVisibility(8);
this.i4.setVisibility(8);
this.g4.setVisibility(8);
this.l2.setVisibility(8);
this.h4.setVisibility(0);
}
if (this.F3 && this.z3 != null && getActivity().w2() != 2) {
this.z3.setVisibility(8);
return;
}
TextView textView = this.z3;
if (textView != null) {
textView.setVisibility(8);
}
}
private Uri Y1() {
String p2;
if (!this.S1 || this.V1 == null || (p2 = p2()) == null) {
return null;
}
Uri parse = Uri.parse(p2);
if (!parse.equals(this.X1)) {
k3();
this.X1 = parse;
}
String v2 = v2();
if (v2 != null && v2.trim().length() > 0) {
return Uri.parse(v2);
}
String w2 = w2();
if (w2 == null || w2.trim().length() <= 0) {
return Uri.parse(o2(p2));
}
hd.h.a("DEBUG", "vmap " + w2);
return Util.getDataUriForString("text/xml", w2);
}
public void Y2(Object obj, long j2, String str) {
OttLog.error("loadChromeCastFromStart", "loadChromeCastFromStart");
hd.h.b("loadChromeCastFromStart ", "contentId :" + this.C1);
hd.h.b("loadChromeCastFromStart", "contentKey :" + str);
if (this.C1.equalsIgnoreCase(str) && !hd.a0.y(getActivity()).e("chromecast_stopped").booleanValue()) {
if (this.P1) {
String str2 = this.P0;
if (str2 == null || str2.length() <= 0) {
Q3(true, "Unable to play");
return;
}
M2();
hd.b.h(this.v1.getSessionManager().getCurrentCastSession(), this.P0, this.I1, 0L, this.L1, this.N1, this.G1, this.E1, obj, str, this.F1, this.T0, this.S0, this.R0, this.W0);
this.P1 = false;
return;
}
return;
}
ArrayList arrayList = this.z1;
if (arrayList != null && arrayList.size() > 0) {
if (this.f2) {
this.f2 = false;
u3(ConcurrentStreamStatus.POLL);
return;
} else {
M2();
hd.b.i(this.v1.getSessionManager().getCurrentCastSession(), this.z1, this.I1, 1000 * j2, this.L1, this.N1, this.H1, this.G1, this.E1, this.h1, this.C1, this.F1, this.T0, this.S0, this.R0, this.W0);
return;
}
}
String str3 = this.P0;
if (str3 == null || str3.length() <= 0) {
Q3(true, "Unable to play");
return;
}
this.C1 = str;
M2();
if (!this.f2) {
hd.b.h(this.v1.getSessionManager().getCurrentCastSession(), this.P0, this.I1, j2, this.L1, this.N1, this.G1, this.E1, obj, str, this.F1, this.T0, this.S0, this.R0, this.W0);
} else {
this.f2 = false;
u3(ConcurrentStreamStatus.POLL);
}
}
public AdsLoader Z1(MediaItem.AdsConfiguration adsConfiguration) {
if (this.R1 == null) {
this.R1 = new C0185i();
}
if (this.Q1 == null) {
this.Q1 = new ImaAdsLoader.Builder(getContext()).setAdEventListener(this.R1).setFocusSkipButtonWhenAvailable(true).build();
}
this.Q1.setPlayer(this.g0);
return this.Q1;
}
public void Z2(Object obj, Error error) {
if (getActivity() == null) {
return;
}
if (hd.e.n.booleanValue()) {
hd.e.n = Boolean.FALSE;
V2();
return;
}
Q3(true, error.getMessage());
if (getActivity() != null && (getActivity() instanceof MainActivity)) {
getActivity().S4(obj);
}
X3(false);
tc.j jVar = this.D0;
if (jVar != null) {
jVar.r0(this);
}
this.i2 = true;
HashMap hashMap = new HashMap();
hashMap.put("errorMsg", error.getMessage());
hashMap.put("PIN", this.j2);
Configs D = OTTApplication.D();
if (!com.yupptv.ott.a.h || OTTApplication.i0 == null || D == null || D.getParentalControlPopupMessage() == null || D.getParentalControlPopupMessage().trim().length() <= 0) {
String str = hd.d.e;
if (str == null || str.trim().length() <= 0) {
hashMap.put("msg1", String.format(getActivity().getResources().getString(2131952594), Integer.valueOf(hd.d.d)));
} else {
hashMap.put("msg1", hd.d.e);
}
} else {
hashMap.put("msg1", D.getParentalControlPopupMessage());
}
int intValue = error.getCode().intValue();
if (intValue == -823) {
hd.u.J0(getActivity(), DialogType.PARENTAL_CONTROL_PASSCODE_DIALOG, hashMap, this.S4);
} else if (intValue == -821) {
hd.u.J0(getActivity(), DialogType.PARENTAL_CONTROL_PASSCODE_DIALOG, hashMap, this.S4);
} else if (intValue == -820) {
hd.u.J0(getActivity(), DialogType.PARENTAL_CONTROL_PASSCODE_DIALOG, hashMap, this.S4);
} else if (intValue == -15 || intValue == -14) {
AppCompatButton appCompatButton = this.U;
if (appCompatButton != null) {
appCompatButton.setVisibility(0);
}
if (this.I0) {
this.I0 = false;
cc.d.d().f(cc.d.V);
hd.u.N(getActivity(), ScreenType.OTP_VERIFY, hd.r.g1, null, 9);
} else {
Q3(true, error.getMessage());
}
} else {
this.j2 = "";
}
try {
if (this.y1 != null) {
C2();
this.y1.setVisibility(4);
}
} catch (Exception unused) {
}
}
public void Z3() {
tc.j jVar;
tc.j jVar2 = this.D0;
if (jVar2 != null) {
boolean z2 = jVar2.L0;
if (!z2 && (!z2 || this.H != ButtonType.START_OVER)) {
if (hd.e0.h0(getActivity()) && (jVar = this.D0) != null) {
jVar.m0();
this.D0.a1();
return;
} else {
ExoPlayer exoPlayer = this.g0;
if (exoPlayer != null) {
exoPlayer.seekTo(0L);
return;
}
return;
}
}
ContentPage contentPage = this.o3;
if (contentPage == null || contentPage.getPageInfo() == null) {
ExoPlayer exoPlayer2 = this.g0;
if (exoPlayer2 != null) {
exoPlayer2.seekTo(0L);
return;
}
return;
}
if (this.o3.getPageInfo().getAttributes() != null) {
if (this.o3.getPageInfo().getAttributes().getIsLive() == null || !this.o3.getPageInfo().getAttributes().getIsLive().booleanValue() || this.o3.getPageInfo().getAttributes().getStartTime() == null) {
tc.j jVar3 = this.D0;
if (jVar3.L0) {
jVar3.v0(0L);
this.D0.L0();
this.t1 = false;
return;
} else {
if (this.H == ButtonType.START_OVER) {
K(0L, this.o3.getPageInfo().getPath());
return;
}
return;
}
}
String startTime = this.o3.getPageInfo().getAttributes().getStartTime();
a.C0133a c0133a = hd.a.a;
c0133a.c(OTTApplication.o()).getMaxdvrtime();
c0133a.c(OTTApplication.o()).getMaxDvrDisplayText();
Configs D = OTTApplication.D();
String startOverTextMessage = (!com.yupptv.ott.a.h || OTTApplication.i0 == null || D == null || D.getStartOverTextMessage() == null) ? c0133a.c(OTTApplication.o()).getStartOverTextMessage() : D.getStartOverTextMessage();
ExoPlayer exoPlayer3 = this.g0;
long maxdvrtime = (exoPlayer3 == null || !exoPlayer3.isCurrentWindowLive()) ? c0133a.c(OTTApplication.o()).getMaxdvrtime() : this.g0.getDuration();
try {
long parseLong = Long.parseLong(startTime);
long currentTimeMillis = System.currentTimeMillis();
if (maxdvrtime <= 600000 || currentTimeMillis - parseLong <= maxdvrtime) {
if (this.H == ButtonType.START_OVER && this.g0 == null) {
K(Long.valueOf(parseLong), this.o3.getPageInfo().getPath());
return;
}
tc.j jVar4 = this.D0;
if (jVar4.L0) {
jVar4.v0(parseLong);
this.D0.L0();
this.D0.a1();
return;
}
return;
}
ExoPlayer exoPlayer4 = this.g0;
boolean z3 = exoPlayer4 != null && exoPlayer4.getPlayWhenReady();
if (z3) {
this.g0.setPlayWhenReady(false);
}
long j2 = currentTimeMillis - maxdvrtime;
HashMap hashMap = new HashMap();
if (startOverTextMessage == null) {
startOverTextMessage = "";
}
hashMap.put("msg2", startOverTextMessage);
hashMap.put("msg1", "");
hd.u.J0(getActivity(), DialogType.STARTOVER_DIALOG, hashMap, new x0(j2, z3));
} catch (NumberFormatException unused) {
this.D0.L0();
}
}
}
}
public void a3(com.yupptv.ottsdk.model.stream.StreamResponse r18, java.lang.Object r19, java.util.List<com.yupptv.ottsdk.model.PageData> r20, com.yupptv.ottsdk.model.PageInfo r21, com.yupptv.ottsdk.model.StreamStatus r22) {
throw new UnsupportedOperationException("Method not decompiled: tc.i.a3(com.yupptv.ottsdk.model.stream.StreamResponse, java.lang.Object, java.util.List, com.yupptv.ottsdk.model.PageInfo, com.yupptv.ottsdk.model.StreamStatus):void");
}
private void a4(int i) {
b4(getString(i));
}
private String b2(String str) {
str.hashCode();
switch (str) {
case "webvtt":
case "vtt":
return "text/vtt";
case "x-ssa":
return "text/x-ssa";
default:
return "application/x-subrip";
}
}
public void b4(String str) {
if (TextUtils.isEmpty(str.trim())) {
return;
}
Toast.makeText((Context) getActivity(), (CharSequence) str, 1).show();
}
private String d2() {
List<Filter.FilterItem> list;
if (cc.e.n() != null && cc.e.n().a() != null && !cc.e.n().a().isEmpty()) {
return cc.e.n().a();
}
if (TextUtils.isEmpty(this.g1) || (list = this.k2) == null) {
return "";
}
for (Filter.FilterItem filterItem : list) {
if (filterItem.getCode() != null && filterItem.getCode().trim().toLowerCase().equalsIgnoreCase(this.g1.trim().toLowerCase())) {
return filterItem.getTitle();
}
}
return "";
}
@NonNull
private View.OnTouchListener e3() {
return new m();
}
private void e4(Long l2) {
if (l2.longValue() < 1000) {
return;
}
this.P4 = new y(l2.longValue(), 1000L).start();
}
private String f2() {
Configs c2 = hd.a.a.c(OTTApplication.o());
if (c2 == null || c2.getSiteURL() == null) {
return "";
}
String siteURL = c2.getSiteURL();
StringBuilder sb2 = new StringBuilder();
sb2.append(siteURL);
sb2.append(siteURL.endsWith("/") ? "" : "/");
sb2.append(this.o3.getPageInfo().getPath());
return sb2.toString();
}
private void h2() {
if (getActivity() != null) {
hd.a.a.f(OTTApplication.o()).getPageContent(getActivity().W1, new k());
}
}
public void h3() {
String u2 = hd.a0.y(getActivity()).u("lastchannel");
if (u2 == null || u2.trim().length() <= 0) {
return;
}
hd.a.a.f(OTTApplication.o()).getPageContent(u2, new v0());
}
private void h4() {
CountDownTimer countDownTimer = this.P4;
if (countDownTimer != null) {
countDownTimer.cancel();
}
}
private String j2() {
TrackGroupArray trackGroups;
DefaultTrackSelector defaultTrackSelector = this.h0;
if (defaultTrackSelector == null || defaultTrackSelector.getCurrentMappedTrackInfo() == null || this.h0.getCurrentMappedTrackInfo().getTrackGroups(2) == null || (trackGroups = this.h0.getCurrentMappedTrackInfo().getTrackGroups(2)) == null || trackGroups.length <= 0 || trackGroups.get(0).getFormat(0) == null) {
return "";
}
if (!TextUtils.isEmpty(trackGroups.get(0).getFormat(0).label) && !"und".equals(trackGroups.get(0).getFormat(0).label)) {
String str = trackGroups.get(0).getFormat(0).label;
}
return (TextUtils.isEmpty(trackGroups.get(0).getFormat(0).language) || "und".equals(trackGroups.get(0).getFormat(0).language)) ? "" : trackGroups.get(0).getFormat(0).language;
}
private void j3() {
if (this.K == null) {
this.K = new uc.c(this.J);
}
this.K.i(new h());
}
public void j4() {
if (getActivity() == null || getActivity().isFinishing() || this.u1 == null) {
return;
}
CastContext castContext = this.v1;
if (castContext != null && castContext.getCastState() == 1) {
if (com.yupptv.ott.a.P && hd.e0.j) {
this.u1.setVisibility(0);
return;
} else {
this.u1.setVisibility(8);
return;
}
}
CastContext castContext2 = this.v1;
if (castContext2 != null) {
if (castContext2.getCastState() == 4) {
this.u1.setRemoteIndicatorDrawable(getResources().getDrawable(2131232444));
} else if (this.v1.getCastState() == 2) {
this.u1.setRemoteIndicatorDrawable(getResources().getDrawable(2131232654));
} else {
this.u1.setRemoteIndicatorDrawable(getResources().getDrawable(2131232287));
}
this.u1.setVisibility(0);
}
}
private String k2() {
return "https://play.google.com/store/apps/details?id=" + getActivity().getPackageName();
}
private void k3() {
AdsLoader adsLoader;
this.a2 = false;
if (!this.S1 || (adsLoader = this.Q1) == null) {
return;
}
this.T1 = false;
this.U1 = false;
adsLoader.release();
this.Q1 = null;
this.X1 = null;
StyledPlayerView styledPlayerView = this.e0;
if (styledPlayerView == null || styledPlayerView.getOverlayFrameLayout() == null) {
return;
}
this.e0.getOverlayFrameLayout().removeAllViews();
}
private void l2() {
if (getActivity() == null) {
return;
}
hd.a.a.f(OTTApplication.o()).getPageContent(getActivity().a1, new z());
}
public void l3() {
if (this.T1) {
yc.a aVar = this.Z0;
if (aVar != null) {
aVar.f(this.r2);
}
hd.w wVar = this.X0;
if (wVar != null) {
wVar.i(this.r2);
}
}
Handler handler = this.N4;
if (handler != null) {
handler.removeCallbacks(this.O4);
}
yc.a aVar2 = this.Z0;
if (aVar2 != null) {
aVar2.j();
}
hd.w wVar2 = this.X0;
if (wVar2 != null) {
wVar2.m();
}
hd.k0 k0Var = this.Y0;
if (k0Var != null) {
k0Var.e();
}
nd.a aVar3 = this.a1;
if (aVar3 != null) {
aVar3.i();
this.a1.o();
}
this.X0 = null;
this.Z0 = null;
}
private void l4() {
ContentPage contentPage = this.o3;
if (contentPage != null && contentPage.getShareInfo() != null && this.o3.getShareInfo().getIsSharingAllowed() != null && this.o3.getShareInfo().getIsSharingAllowed().booleanValue()) {
this.e4 = true;
this.r3 = this.o3.getShareInfo();
return;
}
this.e4 = false;
ImageView imageView = this.X2;
if (imageView != null) {
imageView.setVisibility(8);
}
}
private String m2() {
hd.p pVar = this.F4;
return (pVar == null || pVar.g().isEmpty()) ? "" : this.F4.g().toString().replace("[", "").replace("]", "").replaceAll(" ", "");
}
private void m3() {
if (this.T1) {
yc.a aVar = this.Z0;
if (aVar != null) {
aVar.f(this.r2);
}
hd.w wVar = this.X0;
if (wVar != null) {
wVar.i(this.r2);
}
}
yc.a aVar2 = this.Z0;
if (aVar2 != null) {
aVar2.i();
}
hd.w wVar2 = this.X0;
if (wVar2 != null) {
wVar2.l();
}
hd.k0 k0Var = this.Y0;
if (k0Var != null) {
k0Var.e();
}
nd.a aVar3 = this.a1;
if (aVar3 != null) {
aVar3.i();
}
this.X0 = null;
this.Z0 = null;
}
private String n2(int i) {
long j2 = i * 1000;
TimeUnit timeUnit = TimeUnit.MILLISECONDS;
return String.format("%02d:%02d:%02d", Long.valueOf(timeUnit.toHours(j2)), Long.valueOf(timeUnit.toMinutes(j2) - TimeUnit.HOURS.toMinutes(timeUnit.toHours(j2))), Long.valueOf(timeUnit.toSeconds(j2) - TimeUnit.MINUTES.toSeconds(timeUnit.toMinutes(j2))));
}
private void n3() {
AdsLoader adsLoader = this.Q1;
if (adsLoader != null) {
adsLoader.setPlayer((Player) null);
}
ImaServerSideAdInsertionMediaSource.AdsLoader adsLoader2 = this.y4;
if (adsLoader2 != null && this.z4 != null) {
this.z4 = adsLoader2.release();
}
ExoPlayer exoPlayer = this.g0;
if (exoPlayer != null) {
this.p0 = exoPlayer.getPlayWhenReady();
if (!this.t) {
this.v0 = false;
}
k3();
this.T2 = d2();
HashMap<String, Object> k2 = cc.b.B0().k("video_stream", this.K2, this.n1 ? 0L : this.g0.getDuration(), this.T2);
if (k2.containsKey("source")) {
k2.replace("source", this.O0);
}
if (this.J2 > 0) {
this.K2 += System.currentTimeMillis() - this.J2;
this.J2 = 0L;
}
cc.c.d().t("video_stream", k2);
this.g0.seekTo(0L);
this.g0.clearVideoSurface();
B4();
ExoPlayer exoPlayer2 = this.g0;
if (exoPlayer2 != null) {
exoPlayer2.release();
}
this.g0 = null;
this.h0 = null;
this.i0 = null;
this.j0 = null;
this.Z = null;
hd.a0 a0Var = this.u2;
if (a0Var != null) {
a0Var.V("");
}
}
this.O0 = "";
o3();
tc.j jVar = this.D0;
if (jVar != null) {
jVar.h0();
this.D0.F = false;
}
this.Y1 = false;
}
public void n4(String str) {
try {
cc.d.d().f(str);
} catch (NullPointerException unused) {
}
}
private String o2(String str) {
if (str == null || str.trim().length() <= 0) {
return str;
}
PreferenceManager g2 = hd.a.a.g(OTTApplication.o());
if (str.contains("userAgent=[INSERT_MACRO]")) {
str = str.replace("[INSERT_MACRO]", System.getProperty("http.agent"));
}
if (str.contains("appBundle=[INSERT_MACRO]")) {
str = str.replace("[INSERT_MACRO]", "tv.chaupal.android");
}
if (str.contains("playerSize=[HARDCODED]")) {
str = str.replace("[HARDCODED]", "640x480");
}
if (str.contains("appName=[INSERT_MACRO]")) {
str = str.replace("[INSERT_MACRO]", getResources().getString(2131951617));
}
if (str.contains("appStoreUrl=[INSERT_MACRO]")) {
str = str.replace("[INSERT_MACRO]", k2());
}
if (str.contains("appVersion=[HARDCODED_OR_INSERT_MACRO]")) {
str = str.replace("[HARDCODED_OR_INSERT_MACRO]", "3.2");
}
if (str.contains("deviceIfa=[INSERT_MACRO]")) {
str = str.replace("[INSERT_MACRO]", hd.a0.y(getActivity()).u("pref_key_advertising_id"));
}
try {
if (str.contains("ip=[INSERT_MACRO]")) {
str = str.replace("[INSERT_MACRO]", "" + g2.getIpInfo().getTrueIP());
}
} catch (Exception unused) {
}
if (str.contains("{{CACHEBUSTER}}")) {
str = str.replace("{{CACHEBUSTER}}", "" + System.currentTimeMillis());
}
if (str.contains("{{APP_NAME}}")) {
str = str.replace("{{APP_NAME}}", getResources().getString(2131951617));
}
if (str.contains("{{APP_STORE_URL}}")) {
str = str.replace("{{APP_STORE_URL}}", k2());
}
if (str.contains("{{DEVICE_ID}}")) {
str = str.replace("{{DEVICE_ID}}", hd.a0.y(getActivity()).u("pref_key_advertising_id"));
}
try {
if (str.contains("{{IP}}")) {
str = str.replace("{{IP}}", "" + g2.getIpInfo().getTrueIP());
}
} catch (Exception unused2) {
}
if (str.contains("[placeholder]")) {
str = str.replace("[placeholder]", f2());
}
if (str.contains("correlator=")) {
str = str.replace("correlator=", "correlator=" + System.currentTimeMillis());
}
if (!str.contains("{{DEVICE_ID}}")) {
str = str + "&DEVICE_ID=" + hd.a0.y(getActivity()).u("pref_key_advertising_id");
}
if (str.contains("url=[referrer_url]")) {
str = str.replace("[referrer_url]", "tv.chaupal.android");
}
try {
String str2 = this.J0 + this.L1.replace(" ", "-") + "/";
if (str.contains("description_url=[description_url]")) {
str = str.replace("[description_url]", URLEncoder.encode(str2, "UTF-8"));
}
if (str.contains("description_url=[placeholder]")) {
str = str.replace("[placeholder]", URLEncoder.encode(str2, "UTF-8"));
}
if (str.contains("vid=[content_id]")) {
str = str.replace("[content_id]", this.J0);
}
hd.h.a("DEBUG", "updateAdTAg11 : " + str);
return str;
} catch (UnsupportedEncodingException e2) {
throw new RuntimeException(e2);
}
}
public void o4(String str, int i, ContentPage contentPage) {
try {
HashMap hashMap = new HashMap();
hashMap.put(cc.c.Q0, i == 0 ? cc.c.d1 : cc.c.c1);
hd.h.b("TAG", "#ATTRIBUTE_ACTIONS : " + i);
cc.c.d().m(ScreenType.PLAYER, null, contentPage, null, str, cc.c.x1, hashMap);
} catch (NullPointerException unused) {
}
}
private String p2() {
List<AdUrlType> adUrlTypes = this.V1.getAdUrlTypes();
this.W1 = adUrlTypes;
if (adUrlTypes == null || adUrlTypes.size() <= 0) {
return null;
}
for (int i = 0; i < this.W1.size(); i++) {
if (this.W1.get(i).getUrl() != null && this.W1.get(i).getUrl().trim().length() > 0) {
return this.W1.get(i).getUrl();
}
}
return null;
}
private void p4() {
uc.c cVar = this.K;
if (cVar != null) {
cVar.k();
}
}
private void q4() {
}
private void r3() {
this.l0 = null;
this.o1 = false;
this.n1 = false;
this.q1 = false;
this.r1 = true;
this.t1 = false;
this.R0 = "";
this.S0 = "";
this.P0 = "";
this.T0 = "";
this.I3 = "";
this.K3 = 0L;
this.D4.clear();
this.E4.clear();
}
public void r4(String str, boolean z2) {
try {
this.M3 = true;
this.y0.putString("drm_scheme_uuid", hd.e0.y("widevine").toString());
this.y0.putStringArray("drm_key_request_properties", new String[0]);
if (z2) {
this.y0.putString("drm_license_url", str);
}
} catch (ParserException unused) {
}
}
private String s2(String str, String str2, int i) {
String str3 = "<vmap:AdBreak timeOffset=\"yupp_mid_offset\" breakType=\"linear\" breakId=\"midroll-1\">\n<vmap:AdSource id=\"midroll-ad-1\" allowMultipleAds=\"false\" followRedirects=\"true\">\n<vmap:AdTagURI templateType=\"vast3\"><![CDATA[yupp_midroll]]></vmap:AdTagURI>\n</vmap:AdSource>\n</vmap:AdBreak>\n";
if (str != null && str.trim().length() > 0) {
str3 = "<vmap:AdBreak timeOffset=\"yupp_mid_offset\" breakType=\"linear\" breakId=\"midroll-1\">\n<vmap:AdSource id=\"midroll-ad-1\" allowMultipleAds=\"false\" followRedirects=\"true\">\n<vmap:AdTagURI templateType=\"vast3\"><![CDATA[yupp_midroll]]></vmap:AdTagURI>\n</vmap:AdSource>\n</vmap:AdBreak>\n".replace("yupp_midroll", str);
}
if (i > -1) {
str3 = str3.replace("midroll-ad-1", "midroll-ad-" + i).replace("midroll-1", "midroll-" + i);
}
if (str2 == null || str2.trim().length() <= 0) {
return str3;
}
try {
return str3.replace("yupp_mid_offset", n2(Integer.parseInt(str2)));
} catch (NumberFormatException unused) {
return str3;
}
}
public void s4() {
ContentPage contentPage = this.o3;
if (contentPage == null || contentPage.getPageButtons() == null) {
return;
}
boolean booleanValue = this.o3.getPageButtons().getIsFavourite().booleanValue();
if (booleanValue) {
hd.a.a.b(OTTApplication.o()).getUserManager().removeUserFavourite(this.o3.getPageInfo().getPath(), new v(booleanValue));
} else {
hd.a.a.b(OTTApplication.o()).getUserManager().addUserFavourite(this.o3.getPageInfo().getPath(), new w(booleanValue));
}
}
private String t2(String str) {
return (str == null || str.trim().length() <= 0) ? "<vmap:AdBreak timeOffset=\"end\" breakType=\"linear\" breakId=\"postroll\">\n<vmap:AdSource id=\"postroll-ad-1\" allowMultipleAds=\"false\" followRedirects=\"true\">\n<vmap:AdTagURI templateType=\"vast3\"><![CDATA[yupp_postroll]]></vmap:AdTagURI>\n</vmap:AdSource>\n</vmap:AdBreak>\n" : "<vmap:AdBreak timeOffset=\"end\" breakType=\"linear\" breakId=\"postroll\">\n<vmap:AdSource id=\"postroll-ad-1\" allowMultipleAds=\"false\" followRedirects=\"true\">\n<vmap:AdTagURI templateType=\"vast3\"><![CDATA[yupp_postroll]]></vmap:AdTagURI>\n</vmap:AdSource>\n</vmap:AdBreak>\n".replace("yupp_postroll", str);
}
private String u2(String str) {
return (str == null || str.trim().length() <= 0) ? "<vmap:AdBreak timeOffset=\"start\" breakType=\"linear\" breakId=\"preroll\">\n<vmap:AdSource id=\"preroll-ad-1\" allowMultipleAds=\"false\" followRedirects=\"true\">\n<vmap:AdTagURI templateType=\"vast3\"><![CDATA[yupp_preroll]]></vmap:AdTagURI>\n</vmap:AdSource>\n</vmap:AdBreak>\n" : "<vmap:AdBreak timeOffset=\"start\" breakType=\"linear\" breakId=\"preroll\">\n<vmap:AdSource id=\"preroll-ad-1\" allowMultipleAds=\"false\" followRedirects=\"true\">\n<vmap:AdTagURI templateType=\"vast3\"><![CDATA[yupp_preroll]]></vmap:AdTagURI>\n</vmap:AdSource>\n</vmap:AdBreak>\n".replace("yupp_preroll", str);
}
public void u3(ConcurrentStreamStatus concurrentStreamStatus) {
if (this.n2 != null) {
hd.a.a.b(OTTApplication.o()).getUserManager().doStreamPoll(this.n2.getStreamPollKey(), new s());
}
}
private String v2() {
List<AdUrlType> adUrlTypes = this.V1.getAdUrlTypes();
this.W1 = adUrlTypes;
if (adUrlTypes != null && adUrlTypes.size() > 0) {
for (int i = 0; i < this.W1.size(); i++) {
if (this.W1.get(i).getUrlType().equalsIgnoreCase("vmapurl")) {
if (this.W1.get(i).getUrl() == null || this.W1.get(i).getUrl().trim().length() <= 0) {
return null;
}
return o2(this.W1.get(i).getUrl());
}
if (this.W1.get(i).getAttributes() != null && this.W1.get(i).getAttributes().getAdTag() != null && this.W1.get(i).getAttributes().getAdTag().equalsIgnoreCase("vmap")) {
if (this.W1.get(i).getUrl() == null || this.W1.get(i).getUrl().trim().length() <= 0) {
return null;
}
return o2(this.W1.get(i).getUrl());
}
}
}
return null;
}
private java.lang.String w2() {
throw new UnsupportedOperationException("Method not decompiled: tc.i.w2():java.lang.String");
}
public void w4(boolean z2) {
RelativeLayout relativeLayout = this.s3;
if (relativeLayout != null) {
relativeLayout.setVisibility(z2 ? 0 : 8);
}
}
public void x2(String str) {
yc.a aVar = this.Z0;
if (aVar != null && com.yupptv.ott.a.p) {
aVar.e(str);
}
hd.w wVar = this.X0;
if (wVar == null || !com.yupptv.ott.a.o) {
return;
}
wVar.h(str);
}
public void y2(String str) {
yc.a aVar = this.Z0;
if (aVar != null && com.yupptv.ott.a.p) {
aVar.g(str);
}
hd.w wVar = this.X0;
if (wVar == null || !com.yupptv.ott.a.o) {
return;
}
wVar.j(str);
}
public void z2(String str, Ott_AdPosition ott_AdPosition) {
hd.w wVar = this.X0;
if (wVar != null && com.yupptv.ott.a.o) {
wVar.k(str);
}
yc.a aVar = this.Z0;
if (aVar == null || !com.yupptv.ott.a.p) {
return;
}
aVar.h(ott_AdPosition);
}
private void z4(boolean z2) {
this.M.post(new p(z2));
}
@Override
public void A(boolean z2) {
oc.l lVar = this.t0;
if (lVar != null) {
this.C = z2;
lVar.F(z2);
}
}
public void A3(int i) {
StyledPlayerView styledPlayerView = this.e0;
SubtitleView subtitleView = styledPlayerView != null ? styledPlayerView.getSubtitleView() : null;
if (subtitleView != null) {
subtitleView.setApplyEmbeddedFontSizes(false);
subtitleView.setApplyEmbeddedStyles(false);
subtitleView.setPadding(0, 0, 0, i);
}
}
public void A4() {
yc.a aVar;
ExoPlayer exoPlayer = this.g0;
if (exoPlayer == null || exoPlayer.isPlayingAd() || (aVar = this.Z0) == null || !com.yupptv.ott.a.p) {
return;
}
aVar.q(this.g0.getCurrentPosition() > 0 ? this.g0.getCurrentPosition() : -1L);
}
public DataSource.Factory B2() {
HashMap hashMap = new HashMap();
hashMap.put("sessionid", "yupp_test_token_initial_test");
hashMap.put("token", "st=1670312449~exp=1671176449~hmac=7bc08a64c14608d6187563f33208b9a17e4305c9bce4c2e76c1fc7f23c9b206d");
return new DefaultHttpDataSource.Factory().setDefaultRequestProperties(hashMap);
}
public MediaSourceFactory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
return null;
}
public void C2() {
FrameLayout frameLayout = this.y1;
if (frameLayout == null || frameLayout.getVisibility() != 0) {
return;
}
this.y1.setVisibility(8);
}
public void D1(Bundle bundle) {
List<MediaItem> list = this.w;
if (list == null) {
this.w = new ArrayList();
} else {
list.clear();
}
Uri[] uriArr = this.B;
if (uriArr == null || uriArr.length <= 0) {
return;
}
int i = 0;
while (true) {
Uri[] uriArr2 = this.B;
if (i >= uriArr2.length) {
return;
}
this.w.add(Q1(bundle, uriArr2[i]));
i++;
}
}
public void D2() {
View view;
tc.j jVar = this.D0;
if (jVar != null) {
jVar.W();
this.m2.setVisibility(8);
}
tc.j jVar2 = this.D0;
if (jVar2 != null && (view = jVar2.J) != null && view.getVisibility() == 0) {
this.D0.J.setVisibility(8);
this.l2.setVisibility(0);
} else if (this.l2.getVisibility() == 0) {
this.D0.J.setVisibility(0);
this.l2.setVisibility(8);
}
TextView textView = this.p3;
if ((textView != null && textView.getVisibility() == 0) || this.c4) {
this.c4 = true;
this.p3.setVisibility(8);
this.m2.setVisibility(0);
this.n3.setVisibility(8);
TextView textView2 = this.B3;
if (textView2 != null && textView2.getVisibility() == 0) {
this.B3.setVisibility(8);
}
}
ImageView imageView = this.j3;
if (imageView != null && imageView.getVisibility() == 0) {
this.j3.setVisibility(8);
}
if (OTTApplication.j0) {
this.f3.setVisibility(0);
}
}
public void D4(boolean z2) {
StyledPlayerView styledPlayerView = this.e0;
if (styledPlayerView != null) {
styledPlayerView.setVisibility(z2 ? 0 : 4);
if (this.e0.getVideoSurfaceView() != null) {
this.e0.getVideoSurfaceView().setVisibility(z2 ? 0 : 4);
if (this.e0.getVideoSurfaceView() instanceof SurfaceView) {
((SurfaceView) this.e0.getVideoSurfaceView()).setSecure(true);
}
}
}
}
public AdEvent.AdEventListener E1() {
return tc.e.a;
}
public void E2() {
tc.j jVar = this.D0;
if (jVar != null) {
jVar.b0();
}
y3(8);
vc.c cVar = this.w1;
if (cVar != null && cVar.K() != null && this.w1.K().getVisibility() == 0) {
this.w1.K().setVisibility(4);
}
ExoPlayer exoPlayer = this.g0;
if (exoPlayer != null) {
exoPlayer.isPlayingAd();
}
}
public void E3(boolean z2) {
this.D = z2;
}
public void F2() {
this.f4.setVisibility(8);
}
public void F3(long j2) {
this.Q4 = j2;
}
public void G2(LinearLayout linearLayout) {
e1.j0.a(linearLayout, e1.h0.c(linearLayout.getContext()).e(2132148227));
linearLayout.setVisibility(8);
}
public void G3(long j2) {
this.R4 = j2;
}
public void H2() {
a.c cVar;
com.yupptv.ott.fragments.i0 i0Var;
AppCompatButton appCompatButton = this.Y3;
if (appCompatButton != null && appCompatButton.getVisibility() == 0) {
this.Y3.setVisibility(8);
}
FrameLayout frameLayout = this.Z3;
if (frameLayout != null && frameLayout.getVisibility() == 0) {
this.Z3.setVisibility(8);
}
x();
D2();
LinearLayout linearLayout = this.N;
if (linearLayout != null && linearLayout.getVisibility() == 0) {
this.N.setVisibility(8);
this.b4.setVisibility(8);
}
Dialog dialog = this.h;
if (dialog != null && dialog.isShowing()) {
this.h.dismiss();
}
Dialog dialog2 = this.i0.r;
if (dialog2 != null && dialog2.isShowing()) {
this.i0.r.dismiss();
}
if (isAdded() && !isRemoving() && (i0Var = com.yupptv.ott.fragments.i0.K) != null) {
i0Var.c0(true);
if (requireActivity() instanceof MainActivity) {
requireActivity().r2 = false;
}
}
xc.a t2 = OTTApplication.w().t();
if (t2 == null || (cVar = t2.j) == null) {
return;
}
cVar.e();
}
public void H3(e1 e1Var) {
this.s = e1Var;
}
public void I1() {
ExoPlayer exoPlayer = this.g0;
if (exoPlayer == null || exoPlayer.getPlaybackState() == 4) {
return;
}
this.g0.getCurrentPosition();
HashMap<String, Object> h02 = cc.b.B0().h0(null);
h02.put(cc.a.I, hd.j.a(this.g0.getCurrentPosition()));
h02.put(cc.a.H, 0);
if (this.g0.getDuration() > 0) {
h02.put(cc.a.L, Double.valueOf(hd.e0.R(this.g0.getCurrentPosition(), this.g0.getDuration())));
}
cc.c.d().q(cc.a.c, q2(h02));
HashMap hashMap = new HashMap();
if (cc.e.n().q() != null && !cc.e.n().q().isEmpty()) {
hashMap.put("tabName", cc.e.n().q());
cc.e.n().N("");
}
F4();
long seconds = TimeUnit.MILLISECONDS.toSeconds(this.K2);
if (seconds > 0) {
hashMap.put(AppMeasurementSdk.ConditionalUserProperty.VALUE, String.valueOf(seconds));
hashMap.put("carousal_name", this.N2);
hashMap.put("carousal_position", "" + this.U2);
hashMap.put("content_position", "" + this.V2);
hashMap.put("target_path", "" + this.O2);
hashMap.put("tabName", "" + this.P2);
hashMap.put("tracking_id", this.Q2);
hashMap.put("origin_medium", this.S2);
hashMap.put("origin_source", this.R2);
String d2 = d2();
this.T2 = d2;
if (d2 != null) {
hashMap.put("contentAudioLanguage", d2);
cc.e.n().w(this.T2);
}
hd.u.E0(this.J, hashMap);
this.N2 = "";
this.U2 = 0;
this.V2 = 0;
this.O2 = "";
this.P2 = "";
this.Q2 = "";
this.S2 = "";
this.R2 = "";
cc.e.n().w("");
}
}
public void I2(ExoPlayer exoPlayer, boolean z2) {
String str;
tc.j jVar;
tc.j jVar2;
K2();
this.W0 = W1(this.M0, this.L0);
if ((this.Z0 == null && this.X0 == null) || (str = this.P0) == null || str.length() == 0) {
return;
}
String str2 = "";
if (this.P0.equalsIgnoreCase("")) {
return;
}
hd.k0 k0Var = this.Y0;
if (k0Var != null) {
k0Var.e();
}
nd.a aVar = this.a1;
if (aVar != null) {
aVar.i();
}
try {
if (getActivity() != null && (getActivity() instanceof MainActivity)) {
this.K0 = getActivity().g1;
}
} catch (Exception unused) {
}
hd.w wVar = this.X0;
if (wVar != null && com.yupptv.ott.a.o) {
wVar.s(this.P0, this.K0, this.J0, this.M0, this.N0, this.L0, a2());
this.Y0 = new hd.k0(hd.w.g(), exoPlayer);
this.X0.c();
}
if (this.Z0 != null && com.yupptv.ott.a.p) {
if (OttSDK.getInstance() != null && OttSDK.getInstance().getPreferenceManager() != null) {
PreferenceManager preferenceManager = OttSDK.getInstance().getPreferenceManager();
if (preferenceManager.getSessionId() != null) {
str2 = preferenceManager.getSessionId();
}
}
this.Z0.o(R1(this.J0, this.K0, this.P0, this.M0, this.N0, this.L0), str2, true);
nd.a.k(this.J).i();
nd.a k2 = nd.a.k(this.J);
this.a1 = k2;
k2.n(yc.a.d(), exoPlayer);
this.Z0.a();
this.a1.h(exoPlayer);
}
tc.a aVar2 = this.Z;
if (aVar2 != null) {
hd.k0 k0Var2 = this.Y0;
if (k0Var2 != null) {
aVar2.h(k0Var2);
}
nd.a aVar3 = this.a1;
if (aVar3 != null) {
this.Z.i(aVar3);
}
}
try {
hd.k0 k0Var3 = this.Y0;
if (k0Var3 != null && k0Var3.g() != null && (jVar2 = this.D0) != null) {
jVar2.B0(this.Y0.g());
}
nd.a aVar4 = this.a1;
if (aVar4 != null && aVar4.m() != null && (jVar = this.D0) != null) {
jVar.B0(this.a1.m());
}
} catch (NullPointerException unused2) {
}
if (this.N4 == null) {
this.N4 = new Handler();
}
this.N4.removeCallbacks(this.O4);
this.N4.postDelayed(this.O4, 1000L);
}
public void I3(int i, boolean z2) {
r2(i).setVisibility(z2 ? 0 : 4);
}
public void J1() {
CountDownTimer countDownTimer = this.E0;
if (countDownTimer != null) {
countDownTimer.cancel();
}
}
public void J3(float f2) {
AudioManager audioManager = (AudioManager) this.J.getSystemService("audio");
this.x4 = audioManager.getStreamMaxVolume(3);
if (this.w4 == -1.0f) {
float streamVolume = audioManager.getStreamVolume(3);
this.w4 = streamVolume;
if (streamVolume < BitmapDescriptorFactory.HUE_RED) {
this.w4 = BitmapDescriptorFactory.HUE_RED;
}
}
int i = this.x4;
int i2 = (int) (((int) (f2 * i)) + this.w4);
if (i2 <= i) {
i = i2 < 0 ? 0 : i2;
}
try {
audioManager.setStreamVolume(3, i, 0);
} catch (Throwable unused) {
}
int i3 = (int) (((i * 1.0d) / this.x4) * 15.0d);
this.a5 = (TextView) getActivity().findViewById(2131427524);
VerticalSeekBar verticalSeekBar = (VerticalSeekBar) getActivity().findViewById(2131429981);
this.Z4 = verticalSeekBar;
if (Build.VERSION.SDK_INT >= 26) {
verticalSeekBar.setMin(0);
this.Z4.setMax(150);
}
I3(2131427523, true);
I3(2131427521, false);
I3(2131427525, true);
I3(2131429981, true);
I3(2131427524, false);
((ImageView) this.J.findViewById(2131427526)).setImageResource(i3 <= 0 ? 2131232693 : i3 <= 7 ? 2131232691 : i3 >= 14 ? 2131232689 : 2131232692);
int i4 = i3 * 10;
this.Z4.setProgress(i4);
this.a5.setText(" " + i4);
}
public void K1(String str, oc.s sVar) {
if (str == null || !str.equals(this.J1) || this.v2 == null) {
sVar.a(false);
} else {
sVar.a(true);
}
}
public void K3() {
throw new UnsupportedOperationException("Method not decompiled: tc.i.K3():void");
}
public void L1() {
if (!this.n1) {
this.W3.setVisibility(8);
return;
}
if (this.Q4 > 0 && (System.currentTimeMillis() / 1000) - 60 >= this.Q4 / 1000) {
l2();
this.W3.setVisibility(8);
return;
}
String str = this.I3;
if (str == null || str.trim().length() <= 0 || getActivity().getResources().getConfiguration().orientation != 2) {
this.W3.setVisibility(8);
return;
}
PreferenceManager g2 = hd.a.a.g(OTTApplication.o());
if (g2 == null || g2.getLoggedUser() == null || g2.getLoggedUser().getAttributes() == null || g2.getLoggedUser().getAttributes().getLms_user_name() == null || g2.getLoggedUser().getAttributes().getLms_user_name().trim().length() <= 0) {
this.W3.setVisibility(8);
return;
}
if ((System.currentTimeMillis() / 1000) - 60 >= this.K3.longValue() / 1000 && System.currentTimeMillis() / 1000 <= this.Q4 / 1000) {
h4();
this.W3.setBackground(getResources().getDrawable(2131230831));
this.W3.setEnabled(true);
this.W3.setText(this.J3);
this.W3.setVisibility(0);
return;
}
if (System.currentTimeMillis() / 1000 < this.R4 / 1000 || System.currentTimeMillis() / 1000 > this.K3.longValue() / 1000) {
return;
}
e4(Long.valueOf(this.K3.longValue() - System.currentTimeMillis()));
this.W3.setBackground(getResources().getDrawable(2131230830));
this.W3.setEnabled(false);
this.W3.setVisibility(0);
}
public void M1() {
if (requireActivity() != null) {
this.f = 2;
getActivity().p.slideHorizontal(true);
getActivity().J5(0);
}
}
public void M3() {
OttLog.error("stateChangedOnCastConnected", "showChromeCast");
this.V = this.X.q();
if ((getActivity() != null) & isAdded()) {
this.V.s(R.anim.fade_in, R.anim.fade_out);
if (this.w1 == null) {
this.w1 = new vc.c();
}
this.w1.P(this.h1);
this.w1.Q(this);
if (!this.w1.isAdded()) {
this.w1.R(new g());
this.V.q(2131427767, this.w1);
this.V.j();
}
}
this.y1.setVisibility(0);
this.w1.M();
tc.j jVar = this.D0;
if (jVar == null || jVar.U() == null || this.D0.U().getVisibility() != 0) {
return;
}
this.w1.Y(this.D0.U().getText().toString());
}
public String O2() {
DefaultTrackSelector defaultTrackSelector;
if (this.l0 == null && (defaultTrackSelector = this.h0) != null && defaultTrackSelector.getCurrentMappedTrackInfo() != null && getActivity() != null) {
MappingTrackSelector.MappedTrackInfo currentMappedTrackInfo = this.h0.getCurrentMappedTrackInfo();
if (currentMappedTrackInfo == null || this.a3 == null || currentMappedTrackInfo.getTrackGroups(2).isEmpty()) {
this.l0 = "false";
} else {
this.l0 = "true";
}
}
return this.l0;
}
public void Q3(boolean z2, String str) {
if (z2 && hd.e.n.booleanValue()) {
hd.e.n = Boolean.FALSE;
V2();
return;
}
TextView textView = this.p3;
if (textView != null) {
textView.setVisibility(z2 ? 0 : 4);
ImageView imageView = this.n3;
if (imageView != null) {
imageView.setVisibility(z2 ? 0 : 8);
}
this.p3.setText(str);
this.c4 = z2;
if (z2 && this.e0.getVideoSurfaceView() != null) {
this.e0.getVideoSurfaceView().setVisibility(4);
}
if (z2 && getActivity().w2() == 2 && this.H0 != 4) {
this.p3.setVisibility(4);
this.m2.setVisibility(0);
ImageView imageView2 = this.n3;
if (imageView2 != null) {
imageView2.setVisibility(8);
}
}
}
tc.j jVar = this.D0;
if (jVar != null) {
if (z2) {
jVar.q0(true);
this.D0.a0();
} else {
jVar.q0(false);
}
}
ImageView imageView3 = this.j3;
if (imageView3 != null) {
imageView3.setVisibility(8);
}
}
public void S1(ContentPage contentPage, String str) {
hd.h.b(b5, "$$$$$ downloadContentDetailThumbnailPreview previewUrl :" + str);
hd.a0.y(getActivity()).S(false);
this.E = new DownloadImageAndVttFile(new WeakReference(getActivity()), contentPage, str, new y0());
}
public void S3(boolean z2) {
this.D0.F0(z2);
}
public void T1() {
this.w4 = -1.0f;
this.v4 = -1.0f;
I3(2131427523, false);
}
public void T3() {
hd.a0 y2 = hd.a0.y(this.J);
long days = TimeUnit.MILLISECONDS.toDays(System.currentTimeMillis() - y2.k().longValue());
Configs c2 = hd.a.a.c(this.J);
if (c2 == null || c2.getShowInAppReviewPopUp() == null || !c2.getShowInAppReviewPopUp().equalsIgnoreCase("true")) {
return;
}
if (y2.l()) {
y2.H(Long.valueOf(System.currentTimeMillis()));
y2.I(false);
W2();
} else if (days >= Integer.parseInt(c2.getShowInAppTimeIntervalInDays())) {
y2.I(false);
y2.H(Long.valueOf(System.currentTimeMillis()));
W2();
}
}
public void U1(String str, long j2, oc.f fVar, ButtonType buttonType) {
if (buttonType == null) {
buttonType = ButtonType.NONE;
}
this.H = buttonType;
if (getActivity() instanceof MainActivity) {
getActivity().a1 = str;
}
if (getActivity() instanceof MainActivity) {
getActivity().J1();
}
hd.a.a.f(OTTApplication.o()).getPageContent(str, new n0(j2, fVar));
}
public void V1(List<PageData> list) {
Section section;
if (this.o3 != null) {
int size = list.size();
int i = 0;
while (true) {
if (i >= size) {
section = null;
break;
}
if (list.get(i).getPaneType().equalsIgnoreCase("section") && list.get(i).getSection() != null && list.get(i).getSection().getSectionInfo() != null && list.get(i).getSection().getSectionInfo().getName() != null && list.get(i).getSection().getSectionInfo().getName().trim().length() > 0 && !list.get(i).getSection().getSectionInfo().getName().trim().toLowerCase().contains("cast") && !list.get(i).getSection().getSectionInfo().getName().trim().toLowerCase().contains("crew")) {
section = list.get(i).getSection();
break;
}
i++;
}
if (section == null || section.getSectionData() == null) {
this.m3.setVisibility(8);
this.p2 = null;
return;
}
List<Card> cards = section.getSectionData().getCards();
this.p2 = cards;
if (cards == null || cards.size() <= 0) {
this.m3.setVisibility(8);
} else {
if (getResources().getConfiguration().orientation != 1) {
this.m3.setVisibility(0);
}
hd.h.b("orientation ", "recommend");
}
this.R.setFilterDuplicates(false);
GridController gridController = this.R;
List<Card> list2 = this.p2;
Integer valueOf = Integer.valueOf(hd.r.O0);
Boolean bool = Boolean.FALSE;
gridController.setData(list2, valueOf, bool);
List<Card> list3 = this.p2;
if (list3 != null && list3.size() + 1 == this.R.getAdapter().E().size()) {
this.R.setData(this.p2, Integer.valueOf(hd.r.O0), bool);
}
v3(this.R);
}
}
public void V3() {
OttLog.error("showOverLayLayoutIfAny", "showOverLayLayoutIfAny");
if (this.V0 == null) {
return;
}
new Handler().postDelayed(new s0(), 0L);
}
public void W2() {
hd.a0.y(this.J);
n7.a a2 = n7.b.a(this.J);
this.G2 = a2;
a2.a().addOnCompleteListener(new tc.g(this));
}
public void Y3() {
m3();
if (Build.VERSION.SDK_INT >= 24) {
n3();
}
X3(true);
this.D0.a0();
this.D0.W();
this.j3.setVisibility(8);
}
@Override
public void a() {
oc.l lVar = this.t0;
if (lVar != null) {
lVar.G();
if (this.N.getVisibility() == 0) {
this.N.setVisibility(8);
}
}
}
public String a2() {
JSONObject jSONObject = new JSONObject();
PreferenceManager g2 = hd.a.a.g(OTTApplication.o());
User loggedUser = g2.getLoggedUser();
try {
jSONObject.put("UUID", g2.getDeviceUniqueId());
jSONObject.put("APPBUILD", hd.h0.b(OTTApplication.o()));
jSONObject.put("USERID", (loggedUser == null || loggedUser.getUserId() == null) ? "" : loggedUser.getUserId());
jSONObject.put("PROFILEID", (loggedUser == null || loggedUser.getProfileId() == null) ? "" : loggedUser.getProfileId());
jSONObject.put("REGIONCODE", "");
jSONObject.put("USERTYPE", "");
jSONObject.put("STOREFRONTID", "");
if (loggedUser != null && loggedUser.getPackages() != null && loggedUser.getPackages().size() > 0) {
User.UserPackage userPackage = (User.UserPackage) loggedUser.getPackages().get(0);
jSONObject.put("SERVICEID", userPackage.getId());
jSONObject.put("BASESUBSCRIPTION", userPackage.getId());
}
jSONObject.put("COLLECTIONID", "");
jSONObject.put("COLLECTIONNAME", "");
jSONObject.put("CONTENTKEY", cc.b.B0().p0() != null ? cc.b.B0().p0() : "");
jSONObject.put("CONTAINERID", cc.e.n().b() != null ? cc.e.n().b() : "-1");
jSONObject.put("TABID", "");
jSONObject.put("CONTAINERNAME", cc.e.n().d() != null ? cc.e.n().d() : "");
jSONObject.put("TABNAME", cc.e.n().t() != null ? cc.e.n().t() : "");
jSONObject.put("SERIESNAME", cc.b.B0().X0() != null ? cc.b.B0().X0() : "");
ExoPlayer exoPlayer = this.g0;
if (exoPlayer != null && exoPlayer.getVideoFormat() != null) {
jSONObject.put("CURRENTBANDWIDTHKB", Math.round((this.g0.getVideoFormat().bitrate / 1000000.0f) * 1024.0f) + " kbps");
if (this.i0 != null) {
jSONObject.put("PREFPLAYBACKQUALITY", tc.k.p(Math.round((this.g0.getVideoFormat().bitrate / 1000000.0f) * 1024.0f), this));
}
}
jSONObject.put("DISPLAY_LANGUAGE", "English");
jSONObject.put("VIDEORESOLUTION", "");
jSONObject.put("SUBTITLELANGUAGE", j2());
jSONObject.put("ISFREEPREVIEW", (cc.e.n().v() == null || !cc.e.n().v().contains("trailer")) ? "false" : "true");
String str = this.r2;
if (str == null) {
str = "";
}
jSONObject.put("ADTYPE", str);
jSONObject.put("ADCLICKURL", Y1() != null ? Y1().toString() : "");
if (getActivity() != null && (getActivity() instanceof MainActivity) && getActivity().A != null) {
jSONObject.put("ISDOWNLOADABLE", getActivity().A.G0());
}
jSONObject.put("PLAYBACKMODE", this.C ? "Landscape" : "Portrait");
jSONObject.put("DEVICEGROUP", Build.MODEL);
jSONObject.put("DEVICEMANUFACTURER", Build.MANUFACTURER);
} catch (JSONException e2) {
hd.h.b("Sravani", e2.getMessage());
}
hd.h.b("Sravani", jSONObject.toString());
return jSONObject.toString();
}
public void b3(String str, String str2, String str3, String str4, String str5, oc.x xVar, xc.a aVar) {
String str6 = str2;
hd.h.a("Offline_Download>>3", "title::" + str6);
D1(this.y0);
hd.h.a("mediaitems", "size::" + this.w.size());
xc.a t2 = aVar == null ? ((OTTApplication) getActivity().getApplication()).t() : aVar;
StreamResponse streamResponse = this.V0;
long j2 = 0;
if (streamResponse != null && streamResponse.getStreamStatus() != null && this.V0.getStreamStatus().getTotalDurationInMillis() != null && this.V0.getStreamStatus().getTotalDurationInMillis().longValue() > 0) {
j2 = this.V0.getStreamStatus().getTotalDurationInMillis().longValue();
}
long j3 = j2;
long currentTimeMillis = System.currentTimeMillis() + hd.d.n;
OfflineDownloadData offlineDownloadData = new OfflineDownloadData();
if (str6 == null) {
str6 = "";
}
offlineDownloadData.N(str6);
offlineDownloadData.L(str3);
offlineDownloadData.E(str5);
offlineDownloadData.M(this.P0);
offlineDownloadData.H(this.J1);
offlineDownloadData.B(this.M1);
offlineDownloadData.w(this.K1);
offlineDownloadData.K(str4);
offlineDownloadData.G(this.E1);
offlineDownloadData.O(str);
offlineDownloadData.y(hd.e0.k0(j3));
offlineDownloadData.F(Boolean.valueOf(this.M3));
MediaDownloadService.h(this.P0, offlineDownloadData);
List<MediaItem> list = this.w;
if (list != null && !list.isEmpty()) {
t2.p(getActivity(), offlineDownloadData, Uri.parse(this.P0), "", this.w.get(0), this.j0, xVar);
}
WithoutInternetOfflineDownloadsEntity withoutInternetOfflineDownloadsEntity = new WithoutInternetOfflineDownloadsEntity();
withoutInternetOfflineDownloadsEntity.O(str);
withoutInternetOfflineDownloadsEntity.M(this.P0);
withoutInternetOfflineDownloadsEntity.E(str5);
withoutInternetOfflineDownloadsEntity.N(str6);
withoutInternetOfflineDownloadsEntity.L(str3);
withoutInternetOfflineDownloadsEntity.H(this.J1);
withoutInternetOfflineDownloadsEntity.w(this.K1);
withoutInternetOfflineDownloadsEntity.K(str4);
withoutInternetOfflineDownloadsEntity.G(this.E1);
withoutInternetOfflineDownloadsEntity.F(Boolean.valueOf(this.M3));
withoutInternetOfflineDownloadsEntity.D(Long.valueOf(currentTimeMillis));
withoutInternetOfflineDownloadsEntity.y(hd.e0.k0(j3));
withoutInternetOfflineDownloadsEntity.A(Boolean.TRUE);
hd.e0.g0(getActivity(), withoutInternetOfflineDownloadsEntity);
}
@Override
public void c(Object obj) {
}
@NonNull
public CastStateListener c2() {
return new r0();
}
public void c3(String str) {
try {
ExoPlayer exoPlayer = this.g0;
if (exoPlayer != null) {
exoPlayer.release();
}
this.I4 = false;
tc.j jVar = this.D0;
if (jVar != null) {
jVar.h0();
this.D0.W();
this.D0.r0(null);
}
View view = this.W2;
if (view != null) {
view.setBackgroundColor(getResources().getColor(2131099708));
this.e0.setOnTouchListener(e3());
}
l3();
Q3(true, str);
} catch (Exception unused) {
}
}
public void c4(java.lang.Object r27, long r28, com.yupptv.ott.enums.ButtonType r30) {
throw new UnsupportedOperationException("Method not decompiled: tc.i.c4(java.lang.Object, long, com.yupptv.ott.enums.ButtonType):void");
}
public DataSource createDataSource() {
return null;
}
public MediaSource createMediaSource(MediaItem mediaItem) {
return null;
}
public void d3() {
if (getActivity() == null || !isAdded() || this.y1.getVisibility() != 0 || !isVisible() || this.F) {
hd.h.b("TAG", "onDismissChromeCast else: " + this.F);
return;
}
AppCompatButton appCompatButton = this.T;
if (appCompatButton == null || appCompatButton.getVisibility() != 0) {
o3();
hd.h.b("TAG", "onDismissChromeCast if: " + this.F);
C2();
this.u1.setRemoteIndicatorDrawable(getResources().getDrawable(2131232444));
this.p0 = true;
m4(true);
c4(this.h1, this.O1, ButtonType.NONE);
}
}
public void d4() {
if (this.R3 != null || TextUtils.isEmpty(this.P3.getText())) {
return;
}
new wc.a().H0(this.n1);
if (this.n1) {
y3(8);
} else {
y3(0);
}
Handler handler = new Handler();
this.R3 = handler;
handler.postDelayed(new tc.h(this), 5000L);
}
@Override
public void e(long j2, long j3) {
tc.j jVar;
hd.h.b(b5, "$$$$$ load preview currentposition :" + j2 + " max :" + j3);
if (!this.D || this.g0 == null || (jVar = this.D0) == null) {
return;
}
jVar.u0(j2);
}
public Object e2() {
return this.h1;
}
public void f3() {
ExoPlayer exoPlayer = this.g0;
if (exoPlayer != null) {
if (exoPlayer != null && exoPlayer.getPlayWhenReady()) {
this.g0.setPlayWhenReady(false);
e1 e1Var = this.s;
if (e1Var != null) {
e1Var.b();
}
}
}
}
public void f4() {
OttLog.error("stateChangedOnCastConnected", "stateChangedOnCastConnected");
cc.c.d().o(cc.b.p1, cc.b.B0().w(true));
onPause();
M3();
}
public void g2(String str) {
a.C0133a c0133a = hd.a.a;
if (c0133a.b(OTTApplication.o()) == null) {
OttSDK.getNewInstance(getActivity(), hd.e.z);
}
StreamResponse streamResponse = this.V0;
if (streamResponse != null) {
if (streamResponse.getAnalyticsInfo() == null || this.V0.getAnalyticsInfo().getContentType() == null || this.V0.getAnalyticsInfo().getDataType() == null || !this.V0.getAnalyticsInfo().getContentType().equalsIgnoreCase("vod") || !this.V0.getAnalyticsInfo().getDataType().equalsIgnoreCase("epg")) {
c0133a.f(OTTApplication.o()).getNextVideo(str, 1, "home", this.U4);
} else {
c0133a.f(OTTApplication.o()).getNextEPGVideo(str, 1, -1, this.U4);
}
}
}
public void g3(boolean z2) {
if (MainActivity.y2()) {
g5 = !z2;
}
}
public void g4() {
Handler handler;
OttLog.error("stopPlayer", "stopPlayer");
CastContext castContext = this.v1;
if (castContext == null || castContext.getCastState() != 4) {
this.J1 = "";
this.M1 = "";
this.I4 = false;
tc.j jVar = this.D0;
if (jVar != null) {
jVar.i0();
this.D0.h0();
}
vc.b bVar = this.x1;
if (bVar != null) {
bVar.M();
}
getActivity().s4(ButtonType.NONE);
ExoPlayer exoPlayer = this.g0;
if (exoPlayer != null) {
exoPlayer.isPlayingAd();
}
View view = this.W2;
if (view != null) {
view.setVisibility(4);
}
if (this.L0.equalsIgnoreCase("true")) {
m3();
} else {
l3();
}
if (Build.VERSION.SDK_INT >= 24) {
n3();
}
StyledPlayerView styledPlayerView = this.e0;
if (styledPlayerView != null && styledPlayerView.getVideoSurfaceView() != null) {
this.e0.getVideoSurfaceView().setVisibility(4);
this.e0.setVisibility(4);
}
this.G3 = false;
this.F3 = false;
} else {
this.v1.removeCastStateListener(this.B1);
this.G3 = true;
StyledPlayerView styledPlayerView2 = this.e0;
if (styledPlayerView2 != null && styledPlayerView2.getVideoSurfaceView() != null) {
this.e0.getVideoSurfaceView().setVisibility(4);
this.e0.setVisibility(4);
}
}
getActivity().C4(0);
Handler handler2 = this.N4;
if (handler2 != null) {
handler2.removeCallbacks(this.O4);
}
if (getActivity() instanceof MainActivity) {
getActivity().J1();
}
AppCompatButton appCompatButton = this.W3;
if (appCompatButton != null) {
appCompatButton.setVisibility(8);
}
CastContext castContext2 = this.v1;
if ((castContext2 == null || castContext2.getCastState() != 4) && (handler = this.o2) != null) {
handler.removeCallbacks(this.L4);
}
}
public int[] getSupportedTypes() {
return new int[0];
}
@Override
public void i(int i) {
}
public void i2(boolean z2) {
DefaultTrackSelector defaultTrackSelector;
tc.j jVar;
if (!z2 && (jVar = this.D0) != null) {
jVar.p0.setVisibility(8);
this.D0.q0.setVisibility(8);
}
if (z2) {
this.X2.setVisibility(this.e4 ? 0 : 8);
this.f3.setVisibility(0);
} else {
this.X2.setVisibility(8);
this.f3.setVisibility(8);
this.u3.setVisibility(8);
}
ExoPlayer exoPlayer = this.g0;
if (exoPlayer != null && exoPlayer.getVideoFormat() != null) {
hd.h.b("Playing ", "Bitrate : " + this.g0.getVideoFormat().bitrate);
}
if (z2 && hd.e0.h0(getActivity()) && this.v2 == null) {
StreamResponse streamResponse = this.V0;
if (streamResponse != null) {
streamResponse.getAnalyticsInfo().getContentType().equalsIgnoreCase("live");
}
hd.h.b("Playing ", "recommend");
List<Card> list = this.p2;
if (list == null || list.size() <= 0) {
this.m3.setVisibility(8);
} else {
if (getResources().getConfiguration().orientation != 1) {
this.m3.setVisibility(0);
}
hd.h.b("orientation ", "recommend");
}
} else {
this.i3.setVisibility(8);
this.m3.setVisibility(8);
this.W3.setVisibility(8);
}
ImageView imageView = this.Z2;
if (imageView == null) {
imageView.setVisibility(8);
this.a3.setVisibility(0);
} else if (!this.m0 || (!this.p1 && ((defaultTrackSelector = this.h0) == null || defaultTrackSelector.getCurrentMappedTrackInfo() == null || this.h0.getCurrentMappedTrackInfo().getTrackGroups(2) == null || this.h0.getCurrentMappedTrackInfo().getTrackGroups(2).length <= 0))) {
this.Z2.setVisibility(8);
this.a3.setVisibility(0);
} else {
this.Z2.setVisibility(8);
}
C4();
}
public void i3() {
List cards;
if (this.s1) {
return;
}
this.s1 = true;
if (getActivity() == null || getActivity().isFinishing()) {
return;
}
new ArrayList();
this.V3.setEnabled(false);
Section.SectionData sectionData = this.d1;
if (sectionData == null || (cards = sectionData.getCards()) == null || this.d1.getCards().size() <= 0) {
this.s1 = false;
X3(true);
} else {
this.s1 = false;
hd.u.t0(getActivity(), ((Card) cards.get(0)).getTarget().getPath());
}
}
public void i4(boolean z2) {
tc.j jVar = this.D0;
if (jVar != null) {
jVar.Q0(z2);
}
}
public void k4() {
if (this.T.getVisibility() == 0) {
return;
}
LinearLayout linearLayout = this.N;
if (linearLayout != null && linearLayout.getVisibility() == 0) {
this.N.setVisibility(8);
return;
}
tc.j jVar = this.D0;
if (jVar != null) {
if (this.T1) {
jVar.R0();
} else {
jVar.S0();
}
}
}
@Override
public void l(Object obj, int i) {
View view;
Card card;
if ((obj instanceof Card) && (card = (Card) obj) != null) {
if (card.getTarget().getPath().equalsIgnoreCase(getActivity().a1)) {
if (this.N.getVisibility() == 0) {
G2(this.N);
return;
}
return;
}
if (card.getTarget().getPageType().equalsIgnoreCase("details")) {
this.J4 = true;
}
this.I2.b2("Recommendations");
if (card.getTarget() != null && card.getTarget().getPageAttributes() != null) {
this.I2.J1(card.getTarget().getPageAttributes().getMediaContentType() != null ? card.getTarget().getPageAttributes().getMediaContentType() : com.yupptv.ott.a.I);
}
cc.c d2 = cc.c.d();
cc.b bVar = this.I2;
d2.s("Recommendations", bVar.G(bVar.Z0(), (card.getDisplay() == null || card.getDisplay().getTitle() == null) ? com.yupptv.ott.a.I : card.getDisplay().getTitle(), this.I2.D0()));
}
this.D0.V0(cc.c.t0, cc.c.o1, obj);
if (!this.J4 && (view = this.D0.J) != null) {
view.setVisibility(0);
}
getActivity().D4(cc.c.o1);
getActivity().s4(ButtonType.NONE);
getActivity().H2(obj);
if (this.N.getVisibility() == 0) {
G2(this.N);
}
}
public void m4(boolean z2) {
if (this.g0 != null && isAdded() && getActivity() != null && getActivity().w2() != 0) {
CastContext castContext = this.v1;
if (castContext == null || castContext.getCastState() != 4) {
this.g0.setPlayWhenReady(z2);
} else {
HashMap<String, Object> h02 = cc.b.B0().h0(null);
h02.put(cc.a.C, Boolean.TRUE);
h02.put(cc.a.d, cc.b.B0().Z0());
h02.put(cc.a.p, cc.b.B0().r0());
this.g0.setPlayWhenReady(false);
}
}
CastContext castContext2 = this.v1;
if (castContext2 == null || castContext2.getCastState() != 4) {
ec.c cVar = this.A1;
if (cVar == null || !cVar.K()) {
C2();
}
}
}
public void o3() {
if (this.n2 == null || getActivity() == null) {
return;
}
getActivity().F4("");
a.C0133a c0133a = hd.a.a;
if (c0133a.b(OTTApplication.o()).getUserManager() != null) {
c0133a.b(OTTApplication.o()).getUserManager().removedStreamActiveSession(this.n2.getStreamPollKey(), new n());
}
}
public void onActivityCreated(Bundle bundle) {
super.onActivityCreated(bundle);
try {
this.K = new uc.c(this.J);
} catch (Exception unused) {
}
if (getActivity() != null) {
K2();
if (hd.e0.j) {
this.W = hd.g0.b(getActivity());
} else {
this.W = false;
}
if (this.W) {
CastButtonFactory.setUpMediaRouteButton(getActivity(), this.u1);
this.v1 = CastContext.getSharedInstance(getActivity());
CastStateListener c2 = c2();
this.B1 = c2;
this.v1.addCastStateListener(c2);
this.v1.getCastOptions().getEnableReconnectionService();
}
}
}
public void onAttach(Context context) {
super.onAttach(context);
if (getActivity() != null) {
this.J = getActivity();
}
}
public void onAttachFragment(Fragment fragment) {
super.onAttachFragment(fragment);
}
public void onAudioAttributesChanged(AudioAttributes audioAttributes) {
h2.a(this, audioAttributes);
}
public void onAudioSessionIdChanged(int i) {
h2.b(this, i);
}
public void onAvailableCommandsChanged(Player.Commands commands) {
h2.c(this, commands);
}
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
hd.a0.y(getContext());
int i = getContext().getResources().getConfiguration().uiMode & 48;
int i2 = OTTApplication.h0;
if (!hd.e0.i && this.I4 && isVisible() && !this.J4) {
z4(false);
}
OTTApplication.h0 = i;
this.J4 = false;
}
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
getActivity().getWindow().setFlags(8192, 8192);
this.p0 = true;
this.X = getFragmentManager();
this.Y = new Handler();
CookieHandler cookieHandler = CookieHandler.getDefault();
CookieManager cookieManager = j5;
if (cookieHandler != cookieManager) {
CookieHandler.setDefault(cookieManager);
}
}
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
this.W2 = layoutInflater.inflate(2131624109, viewGroup, false);
setHasOptionsMenu(true);
this.y0 = new Bundle();
D3(this.W2);
this.C0 = (RelativeLayout) this.W2.findViewById(2131429076);
this.p3 = (TextView) this.W2.findViewById(2131428118);
ImageView imageView = (ImageView) this.W2.findViewById(2131428117);
this.n3 = imageView;
imageView.setOnClickListener(this.H4);
this.j3 = (ImageView) this.W2.findViewById(2131430001);
this.k3 = (RelativeLayout) this.W2.findViewById(2131430000);
this.q4 = (RelativeLayout) this.W2.findViewById(2131428242);
this.r4 = (RelativeLayout) this.W2.findViewById(2131429168);
this.W0 = new JSONObject();
this.y1 = (FrameLayout) this.W2.findViewById(2131427767);
MediaRouteButton findViewById = this.W2.findViewById(2131428697);
this.u1 = findViewById;
if (com.yupptv.ott.a.P && hd.e0.j) {
findViewById.setVisibility(0);
} else {
findViewById.setVisibility(8);
}
try {
if (getActivity() != null) {
CastContext.getSharedInstance(getActivity());
}
} catch (Exception unused) {
}
this.F4 = new hd.p();
this.I2 = cc.b.B0();
this.v0 = false;
this.y3 = (TextView) this.W2.findViewById(2131428931);
this.z3 = (TextView) this.W2.findViewById(2131429157);
this.y3.setOnClickListener(this.H4);
this.z3.setOnClickListener(this.H4);
this.s3 = (RelativeLayout) this.W2.findViewById(2131428928);
this.C3 = (ImageView) this.W2.findViewById(2131428926);
this.w3 = (TextView) this.W2.findViewById(2131428929);
this.A3 = (TextView) this.W2.findViewById(2131427816);
this.s4 = (CircularProgressIndicator) this.W2.findViewById(2131429768);
this.t4 = (TextView) this.W2.findViewById(2131429769);
this.u4 = (FrameLayout) this.W2.findViewById(2131429767);
this.x3 = (TextView) this.W2.findViewById(2131427553);
this.D3 = (ImageView) this.W2.findViewById(2131429150);
this.t3 = (LinearLayout) this.W2.findViewById(2131427557);
this.u3 = (LinearLayout) this.W2.findViewById(2131429898);
this.B3 = (TextView) this.W2.findViewById(2131429363);
this.z0 = (TextView) this.W2.findViewById(2131428935);
this.E3 = (ImageView) this.W2.findViewById(2131428932);
this.s3.setOnClickListener(this.H4);
this.s3.setVisibility(8);
this.D3.setOnClickListener(new r());
this.t3.setOnClickListener(new b0());
this.E3.setOnClickListener(new m0());
this.Y2 = (ImageView) this.W2.findViewById(2131429711);
this.f3 = (ImageView) this.W2.findViewById(2131429176);
this.g3 = (ImageView) this.W2.findViewById(2131429191);
this.e3 = (ImageView) this.W2.findViewById(com.yupptv.ott.a.V ? 2131429568 : 2131429188);
this.Z2 = (ImageView) this.W2.findViewById(2131429160);
this.l3 = (RelativeLayout) this.W2.findViewById(2131428557);
this.a3 = (ImageView) this.W2.findViewById(2131429178);
ImageView imageView2 = (ImageView) this.W2.findViewById(com.yupptv.ott.a.V ? 2131429185 : 2131429184);
this.d3 = imageView2;
imageView2.setVisibility(0);
this.h3 = (ImageView) this.W2.findViewById(2131428201);
this.i3 = (ImageView) this.W2.findViewById(2131427753);
this.b3 = (ImageView) this.W2.findViewById(2131429181);
this.c3 = (ImageView) this.W2.findViewById(2131429174);
this.W3 = this.W2.findViewById(2131429699);
Configs c2 = hd.a.a.c(getActivity());
if (c2 != null && c2.getSupportedVideoAnalytics() != null && !c2.getSupportedVideoAnalytics().isEmpty()) {
try {
JSONObject jSONObject = new JSONObject(c2.getSupportedVideoAnalytics());
if (jSONObject.has("isV2AnalyticsSupport")) {
hd.h.a(b5, "onCreateView:videograph isV2AnalyticsSupport=" + jSONObject.getBoolean("isV2AnalyticsSupport"));
com.yupptv.ott.a.o = jSONObject.getBoolean("isV2AnalyticsSupport");
}
if (jSONObject.has("isVideoGraphAnalyticsSupport")) {
hd.h.a(b5, "onCreateView:videograph isVideoGraphAnalyticsSupport=" + jSONObject.getBoolean("isVideoGraphAnalyticsSupport"));
com.yupptv.ott.a.p = jSONObject.getBoolean("isVideoGraphAnalyticsSupport");
}
} catch (JSONException unused2) {
}
}
com.yupptv.ott.a.Z = (c2 == null || c2.getShowpreviewthumbnails() == null || !c2.getShowpreviewthumbnails().equalsIgnoreCase("true")) ? false : true;
this.J3 = c2.getTakeAtestButtonText() != null ? c2.getTakeAtestButtonText() : "Take a Test";
this.W3.setOnClickListener(this.H4);
this.b3.setOnClickListener(this.H4);
this.c3.setOnClickListener(this.H4);
this.d3.setOnClickListener(this.H4);
this.e3.setOnClickListener(this.H4);
this.h3.setOnClickListener(this.H4);
this.i3.setOnClickListener(this.H4);
this.Z2.setOnClickListener(new u0());
this.a3.setOnClickListener(new a1());
ImageView imageView3 = (ImageView) this.W2.findViewById(2131429179);
this.m3 = imageView3;
imageView3.setVisibility(8);
this.m3.setOnClickListener(new b1());
this.B3.setOnClickListener(new c1());
ImageView imageView4 = (ImageView) this.W2.findViewById(2131429186);
this.X2 = imageView4;
imageView4.setOnClickListener(new d1());
AppCompatButton findViewById2 = this.W2.findViewById(2131429942);
this.U = findViewById2;
findViewById2.setVisibility(8);
this.U.setOnClickListener(new b());
View findViewById3 = this.W2.findViewById(2131428757);
this.f4 = findViewById3;
ImageView imageView5 = (ImageView) findViewById3.findViewById(2131429152);
this.g4 = imageView5;
imageView5.setOnClickListener(this.H4);
ImageView imageView6 = (ImageView) this.f4.findViewById(2131429104);
this.i4 = imageView6;
imageView6.setOnClickListener(this.H4);
ImageView imageView7 = (ImageView) this.f4.findViewById(2131429352);
this.h4 = imageView7;
imageView7.setOnClickListener(this.H4);
ImageView imageView8 = (ImageView) this.f4.findViewById(2131427789);
this.j4 = imageView8;
imageView8.setOnClickListener(this.H4);
this.k4 = (RelativeLayout) this.W2.findViewById(2131429169);
this.l4 = (ImageView) this.W2.findViewById(2131429158);
this.m4 = (ImageView) this.W2.findViewById(2131429167);
this.n4 = (TextView) this.W2.findViewById(2131429171);
this.o4 = (TextView) this.W2.findViewById(2131429170);
this.p4 = (TextView) this.W2.findViewById(2131429177);
this.l4.setOnClickListener(this.H4);
ImageView imageView9 = (ImageView) this.W2.findViewById(2131429180);
this.b4 = imageView9;
imageView9.setVisibility(8);
RecyclerView findViewById4 = this.W2.findViewById(2131429339);
this.O = findViewById4;
findViewById4.setHasFixedSize(false);
this.O.setRecycledViewPool(this.Q);
this.O.setNestedScrollingEnabled(true);
if (getActivity() != null) {
this.P = new LinearLayoutManager(getActivity(), 1, false);
}
if (Build.VERSION.SDK_INT >= 23) {
this.O.setOnScrollChangeListener(new c());
}
this.O.setLayoutManager(this.P);
GridController gridController = new GridController(this);
this.R = gridController;
gridController.setFilterDuplicates(false);
LinearLayout linearLayout = (LinearLayout) this.W2.findViewById(2131429338);
this.N = linearLayout;
linearLayout.setVisibility(8);
ImageView imageView10 = (ImageView) this.W2.findViewById(2131429180);
this.G0 = imageView10;
imageView10.setOnClickListener(new d());
this.A0 = (TextView) this.W2.findViewById(2131428934);
AppCompatButton findViewById5 = this.W2.findViewById(2131429182);
this.T = findViewById5;
findViewById5.setVisibility(8);
this.T.setOnClickListener(new e());
if (getActivity() != null) {
this.D0 = new tc.j(getActivity(), this.C0, this);
}
tc.j jVar = this.D0;
if (jVar != null) {
jVar.r0(this);
this.D0.W();
this.D0.z0(new f());
}
this.N3 = (TextView) this.W2.findViewById(2131428581);
this.O3 = (TextView) this.W2.findViewById(2131428580);
this.T3 = this.W2.findViewById(2131427641);
this.U3 = this.W2.findViewById(2131427643);
this.Y3 = this.W2.findViewById(2131429537);
this.Z3 = (FrameLayout) this.W2.findViewById(2131429985);
this.a4 = (TextView) this.W2.findViewById(2131429986);
this.S3 = (RelativeLayout) this.W2.findViewById(2131428690);
this.P3 = (TextView) this.W2.findViewById(2131427842);
this.Q3 = (TextView) this.W2.findViewById(2131427840);
this.V3 = this.W2.findViewById(2131427636);
this.X3 = this.W2.findViewById(2131427638);
this.T3.setOnClickListener(this.H4);
this.U3.setOnClickListener(this.H4);
this.V3.setOnClickListener(this.H4);
this.Y3.setOnClickListener(this.H4);
this.Z3.setOnClickListener(this.H4);
this.X3.setOnClickListener(this.H4);
this.W2.setVisibility(4);
this.d = getResources().getStringArray(2130903072);
this.e = getResources().getStringArray(2130903071);
this.E2 = false;
this.F2 = false;
this.f3.setOnClickListener(new tc.c(this));
this.g3.setOnClickListener(new tc.b(this));
return this.W2;
}
public void onCues(CueGroup cueGroup) {
h2.d(this, cueGroup);
}
public void onCues(List list) {
h2.e(this, list);
}
public void onDestroy() {
k3();
super.onDestroy();
p4();
o3();
}
public void onDestroyView() {
super.onDestroyView();
if (Build.VERSION.SDK_INT >= 24) {
n3();
}
}
public void onDetach() {
super.onDetach();
DownloadImageAndVttFile downloadImageAndVttFile = this.E;
if (downloadImageAndVttFile != null) {
downloadImageAndVttFile.u(true);
}
}
public void onDeviceInfoChanged(DeviceInfo deviceInfo) {
h2.f(this, deviceInfo);
}
public void onDeviceVolumeChanged(int i, boolean z2) {
h2.g(this, i, z2);
}
public void onDownstreamFormatChanged(int i, MediaSource.MediaPeriodId mediaPeriodId, MediaLoadData mediaLoadData) {
hd.h.b("Ads ::", "onDownstreamFormatChanged");
}
public void onEvents(Player player, Player.Events events) {
h2.h(this, player, events);
}
public void onIsLoadingChanged(boolean z2) {
h2.i(this, z2);
}
public void onIsPlayingChanged(boolean z2) {
ExoPlayer exoPlayer;
hd.k0 k0Var = this.Y0;
if (k0Var != null) {
k0Var.h(z2, this.H0);
}
if (com.yupptv.ott.a.p && z2 && (exoPlayer = this.g0) != null && exoPlayer.getVideoFormat() != null) {
int round = Math.round((this.g0.getVideoFormat().bitrate / 1000000.0f) * 1024.0f);
yc.a aVar = this.Z0;
if (aVar != null) {
aVar.p(round);
}
nd.a aVar2 = this.a1;
if (aVar2 != null) {
aVar2.p(round);
}
}
nd.a aVar3 = this.a1;
if (aVar3 != null) {
aVar3.onPlayWhenReadyChanged(z2, this.H0);
}
}
public void onLoadCanceled(int i, MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) {
hd.h.b("Ads ::", "onLoadCanceled");
}
public void onLoadCompleted(int i, MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) {
hd.h.b("Ads ::", "onLoadCompleted");
}
public void onLoadError(int i, MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData, IOException iOException, boolean z2) {
hd.h.b("Ads ::", "onLoadError");
}
public void onLoadStarted(int i, MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) {
hd.h.b("Ads ::", "onLoadStarted");
}
public void onLoadingChanged(boolean z2) {
}
public void onMaxSeekToPreviousPositionChanged(long j2) {
h2.l(this, j2);
}
public void onMediaItemTransition(MediaItem mediaItem, int i) {
h2.m(this, mediaItem, i);
}
public void onMediaMetadataChanged(MediaMetadata mediaMetadata) {
h2.n(this, mediaMetadata);
}
public void onMetadata(Metadata metadata) {
h2.o(this, metadata);
}
public void onPause() {
super.onPause();
if (!isAdded() || Util.SDK_INT > 23 || getActivity() == null || getActivity().w2() <= 0) {
return;
}
this.a2 = false;
this.Y1 = false;
ExoPlayer exoPlayer = this.g0;
if (exoPlayer != null) {
if (!(exoPlayer != null && exoPlayer.getPlayWhenReady())) {
this.Y1 = true;
}
}
this.Z1 = true;
m4(false);
if (this.r != null) {
g3(false);
}
l3();
CountDownTimer countDownTimer = this.E0;
if (countDownTimer != null) {
countDownTimer.cancel();
}
this.E0 = null;
}
public void onPlayWhenReadyChanged(boolean z2, int i) {
e1 e1Var;
this.b1 = z2;
this.c1 = i;
if (z2) {
j3();
}
if (this.H0 == 3) {
if (z2) {
this.J2 = System.currentTimeMillis();
TimeUnit.MILLISECONDS.toSeconds(this.K2);
} else {
F4();
}
}
nd.a aVar = this.a1;
if (aVar != null) {
aVar.onPlayWhenReadyChanged(z2, this.H0);
this.a1.onPlaybackStateChanged(this.H0);
}
hd.k0 k0Var = this.Y0;
if (k0Var != null) {
k0Var.h(z2, this.H0);
}
if (MainActivity.A3 && (e1Var = this.s) != null) {
if (z2) {
e1Var.a();
} else {
e1Var.b();
}
}
if (i == 4) {
if (MainActivity.A3) {
((MainActivity) getActivity()).moveTaskToBack(false);
}
this.l1 = false;
if (this.G3 && this.I) {
this.L0 = "true";
i3();
cc.c.d().o(cc.b.v1, cc.b.B0().c(this.d1));
} else {
Y3();
}
}
if (i == 3) {
if (getActivity() != null && (getActivity() instanceof MainActivity) && getActivity().w2() == 0) {
getActivity().C4(1);
}
if (this.g0 != null) {
hd.h.b(b5, "Max dvr time " + this.g0.getDuration());
}
hd.e.n = Boolean.FALSE;
this.L0 = "false";
if (this.q2) {
this.q2 = false;
}
ButtonType buttonType = this.H;
if (buttonType != null && buttonType == ButtonType.START_OVER && this.b2) {
this.b2 = false;
Z3();
}
if (this.r1) {
this.r1 = false;
OttLog.error("isInitPlay", "++++++" + this.n1);
this.D0.H0(this.n1);
}
this.j3.setVisibility(8);
tc.k kVar = this.i0;
if (kVar != null) {
if (this.k0) {
kVar.r(this.f1);
this.i0.q(this.g1);
if (this.i0.k(this.h0.getCurrentMappedTrackInfo())) {
this.k0 = true;
if (getActivity() != null && !getActivity().isFinishing()) {
this.Z2.setImageDrawable(getActivity().getResources().getDrawable(2131231904));
}
}
} else {
kVar.j();
this.k0 = false;
this.Z2.setImageDrawable(this.J.getResources().getDrawable(2131231903));
}
}
if (this.n2 != null) {
if (this.f2) {
this.f2 = false;
u3(ConcurrentStreamStatus.POLL);
}
M2();
}
if (getActivity() != null && getActivity().r2) {
m4(false);
}
}
q4();
}
public void onPlaybackParametersChanged(PlaybackParameters playbackParameters) {
}
public void onPlaybackStateChanged(int i) {
yc.a aVar;
hd.k0 k0Var;
nd.a aVar2;
nd.a aVar3;
this.H0 = i;
this.D2 = X1();
if (!this.T1 && !this.F2) {
A2("video_impression");
}
if (this.g0 != null && (aVar3 = this.a1) != null) {
aVar3.onPlayWhenReadyChanged(this.b1, this.c1);
this.a1.onPlaybackStateChanged(i);
}
F4();
if (i == 4) {
hd.e.P = true;
hd.e.O = false;
this.v3.setVisibility(8);
HashMap<String, Object> h02 = cc.b.B0().h0(null);
h02.put(cc.a.I, hd.j.a(this.g0.getCurrentPosition()));
h02.put(cc.a.H, 0);
if (this.g0.getDuration() > 0) {
h02.put(cc.a.L, Double.valueOf(hd.e0.R(this.g0.getCurrentPosition(), this.g0.getDuration())));
}
cc.c.d().q(cc.a.c, q2(h02));
HashMap hashMap = new HashMap();
if (this.g0 != null) {
cc.c.d().t("video_stream", cc.b.B0().k("video_stream", this.g0.getCurrentPosition(), this.g0.getDuration(), this.T2));
cc.c d2 = cc.c.d();
String str = cc.b.u1;
cc.b B0 = cc.b.B0();
String str2 = this.L1;
long j2 = this.K2;
long duration = this.g0.getDuration();
CastContext castContext = this.v1;
d2.o(str, B0.l(str2, j2, duration, Boolean.valueOf(castContext != null && castContext.getCastState() == 4), this.C4, this.g0.getPlaybackParameters().speed, O2(), true, 0L));
cc.c.d().v(cc.a.z0, cc.b.B0().j());
}
long seconds = TimeUnit.MILLISECONDS.toSeconds(this.K2);
hashMap.put(AppMeasurementSdk.ConditionalUserProperty.VALUE, String.valueOf(seconds));
hashMap.put("carousal_name", this.N2);
hashMap.put("carousal_position", "" + this.U2);
hashMap.put("content_position", "" + this.V2);
hashMap.put("target_path", "" + this.O2);
hashMap.put("tabName", "" + this.P2);
hashMap.put("tracking_id", this.Q2);
hashMap.put("origin_medium", this.S2);
hashMap.put("origin_source", this.R2);
hashMap.put("contentAudioLanguage", d2());
if (cc.e.n().q() != null && !cc.e.n().q().isEmpty()) {
hashMap.put("tabName", cc.e.n().q());
cc.e.n().N("");
}
if (seconds > 0) {
hd.u.E0(this.J, hashMap);
}
this.N2 = "";
this.U2 = 0;
this.V2 = 0;
this.O2 = "";
this.P2 = "";
this.Q2 = "";
this.S2 = "";
this.R2 = "";
cc.e.n().w("");
if (this.g0 != null && (aVar2 = this.a1) != null) {
aVar2.onPlaybackStateChanged(i);
}
ExoPlayer exoPlayer = this.g0;
if (exoPlayer != null && (k0Var = this.Y0) != null) {
k0Var.h(exoPlayer.isPlaying(), i);
}
if (MainActivity.A3) {
((MainActivity) getActivity()).moveTaskToBack(false);
}
this.l1 = false;
if (!this.v) {
if (this.G3 && this.I) {
this.L0 = "true";
i3();
cc.c.d().o(cc.b.v1, cc.b.B0().c(this.d1));
} else {
Y3();
}
}
T3();
}
if (i == 3) {
if (this.v && !this.U1) {
if (g5) {
g3(true);
} else {
ExoPlayer exoPlayer2 = this.g0;
if (exoPlayer2 != null) {
long duration2 = (this.w2 <= exoPlayer2.getDuration() || this.n1) ? this.w2 : this.g0.getDuration();
this.w2 = duration2;
h5 = duration2;
}
}
}
if (hd.e0.i) {
A3(120);
}
TimeUnit.MILLISECONDS.toSeconds(this.K2);
ExoPlayer exoPlayer3 = this.g0;
if (exoPlayer3 != null && !exoPlayer3.isPlayingAd() && (aVar = this.Z0) != null && !this.n1) {
aVar.r(this.g0.getDuration() > 0 ? this.g0.getDuration() : -1L);
}
ExoPlayer exoPlayer4 = this.g0;
boolean z2 = exoPlayer4 != null && exoPlayer4.getPlayWhenReady();
this.N2 = cc.e.n().d();
this.U2 = cc.e.n().c();
this.V2 = cc.e.n().j();
this.O2 = cc.e.n().v();
this.P2 = cc.e.n().t();
this.Q2 = cc.e.n().u();
this.R2 = (cc.e.n().p() == null || cc.e.n().p().isEmpty()) ? "AppOpen" : cc.e.n().p();
this.S2 = (cc.e.n().o() == null || cc.e.n().o().isEmpty()) ? "carousel" : cc.e.n().o();
if (cc.e.n().q() != null && !cc.e.n().q().isEmpty()) {
this.P2 = cc.e.n().q();
}
if (z2) {
this.M2 = System.currentTimeMillis() - this.L2;
this.J2 = System.currentTimeMillis();
HashMap<String, Object> h03 = cc.b.B0().h0(null);
h03.put(cc.a.I, 0);
h03.put(cc.a.H, hd.j.a(this.M2));
h03.put(cc.a.L, 0);
cc.c.d().q(cc.a.c, q2(h03));
}
if (this.g0 != null) {
hd.h.b(b5, "Max dvr time " + this.g0.getDuration());
}
cc.b.B0().X1(cc.e.n().d() != null ? cc.e.n().d() : com.yupptv.ott.a.I);
ContentPage contentPage = this.o3;
if (contentPage != null && contentPage.getPageInfo() != null) {
this.M4 = this.o3.getPageInfo();
}
PageInfo pageInfo = this.M4;
if (pageInfo == null || pageInfo.getAttributes() == null) {
this.I2.J1(com.yupptv.ott.a.I);
this.I2.M1(com.yupptv.ott.a.I);
this.I2.Z1(com.yupptv.ott.a.I);
this.I2.G1(com.yupptv.ott.a.I);
this.I2.D1(com.yupptv.ott.a.I);
this.I2.W1(com.yupptv.ott.a.I);
} else {
this.I2.Z1(this.M4.getAttributes().getTvShowName() != null ? this.M4.getAttributes().getTvShowName() : com.yupptv.ott.a.I);
this.I2.J1(this.M4.getAttributes().getMediaContentType() != null ? this.M4.getAttributes().getMediaContentType() : com.yupptv.ott.a.I);
this.I2.M1(this.M4.getAttributes().getPayType() != null ? this.M4.getAttributes().getPayType() : com.yupptv.ott.a.I);
this.I2.G1(this.M4.getAttributes().getGenre() != null ? this.M4.getAttributes().getGenre() : com.yupptv.ott.a.I);
this.I2.W1(this.M4.getAttributes().getSeasonSeqNo() != null ? this.M4.getAttributes().getSeasonSeqNo() : com.yupptv.ott.a.I);
this.I2.D1(this.M4.getAttributes().getEpisodeSeqNo() != null ? this.M4.getAttributes().getEpisodeSeqNo() : com.yupptv.ott.a.I);
}
cc.b bVar = this.I2;
String str3 = this.L1;
if (str3 == null) {
str3 = com.yupptv.ott.a.I;
}
bVar.v1(str3);
ExoPlayer exoPlayer5 = this.g0;
if (exoPlayer5 != null && !exoPlayer5.isPlayingAd()) {
cc.c d3 = cc.c.d();
cc.b bVar2 = this.I2;
d3.s("Player_Page", bVar2.B(bVar2.m0(), this.I2.D0(), this.I2.V0(), this.I2.Z0(), this.I2.J0(), this.I2.m0(), Math.round((this.g0.getCurrentPosition() * 100) / this.g0.getDuration())));
cc.c d4 = cc.c.d();
cc.b bVar3 = this.I2;
d4.s("Video_Play_Content", bVar3.k0(bVar3.I0(), this.I2.A0(), this.I2.V0(), this.I2.D0(), this.I2.m0(), this.I2.X0(), this.I2.m0(), this.I2.J0(), this.I2.V0(), this.O2));
}
hd.e.n = Boolean.FALSE;
this.L0 = "false";
if (this.q2) {
this.q2 = false;
}
ButtonType buttonType = this.H;
if (buttonType != null && buttonType == ButtonType.START_OVER && this.b2) {
this.b2 = false;
Z3();
}
if (this.r1) {
this.r1 = false;
OttLog.error("isInitPlay", "++++++" + this.n1);
this.D0.H0(this.n1);
this.T2 = d2();
d4();
}
this.j3.setVisibility(8);
if (this.k0) {
this.i0.r(this.f1);
this.i0.q(this.g1);
if (this.i0.k(this.h0.getCurrentMappedTrackInfo())) {
this.k0 = true;
if (getActivity() != null && !getActivity().isFinishing()) {
this.Z2.setImageDrawable(getActivity().getResources().getDrawable(2131231904));
}
}
} else {
this.i0.j();
this.k0 = false;
this.Z2.setImageDrawable(this.J.getResources().getDrawable(2131231903));
}
if (this.n2 != null) {
if (this.f2) {
this.f2 = false;
u3(ConcurrentStreamStatus.POLL);
}
M2();
}
if (getActivity() != null && getActivity().r2) {
m4(false);
}
if (!this.T1 && !this.E2) {
A2("video_view");
}
if (getActivity() != null && (getActivity() instanceof MainActivity) && getActivity().w2() == 0) {
getActivity().C4(1);
}
}
if (i == 2) {
this.L2 = System.currentTimeMillis();
TimeUnit.MILLISECONDS.toSeconds(this.K2);
ExoPlayer exoPlayer6 = this.g0;
if (exoPlayer6 != null) {
exoPlayer6.getPlayWhenReady();
}
F4();
if (this.v && this.r != null) {
g3(false);
}
if (getActivity() != null && (getActivity() instanceof MainActivity) && getActivity().w2() == 0) {
getActivity().C4(1);
}
}
}
public void onPlaybackSuppressionReasonChanged(int i) {
h2.s(this, i);
}
public void onPlayerError(PlaybackException playbackException) {
int i;
ExoPlayer exoPlayer;
ExoPlayer exoPlayer2;
hd.k0 k0Var = this.Y0;
if (k0Var != null) {
k0Var.i(playbackException.getCause().getMessage());
}
nd.a aVar = this.a1;
if (aVar != null) {
aVar.q(playbackException.getCause().getMessage());
}
HashMap hashMap = new HashMap();
if (getActivity() != null && playbackException.getCause() != null && playbackException.getCause().getMessage() != null && (exoPlayer2 = this.g0) != null) {
this.s0 = exoPlayer2.getCurrentPosition();
if (!hd.v.d(getActivity())) {
Q3(true, getActivity().getResources().getString(2131952922));
this.B3.setVisibility(0);
return;
} else if (playbackException.getCause().getMessage().contains("http") || playbackException.getCause().getMessage().contains("NullPointerException")) {
Q3(true, getActivity().getResources().getString(2131952921));
} else {
Q3(true, playbackException.getCause().getMessage());
}
}
F4();
hashMap.put(AppMeasurementSdk.ConditionalUserProperty.VALUE, String.valueOf(TimeUnit.MILLISECONDS.toSeconds(this.K2)));
hashMap.put("carousal_name", this.N2);
hashMap.put("carousal_position", "" + this.U2);
hashMap.put("content_position", "" + this.V2);
hashMap.put("target_path", "" + this.O2);
hashMap.put("tabName", "" + this.P2);
hashMap.put("tracking_id", this.Q2);
hashMap.put("origin_medium", this.S2);
hashMap.put("origin_source", this.R2);
hashMap.put("contentAudioLanguage", d2());
if (cc.e.n().q() != null && !cc.e.n().q().isEmpty()) {
hashMap.put("tabName", cc.e.n().q());
cc.e.n().N("");
}
hd.u.E0(this.J, hashMap);
this.N2 = "";
this.U2 = 0;
this.V2 = 0;
this.O2 = "";
this.P2 = "";
this.Q2 = "";
this.S2 = "";
this.R2 = "";
cc.e.n().w("");
ExoPlayer exoPlayer3 = this.g0;
if (exoPlayer3 != null) {
exoPlayer3.isPlayingAd();
}
ExoPlaybackException exoPlaybackException = (ExoPlaybackException) playbackException;
if (N2(exoPlaybackException) && (exoPlayer = this.g0) != null && this.y0 != null) {
exoPlayer.release();
this.g0 = null;
L2(this.y0);
return;
}
if (exoPlaybackException.type == 1) {
MediaCodecRenderer.DecoderInitializationException rendererException = exoPlaybackException.getRendererException();
if (rendererException instanceof MediaCodecRenderer.DecoderInitializationException) {
MediaCodecRenderer.DecoderInitializationException decoderInitializationException = rendererException;
String str = decoderInitializationException.diagnosticInfo;
if (str != null) {
getString(2131952103, new Object[]{str});
} else if (decoderInitializationException.getCause() instanceof MediaCodecUtil.DecoderQueryException) {
getString(2131952128);
} else if (decoderInitializationException.secureDecoderRequired) {
getString(2131952118, new Object[]{decoderInitializationException.mimeType});
} else {
getString(2131952115, new Object[]{decoderInitializationException.mimeType});
if (Build.VERSION.SDK_INT >= 30) {
this.t = true;
this.v0 = true;
this.x0 = this.D0.J0;
Bundle bundle = this.y0;
if (bundle == null || (i = this.u) > 0) {
return;
}
this.u = i + 1;
this.S1 = false;
L2(bundle);
return;
}
}
}
}
tc.j jVar = this.D0;
if (jVar != null) {
jVar.i0();
this.D0.h0();
this.D0.Z0(false, false);
}
B4();
q4();
O3();
this.g0 = null;
this.i2 = true;
this.n0 = true;
try {
if (this.y1 != null) {
C2();
this.y1.setVisibility(4);
}
} catch (Exception unused) {
}
}
public void onPlayerErrorChanged(PlaybackException playbackException) {
h2.u(this, playbackException);
}
public void onPlayerStateChanged(boolean z2, int i) {
h2.v(this, z2, i);
}
public void onPlaylistMetadataChanged(MediaMetadata mediaMetadata) {
h2.w(this, mediaMetadata);
}
public void onPositionDiscontinuity(Player.PositionInfo positionInfo, Player.PositionInfo positionInfo2, int i) {
h2.y(this, positionInfo, positionInfo2, i);
TimeUnit timeUnit = TimeUnit.MILLISECONDS;
if (timeUnit.toSeconds(positionInfo2.positionMs) > 0 || timeUnit.toSeconds(positionInfo.positionMs) > 0) {
F4();
cc.b bVar = this.I2;
String str = this.L1;
long j2 = this.K2;
ExoPlayer exoPlayer = this.g0;
long duration = exoPlayer != null ? exoPlayer.getDuration() : 0L;
CastContext castContext = this.v1;
boolean z2 = false;
if (castContext != null && castContext.getCastState() == 4) {
z2 = true;
}
HashMap<String, Object> l2 = bVar.l(str, j2, duration, Boolean.valueOf(z2), this.C4, this.g0.getPlaybackParameters().speed, O2(), false, 0L);
l2.put(cc.b.F1, Long.valueOf(timeUnit.toSeconds(positionInfo.positionMs)));
l2.put(cc.b.G1, Long.valueOf(timeUnit.toSeconds(positionInfo2.positionMs)));
cc.c.d().o(cc.b.t1, l2);
}
}
public void onRenderedFirstFrame() {
h2.z(this);
}
public void onRepeatModeChanged(int i) {
}
public void onResume() {
super.onResume();
j3();
if (isAdded()) {
if ((Util.SDK_INT <= 23 || this.g0 == null) && getActivity() != null && getActivity().w2() > 0) {
this.a2 = true;
this.Z1 = false;
if (this.Y1) {
m4(false);
} else {
m4(true);
if (this.r != null) {
g3(true);
}
}
tc.j jVar = this.D0;
if (jVar != null) {
jVar.b1();
}
K2();
I2(this.g0, true);
v4();
if (this.g0 == null && getActivity() != null && !this.g2 && !this.i2) {
this.g2 = true;
if (hd.a.a.g(OTTApplication.o()).getLoggedUser() == null) {
return;
}
Intent intent = new Intent((Context) getActivity(), (Class<?>) SplashScreenActivity.class);
intent.setFlags(67108864);
intent.setFlags(268468224);
startActivity(intent);
getActivity().finish();
}
}
this.t0.b();
}
}
public void onSeekBackIncrementChanged(long j2) {
h2.B(this, j2);
}
public void onSeekForwardIncrementChanged(long j2) {
h2.C(this, j2);
}
public void onSeekProcessed() {
}
public void onShuffleModeEnabledChanged(boolean z2) {
}
public void onSkipSilenceEnabledChanged(boolean z2) {
h2.F(this, z2);
}
public void onStart() {
super.onStart();
if (!isAdded() || Util.SDK_INT <= 23 || getActivity() == null || getActivity().w2() <= 0) {
return;
}
this.a2 = true;
this.Z1 = false;
if (this.Y1) {
m4(false);
} else {
m4(true);
if (this.r != null) {
g3(true);
}
}
tc.j jVar = this.D0;
if (jVar != null) {
jVar.b1();
}
K2();
I2(this.g0, true);
v4();
if (this.g0 != null || getActivity() == null || this.g2 || this.i2) {
return;
}
this.g2 = true;
if (hd.a.a.g(OTTApplication.o()).getLoggedUser() == null) {
return;
}
Intent intent = new Intent((Context) getActivity(), (Class<?>) SplashScreenActivity.class);
intent.setFlags(67108864);
intent.setFlags(268468224);
startActivity(intent);
getActivity().finish();
}
public void onStop() {
StreamResponse streamResponse;
super.onStop();
if (isAdded()) {
if (Util.SDK_INT > 23 && getActivity() != null && getActivity().w2() > 0) {
this.a2 = false;
this.Y1 = false;
ExoPlayer exoPlayer = this.g0;
if (exoPlayer != null) {
if (!(exoPlayer != null && exoPlayer.getPlayWhenReady())) {
this.Y1 = true;
}
}
this.Z1 = true;
m4(false);
if (this.r != null) {
g3(false);
}
l3();
CountDownTimer countDownTimer = this.E0;
if (countDownTimer != null) {
countDownTimer.cancel();
}
this.E0 = null;
}
if (this.i1 == null || (streamResponse = this.k1) == null) {
this.T3.setVisibility(8);
} else {
if (streamResponse.getAnalyticsInfo().getContentType() == null || !this.k1.getAnalyticsInfo().getContentType().equalsIgnoreCase("live")) {
return;
}
hd.a0.y(getActivity()).T("lastchannel", this.i1.getPageInfo().getPath());
}
}
}
public void onSurfaceSizeChanged(int i, int i2) {
h2.G(this, i, i2);
}
public void onTimelineChanged(Timeline timeline, int i) {
h2.H(this, timeline, i);
}
public void onTrackSelectionParametersChanged(TrackSelectionParameters trackSelectionParameters) {
h2.I(this, trackSelectionParameters);
}
public void onTracksChanged(Tracks tracks) {
ImmutableList<Tracks.Group> groups = tracks.getGroups();
q4();
if (groups != this.o0) {
MappingTrackSelector.MappedTrackInfo currentMappedTrackInfo = this.h0.getCurrentMappedTrackInfo();
if (currentMappedTrackInfo != null) {
if (currentMappedTrackInfo.getTypeSupport(2) == 1) {
a4(2131952132);
}
if (currentMappedTrackInfo.getTypeSupport(1) == 1) {
a4(2131952131);
}
}
this.o0 = groups;
}
for (int i = 0; i < groups.size(); i++) {
Tracks.Group group = groups.get(i);
for (int i2 = 0; i2 < group.length; i2++) {
if (group.isTrackSelected(i2)) {
Format trackFormat = group.getTrackFormat(i2);
if (trackFormat.sampleMimeType.startsWith("audio/")) {
String str = trackFormat.language;
if (str == null) {
str = "unknown";
}
this.g1 = str;
}
}
}
}
}
public void onUpstreamDiscarded(int i, MediaSource.MediaPeriodId mediaPeriodId, MediaLoadData mediaLoadData) {
hd.h.b("Ads ::", "onUpstreamDiscarded");
}
public void onVideoSizeChanged(VideoSize videoSize) {
h2.K(this, videoSize);
}
public void onVisibilityChange(int i) {
}
public void onVolumeChanged(float f2) {
h2.L(this, f2);
}
@Override
public void p() {
StreamResponse streamResponse = this.V0;
if (streamResponse == null || streamResponse.getPageAttributes() == null || this.V0.getPageAttributes().getCreditsLabel() == null || this.V0.getPageAttributes().getCreditsLabel().trim().length() <= 0 || this.V0.getPageAttributes().getCreditsStartTime() == null || this.V0.getPageAttributes().getCreditsStartTime().trim().length() <= 0 || this.V0.getPageAttributes().getCreditsDuration() == null || this.V0.getPageAttributes().getCreditsDuration().trim().length() <= 0) {
RelativeLayout relativeLayout = this.s3;
if (relativeLayout != null) {
relativeLayout.setVisibility(8);
Configs c2 = hd.a.a.c(OTTApplication.o());
if (this.n1 || this.d1 == null || this.T1) {
return;
}
ExoPlayer exoPlayer = this.g0;
if (exoPlayer == null || !exoPlayer.isPlayingAd()) {
if (getActivity() != null && getActivity().w2() == 2) {
this.s3.setVisibility(8);
return;
}
if (this.I) {
this.s3.setVisibility(0);
return;
}
if (c2 == null || c2.getMinDurationToShowUpnext() == null) {
this.s3.setVisibility(8);
return;
}
ExoPlayer exoPlayer2 = this.g0;
if (((exoPlayer2 != null ? exoPlayer2.getDuration() : 0L) + 500) / 1000 > Integer.parseInt(c2.getMinDurationToShowUpnext())) {
this.s3.setVisibility(0);
return;
}
return;
}
return;
}
return;
}
if (getActivity() == null || getActivity().w2() != 1 || MainActivity.A3) {
return;
}
ExoPlayer exoPlayer3 = this.g0;
long duration = exoPlayer3 == null ? 0L : exoPlayer3.getDuration();
ExoPlayer exoPlayer4 = this.g0;
long currentPosition = exoPlayer4 != null ? exoPlayer4.getCurrentPosition() : 0L;
String creditsLabel = this.V0.getPageAttributes().getCreditsLabel();
long j2 = Long.MAX_VALUE;
try {
j2 = Long.parseLong(this.V0.getPageAttributes().getCreditsStartTime()) * 1000;
Long.parseLong(this.V0.getPageAttributes().getCreditsDuration());
} catch (NumberFormatException unused) {
}
if (j2 > currentPosition || currentPosition > duration) {
this.Z3.setVisibility(8);
this.s3.setVisibility(8);
return;
}
this.Z3.setVisibility(8);
this.a4.setText(creditsLabel);
this.s3.setVisibility(0);
this.s3.setVisibility(0);
this.A3.setText(getContext().getResources().getString(2131952945) + " " + ((duration - currentPosition) / 1000) + " sec");
TextView textView = this.w3;
StringBuilder sb2 = new StringBuilder();
sb2.append(((Card) this.d1.getCards().get(0)).getDisplay().getSubtitle1());
sb2.append("");
textView.setText(sb2.toString());
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.Z3.getLayoutParams();
tc.j jVar = this.D0;
if (jVar == null || !jVar.c0()) {
layoutParams.setMargins(0, 0, 20, (int) getContext().getResources().getDimension(2131166781));
} else {
layoutParams.setMargins(0, 0, 20, (int) getContext().getResources().getDimension(2131167415));
}
this.Z3.setLayoutParams(layoutParams);
}
public void p3() {
ContentPage contentPage;
if (!this.j2.isEmpty() || (contentPage = this.o3) == null || contentPage.getStreamStatus() == null || this.o3.getStreamStatus().getParentControlled() == null || !this.o3.getStreamStatus().getParentControlled().booleanValue()) {
this.E0 = null;
K2();
if (this.d1 != null) {
this.G3 = true;
this.B0 = false;
}
this.F0 = -1;
h2();
X3(false);
return;
}
this.i2 = true;
View view = this.D0.J;
if (view != null && view.getVisibility() == 0) {
this.D0.J.setVisibility(8);
}
HashMap hashMap = new HashMap();
Configs D = OTTApplication.D();
if (!com.yupptv.ott.a.h || OTTApplication.i0 == null || D == null || D.getParentalControlPopupMessage() == null || D.getParentalControlPopupMessage().trim().length() <= 0) {
String str = hd.d.e;
if (str == null || str.trim().length() <= 0) {
hashMap.put("msg1", String.format(getActivity().getResources().getString(2131952594), Integer.valueOf(hd.d.d)));
} else {
hashMap.put("msg1", hd.d.e);
}
} else {
hashMap.put("msg1", D.getParentalControlPopupMessage());
}
hd.u.J0(getActivity(), DialogType.PARENTAL_CONTROL_PASSCODE_DIALOG, hashMap, this.S4);
}
public HashMap<String, Object> q2(HashMap<String, Object> hashMap) {
hashMap.putAll(cc.b.B0().i());
ExoPlayer exoPlayer = this.g0;
if (exoPlayer != null && exoPlayer.getVideoFormat() != null) {
hashMap.put(cc.a.G, Math.round((this.g0.getVideoFormat().bitrate / 1000000.0f) * 1024.0f) + " kbps");
}
hashMap.put(cc.a.y, hd.j.a(this.g0.getDuration()));
hashMap.put(cc.a.J, Boolean.valueOf(hd.a0.y(this.J).b("enableCC")));
hashMap.put(cc.a.F, hd.v.c(this.J));
hashMap.put(cc.a.E, this.n1 ? "Live" : "VOD");
return hashMap;
}
public void q3() {
this.F3 = false;
this.G3 = false;
X3(false);
}
@Override
public void r(Object obj, int i, View view, int i2) {
}
public View r2(int i) {
return this.J.findViewById(i);
}
public void s3() {
ExoPlayer exoPlayer = this.g0;
if (exoPlayer != null) {
exoPlayer.setPlayWhenReady(true);
e1 e1Var = this.s;
if (e1Var != null) {
e1Var.a();
}
}
}
public void t3() {
ExoPlayer exoPlayer;
ExoPlayer exoPlayer2 = this.g0;
if (exoPlayer2 == null || exoPlayer2.getDuration() == 0 || this.g0.isPlayingAd() || (exoPlayer = this.g0) == null) {
return;
}
if (exoPlayer.getPlayWhenReady()) {
cc.c.d().t("player_actions", this.I2.A(cc.c.f1));
} else {
cc.c.d().t("player_actions", this.I2.A(cc.c.e1));
}
}
public void t4() {
ContentPage contentPage = this.o3;
if (contentPage == null || contentPage.getPageButtons() == null || !this.o3.getPageButtons().getIsFavourite().booleanValue()) {
this.h3.setImageDrawable(getResources().getDrawable(2131231616));
} else {
this.h3.setImageDrawable(getResources().getDrawable(2131231615));
}
}
public void u4(java.lang.Object r19) {
throw new UnsupportedOperationException("Method not decompiled: tc.i.u4(java.lang.Object):void");
}
public void v3(GridController gridController) {
this.Q.b();
this.O.setAdapter((RecyclerView.Adapter) null);
RecyclerView recyclerView = this.O;
if (recyclerView != null) {
recyclerView.setAdapter(gridController.getAdapter());
}
}
public void v4() {
if (this.s3 != null && this.H0 == 4 && this.G3) {
AppCompatButton appCompatButton = this.T;
if (appCompatButton == null || appCompatButton.getVisibility() != 0) {
X3(false);
} else {
this.E0 = null;
}
p();
}
}
public void w3(float f2) {
if (this.v4 < BitmapDescriptorFactory.HUE_RED) {
float f3 = this.J.getWindow().getAttributes().screenBrightness;
this.v4 = f3;
if (f3 <= BitmapDescriptorFactory.HUE_RED) {
this.v4 = 0.5f;
} else if (f3 < 0.01f) {
this.v4 = 0.01f;
}
}
WindowManager.LayoutParams attributes = this.J.getWindow().getAttributes();
float f4 = this.v4 + f2;
attributes.screenBrightness = f4;
if (f4 > 1.0f) {
attributes.screenBrightness = 1.0f;
} else if (f4 < 0.01f) {
attributes.screenBrightness = 0.01f;
}
this.J.getWindow().setAttributes(attributes);
this.Y4 = (VerticalSeekBar) getActivity().findViewById(2131427628);
this.X4 = (TextView) getActivity().findViewById(2131427520);
if (Build.VERSION.SDK_INT >= 26) {
this.Y4.setMin(0);
this.Y4.setMax(150);
}
I3(2131427523, true);
I3(2131427525, false);
I3(2131427521, true);
I3(2131427628, true);
I3(2131427522, true);
I3(2131427520, false);
float f6 = 150;
int i = ((int) (attributes.screenBrightness * f6)) / 10;
hd.h.a("brightness", i + "");
((ImageView) this.J.findViewById(2131427522)).setImageResource(i <= 0 ? 2131230934 : i <= 7 ? 2131230932 : i >= 14 ? 2131230931 : 2131230933);
this.Y4.setProgress((int) (attributes.screenBrightness * f6));
this.X4.setText(" " + ((int) (attributes.screenBrightness * f6)));
}
@Override
public void x() {
RelativeLayout relativeLayout = this.s3;
if (relativeLayout == null || relativeLayout.getVisibility() != 0) {
return;
}
this.s3.setVisibility(8);
}
public void x3(String str, String str2) {
TextView textView = this.P3;
if (textView == null || this.Q3 == null) {
return;
}
textView.setText(str);
if (str2 != null) {
this.Q3.setText(str2);
}
}
public void x4() {
if (this.c4) {
this.c4 = false;
TextView textView = this.p3;
if (textView != null) {
textView.setVisibility(0);
}
if (this.B3 != null && this.p3.getText().toString().equalsIgnoreCase(getString(2131952922))) {
this.B3.setVisibility(0);
}
}
ImageView imageView = this.m2;
if (imageView != null) {
imageView.setVisibility(8);
}
ImageView imageView2 = this.j3;
if (imageView2 == null || imageView2.getVisibility() != 8) {
return;
}
this.j3.setVisibility(0);
}
public void y3(int i) {
RelativeLayout relativeLayout = this.S3;
if (relativeLayout != null) {
relativeLayout.setVisibility(i);
if (i == 0) {
this.S3.setAlpha(BitmapDescriptorFactory.HUE_RED);
this.S3.setX(-50.0f);
this.S3.animate().translationX(BitmapDescriptorFactory.HUE_RED).alpha(1.0f).setDuration(500L);
}
}
}
public void y4() {
tc.j jVar;
if (this.H0 != 2 || (jVar = this.D0) == null || this.c4) {
return;
}
jVar.J0();
}
public MediaSourceFactory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider) {
return null;
}
public void onAttach(Activity activity) {
super.onAttach(activity);
this.t0 = (oc.l) activity;
}
public void onPositionDiscontinuity(int i) {
yc.a aVar;
if (this.n0) {
B4();
}
if (i == 1) {
hd.h.b("Seek proccesed", "++++++++++++++++");
ExoPlayer exoPlayer = this.g0;
if (exoPlayer != null) {
int currentPosition = (int) exoPlayer.getCurrentPosition();
if (getContext() != null && (aVar = this.Z0) != null) {
aVar.l(currentPosition);
}
yc.a.c(getActivity()).k((int) this.g0.getCurrentPosition(), currentPosition, this.Y1);
}
}
}
}