四虎影院 v4.1.6版本的 MD5 值为:3c86dc44d368396917a29935d39af88b

以下内容为反编译后的 NewPlayActivity.java 源代码,内容仅作参考


package cn.luckxy.vod.ui.play;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Parcelable;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Toast;
import androidx.core.app.NotificationCompat;
import androidx.fragment.app.FragmentTransaction;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import cn.luckxy.av.CheckVodTrySeeBean;
import cn.luckxy.av.play.AvVideoController;
import cn.luckxy.av.play.AvVideoView;
import cn.luckxy.av.play.ControllerClickListener;
import cn.luckxy.vod.App;
import cn.luckxy.vod.R;
import cn.luckxy.vod.base.BaseActivity;
import cn.luckxy.vod.bean.AppConfigBean;
import cn.luckxy.vod.bean.GetScoreBean;
import cn.luckxy.vod.bean.PlayFromBean;
import cn.luckxy.vod.bean.PlayScoreBean;
import cn.luckxy.vod.bean.PlayerInfoBean;
import cn.luckxy.vod.bean.StartBean;
import cn.luckxy.vod.bean.UrlBean;
import cn.luckxy.vod.bean.UserInfoBean;
import cn.luckxy.vod.bean.UserVideo;
import cn.luckxy.vod.bean.VodBean;
import cn.luckxy.vod.ui.dlan.DlanListPop;
import cn.luckxy.vod.ui.login.LoginActivity;
import cn.luckxy.vod.ui.pay.PayActivity;
import cn.luckxy.vod.ui.play.SummaryFragment;
import cn.luckxy.vod.ui.play.VideoDetailFragment;
import cn.luckxy.vod.ui.widget.HitDialog;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.BarUtils;
import com.blankj.utilcode.util.ColorUtils;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.SPUtils;
import com.blankj.utilcode.util.StringUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.dueeeke.videoplayer.player.VideoView;
import com.luck.picture.lib.config.PictureConfig;
import com.luck.picture.lib.tools.PictureFileUtils;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.core.BasePopupView;
import g.a.b.l.play.PlayListDialog;
import g.a.b.l.play.PlaySourceDialog;
import g.a.b.l.play.SpeedListDialog;
import g.a.b.netservice.VodService;
import g.a.b.utils.UserUtils;
import g.a.b.utils.i;
import java.io.IOException;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
import kotlin.Metadata;
import kotlin.collections.c1;
import kotlin.collections.z;
import kotlin.n0;
import kotlin.text.Regex;
import kotlin.text.b0;
import kotlin.text.c0;
import kotlin.v1.internal.g1;
import kotlin.v1.internal.i0;
import kotlin.v1.internal.n1;
import kotlin.x;
import okhttp3.Call;
import okhttp3.Response;
import okhttp3.ResponseBody;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import q.b.a.h.d0;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000·\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010%\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\t\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\b\u0003\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0010\u0007\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u000e\n\u0002\u0018\u0002\n\u0002\b *\u0001#\u0018\u00002\u00020\u00012\u00020\u0002:\u0002\u0082\u0001B\u0005¢\u0006\u0002\u0010\u0003J\u0006\u0010<\u001a\u00020=J\b\u0010>\u001a\u00020=H\u0002J\u000e\u0010?\u001a\u00020=2\u0006\u0010@\u001a\u00020AJ\u0016\u0010B\u001a\u00020=2\u0006\u0010C\u001a\u00020'2\u0006\u0010/\u001a\u00020\u000bJ\u000e\u0010D\u001a\u00020=2\u0006\u0010E\u001a\u00020\u000bJ\b\u0010F\u001a\u00020=H\u0002J\u0010\u0010G\u001a\u00020=2\b\b\u0002\u0010E\u001a\u00020\u000bJ\b\u0010H\u001a\u00020=H\u0002J\b\u0010I\u001a\u00020=H\u0002J\b\u0010J\u001a\u00020=H\u0002J\b\u0010K\u001a\u00020\u000bH\u0014J\u0016\u0010L\u001a\u00020M2\u0006\u0010N\u001a\u00020\u000f2\u0006\u0010O\u001a\u00020\u000fJ\u000e\u0010P\u001a\u00020\u00052\u0006\u0010Q\u001a\u00020\u0005J\u000e\u0010R\u001a\u00020\u00052\u0006\u0010Q\u001a\u00020\u0005J\u0018\u0010S\u001a\n\u0012\u0004\u0012\u00020\u0005\u0018\u00010T2\u0006\u0010U\u001a\u00020\u0005H\u0002J\b\u0010V\u001a\u00020=H\u0002J\u0006\u0010W\u001a\u00020=J\u0006\u0010X\u001a\u00020=J\b\u0010Y\u001a\u00020=H\u0014J\b\u0010Z\u001a\u00020=H\u0014J\b\u0010[\u001a\u00020=H\u0014J\u0006\u0010\\\u001a\u00020\u0013J\u0006\u0010]\u001a\u00020\u0005J\b\u0010^\u001a\u00020=H\u0016J\b\u0010_\u001a\u00020=H\u0014J\u001a\u0010`\u001a\u00020\u00132\u0006\u0010a\u001a\u00020\u000b2\b\u0010b\u001a\u0004\u0018\u00010cH\u0016J\b\u0010d\u001a\u00020=H\u0014J\b\u0010e\u001a\u00020=H\u0014J\u0010\u0010f\u001a\u00020=2\u0006\u0010g\u001a\u00020\u0005H\u0016J\b\u0010h\u001a\u00020=H\u0014J\b\u0010i\u001a\u00020=H\u0014J\b\u0010j\u001a\u00020=H\u0002J\b\u0010k\u001a\u00020=H\u0002J\u0010\u0010l\u001a\u00020=2\u0006\u0010Q\u001a\u00020\u0005H\u0002J\b\u0010m\u001a\u00020=H\u0002J\b\u0010n\u001a\u00020=H\u0002J\b\u0010o\u001a\u00020=H\u0002J\u0010\u0010p\u001a\u00020=2\u0006\u0010q\u001a\u00020\u0013H\u0002J\u0010\u0010r\u001a\u00020=2\u0006\u0010s\u001a\u00020\u0005H\u0002J\b\u0010t\u001a\u00020=H\u0002J\b\u0010u\u001a\u00020=H\u0002J\u000e\u0010v\u001a\u00020=2\u0006\u0010w\u001a\u00020!J\u0006\u0010x\u001a\u00020=J\b\u0010y\u001a\u00020=H\u0002J\b\u0010z\u001a\u00020=H\u0002J\b\u0010{\u001a\u00020=H\u0002J\u0010\u0010|\u001a\u00020=2\u0006\u0010}\u001a\u00020\u000bH\u0002J\u0006\u0010~\u001a\u00020=J\u0006\u0010\u007f\u001a\u00020=J\t\u0010\u0080\u0001\u001a\u00020=H\u0002J\t\u0010\u0081\u0001\u001a\u00020=H\u0002R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082D¢\u0006\u0002\n\u0000R \u0010\u0006\u001a\u0014\u0012\u0006\u0012\u0004\u0018\u00010\u0005\u0012\u0006\u0012\u0004\u0018\u00010\u0005\u0018\u00010\u0007X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\tX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\u000bX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\u000bX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u0005X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u000fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0010\u001a\u00020\u000bX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0011\u001a\u00020\u000bX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0012\u001a\u00020\u0013X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0014\u001a\u00020\u0013X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0015\u001a\u00020\u0013X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0016\u001a\u00020\u0013X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0017\u001a\u00020\u0013X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0018\u001a\u00020\u0013X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0019\u001a\u00020\u0013X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u001a\u001a\u00020\u0013X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u001b\u001a\u00020\u0013X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u001c\u001a\u0004\u0018\u00010\u001dX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u001e\u001a\u00020\u001fX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010 \u001a\u00020!X\u0082.¢\u0006\u0002\n\u0000R\u0010\u0010\"\u001a\u00020#X\u0082\u0004¢\u0006\u0004\n\u0002\u0010$R\u0014\u0010%\u001a\b\u0012\u0004\u0012\u00020'0&X\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010(\u001a\u00020'X\u0082.¢\u0006\u0002\n\u0000R\u0016\u0010)\u001a\n\u0012\u0004\u0012\u00020*\u0018\u00010&X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010+\u001a\u0004\u0018\u00010,X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010-\u001a\u0004\u0018\u00010.X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010/\u001a\u00020\u000bX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u00100\u001a\u0004\u0018\u000101X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u00102\u001a\u0004\u0018\u000103X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u00104\u001a\u0004\u0018\u000105X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u00106\u001a\u00020\u000bX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u00107\u001a\u0004\u0018\u000108X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u00109\u001a\u00020\u000fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010:\u001a\u00020\u000fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010;\u001a\u00020\u000bX\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u0083\u0001"}, d2 = {"Lcn/luckxy/vod/ui/play/NewPlayActivity;", "Lcn/luckxy/vod/base/BaseActivity;", "Lcn/luckxy/vod/ui/play/OnSpeedItemClickListener;", "()V", "TAG", "", "avheaders", "", "controller", "Lcn/luckxy/av/play/AvVideoController;", "curFailIndex", "", "curParseIndex", "curPlayUrl", "curProgressHistory", "", "curindex", "index", "isAllowAdScreen", "", "isAllowCastScreen", "isLandscape", "isParseSuccess", "isParsed", "isPlay", "isSeekToHistory", "isShowPlayProgress", "isSuccess", "lbm", "Landroidx/localbroadcastmanager/content/LocalBroadcastManager;", "localReceiver", "Lcn/luckxy/vod/ui/play/NewPlayActivity$LocalReceiver;", "mVodBean", "Lcn/luckxy/vod/bean/VodBean;", "onJiexiResultListener", "cn/luckxy/vod/ui/play/NewPlayActivity$onJiexiResultListener$1", "Lcn/luckxy/vod/ui/play/NewPlayActivity$onJiexiResultListener$1;", "playFormList", "", "Lcn/luckxy/vod/bean/PlayFromBean;", "playFrom", "playList", "Lcn/luckxy/vod/bean/UrlBean;", "playListFragment", "Lcn/luckxy/vod/ui/play/PlayListFragment;", "playScoreInfo", "Lcn/luckxy/vod/bean/PlayScoreBean;", "playSourceIndex", "summaryFragment", "Lcn/luckxy/vod/ui/play/SummaryFragment;", "timer", "Ljava/util/Timer;", "timerTask", "Ljava/util/TimerTask;", VideoDetailFragment.G, "videoDetailFragment", "Lcn/luckxy/vod/ui/play/VideoDetailFragment;", "videoNetProgress", "vodDuration", "watchVideoLong", "RewardAd", "", "cancelTimer", "castScreen", "device", "Lcom/liuwei/android/upnpcast/device/CastDevice;", "changePlaySource", "playFromBean", "changeSelection", PictureConfig.EXTRA_POSITION, "changeTitle", "changeVideoUrlIndex", "checkVodTrySee", "chengeNextLine", "chengeNextLineFromHead", "getLayoutResID", "getPercentage", "", "curPosition", "duration", "getSameActorData", "url", "getSameData", "getUrlList", "Ljava/util/ArrayList;", "parses", "getVideoDetail", "hidePlayList", "hideSummary", "initData", "initListener", "initView", "istp", "m3u8down", "onBackPressedSupport", "onDestroy", "onKeyDown", "keyCode", NotificationCompat.CATEGORY_EVENT, "Landroid/view/KeyEvent;", "onPause", "onResume", "onSpeedItemClick", "speed", "onStart", "onStop", "parseData", "payPlay", "play", "playNext", "recordPlay", "registerReceiver", "savePlayRecord", "isClose", "sendDanmu", "content", "showAnnouncement", "showCastScreenDialog", "showNewVideo", "vodBean", "showPlayList", "showPlayListDialog", "showPlaySourceDialog", "showPlayerAd", "showSpeedListDialog", "pos", "showSummary", "showVideoDetail", "startTimer", "updateVip", "LocalReceiver", "app_release"}, k = 1, mv = {1, 1, 15})
public final class NewPlayActivity extends BaseActivity implements g.a.b.l.play.f {
    public long A;
    public Map<String, String> B;
    public VideoDetailFragment D;
    public SummaryFragment E;
    public PlayListFragment F;
    public boolean G;
    public boolean H;
    public boolean I;
    public LocalBroadcastManager J;
    public Timer L;
    public TimerTask M;
    public int N;
    public int O;
    public HashMap P;

    public AvVideoController f3395g;

    public VodBean f3396h;

    public boolean f3397i;

    public boolean f3399k;

    public boolean f3400l;

    public int f3401m;

    public boolean f3403o;

    public int f3404p;

    public int f3405q;

    public int f3406r;

    public List<? extends PlayFromBean> f3407s;
    public PlayFromBean t;
    public List<? extends UrlBean> u;
    public PlayScoreBean v;
    public boolean w;
    public boolean x;
    public long y;
    public long z;

    public final String f3394f = "NewPlayActivity";

    public String f3398j = "";

    public int f3402n = -1;
    public final i C = new i();
    public final LocalReceiver K = new LocalReceiver(this);

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u001c\u0010\u0005\u001a\u00020\u00062\b\u0010\u0007\u001a\u0004\u0018\u00010\b2\b\u0010\t\u001a\u0004\u0018\u00010\nH\u0016R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u000b"}, d2 = {"Lcn/luckxy/vod/ui/play/NewPlayActivity$LocalReceiver;", "Landroid/content/BroadcastReceiver;", "act", "Lcn/luckxy/vod/ui/play/NewPlayActivity;", "(Lcn/luckxy/vod/ui/play/NewPlayActivity;)V", "onReceive", "", com.umeng.analytics.pro.b.Q, "Landroid/content/Context;", "intent", "Landroid/content/Intent;", "app_release"}, k = 1, mv = {1, 1, 15})
    public static final class LocalReceiver extends BroadcastReceiver {
        public NewPlayActivity a;

        public LocalReceiver(@NotNull NewPlayActivity newPlayActivity) {
            i0.f(newPlayActivity, "act");
            this.a = newPlayActivity;
        }

        @Override
        public void onReceive(@Nullable Context context, @Nullable Intent intent) {
            if (intent == null || !i0.a((Object) intent.getAction(), (Object) "cn.whiner.av.AvVideoController")) {
                return;
            }
            int intExtra = intent.getIntExtra("type", 2);
            if (intExtra == 1) {
                this.a.x = true;
            } else {
                if (intExtra != 2) {
                    return;
                }
                if (intent.getBooleanExtra("isFromHead", false)) {
                    this.a.u();
                } else {
                    this.a.t();
                }
            }
        }
    }

    public static final class a extends s.a.a.n {
        public a() {
        }

        @Override
        public void a(boolean z) {
        }

        @Override
        public void onError(@NotNull String str) {
            i0.f(str, com.umeng.commonsdk.proguard.e.ap);
            super.onError(str);
            Log.e("tag", "onError:" + str);
        }

        @Override
        public void onReward() {
            Log.e("tag", "onReward");
            Toast.makeText(NewPlayActivity.this, "您已获得观影次数1次!", 0).show();
            NewPlayActivity.this.f3400l = true;
            NewPlayActivity.this.s();
        }
    }

    public static final class b implements Runnable {
        public static final b a = new b();

        @Override
        public final void run() {
            ToastUtils.showShort("正在解析中...", new Object[0]);
        }
    }

    public static final class c extends h.e.a.a.a.b.d.a<CheckVodTrySeeBean> {
        public c() {
            super(false, 1, null);
        }

        @Override
        public void a(@NotNull CheckVodTrySeeBean checkVodTrySeeBean) {
            UserInfoBean c2;
            i0.f(checkVodTrySeeBean, "data");
            boolean z = false;
            boolean z2 = UserUtils.d() && (c2 = UserUtils.c()) != null && c2.b() == 3;
            int status = checkVodTrySeeBean.getStatus();
            NewPlayActivity newPlayActivity = NewPlayActivity.this;
            if (checkVodTrySeeBean.getUser_video() > 0 || status == 0 || (z2 && status == 1)) {
                z = true;
            }
            newPlayActivity.f3399k = z;
            if (NewPlayActivity.this.f3400l) {
                NewPlayActivity.this.f3399k = true;
                checkVodTrySeeBean.setUser_video(1);
            }
            NewPlayActivity.e(NewPlayActivity.this).CheckVodTrySeeBean(checkVodTrySeeBean.getUser_video(), checkVodTrySeeBean, z2, NewPlayActivity.k(NewPlayActivity.this).n0());
        }

        @Override
        public void a(@NotNull h.e.a.a.a.exception.d dVar) {
            i0.f(dVar, "e");
            NewPlayActivity.this.f3399k = false;
        }
    }

    public static final class e implements Runnable {
        public final String b;

        public e(String str) {
            this.b = str;
        }

        @Override
        public final void run() {
            Map map;
            PlayerInfoBean c2 = NewPlayActivity.m(NewPlayActivity.this).c();
            i0.a((Object) c2, "playFrom.player_info");
            String e2 = c2.e();
            i0.a((Object) e2, "playFrom.player_info.parse2");
            if (!c0.c((CharSequence) e2, (CharSequence) "ikheader=", false, 2, (Object) null) && !c0.c((CharSequence) this.b, (CharSequence) "mgtv.com", false, 2, (Object) null)) {
                if (b0.d(this.b, "//", false, 2, null)) {
                    ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).setUrl(d0.f19384e + this.b);
                } else {
                    ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).setUrl(this.b);
                }
            } else {
                PlayerInfoBean c3 = NewPlayActivity.m(NewPlayActivity.this).c();
                i0.a((Object) c3, "playFrom.player_info");
                String e3 = c3.e();
                i0.a((Object) e3, "playFrom.player_info.parse2");
                if (!c0.c((CharSequence) e3, (CharSequence) "ikheader=", false, 2, (Object) null)) {
                    if (NewPlayActivity.this.B == null) {
                        NewPlayActivity.this.B = c1.e(new x(q.b.a.c.l.R, "https://baidu.com/"));
                    }
                    if (c0.c((CharSequence) this.b, (CharSequence) "mgtv.com", false, 2, (Object) null) && (map = NewPlayActivity.this.B) != null) {
                        map.put(q.b.a.c.l.R, "https://pcvideoaliyun.titan.mgtv.com");
                    }
                } else {
                    String str = "222ssss" + this.b;
                    StringBuilder sb = new StringBuilder();
                    PlayerInfoBean c4 = NewPlayActivity.m(NewPlayActivity.this).c();
                    i0.a((Object) c4, "playFrom.player_info");
                    sb.append(c4.e());
                    sb.append("_______");
                    Log.d(str, sb.toString());
                    PlayerInfoBean c5 = NewPlayActivity.m(NewPlayActivity.this).c();
                    i0.a((Object) c5, "playFrom.player_info");
                    String a = g.a.b.i.h.a(c5.e());
                    i0.a((Object) a, "cn.luckxy.vod.jiexi.Stri…yFrom.player_info.parse2)");
                    if (NewPlayActivity.this.B == null) {
                        NewPlayActivity.this.B = c1.e(new x(q.b.a.c.l.R, a));
                    }
                    Map map2 = NewPlayActivity.this.B;
                    if (map2 != null) {
                        map2.put(q.b.a.c.l.R, a);
                    }
                }
                LogUtils.d("", "====Parse avheaders url=" + NewPlayActivity.this.B);
                ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).setUrl(this.b, NewPlayActivity.this.B);
            }
            ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).start();
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u001d\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0010\u0010\u0007\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\u0002H\u0016¨\u0006\t"}, d2 = {"cn/luckxy/vod/ui/play/NewPlayActivity$getVideoDetail$1", "Lcom/github/StormWyrm/wanandroid/base/net/observer/PlayLoadingObserver;", "Lcn/luckxy/vod/bean/VodBean;", "onError", "", "e", "Lcom/github/StormWyrm/wanandroid/base/exception/ResponseException;", "onSuccess", "data", "app_release"}, k = 1, mv = {1, 1, 15})
    public static final class f extends h.e.a.a.a.b.d.c<VodBean> {

        public static final class a extends HitDialog.OnHitDialogClickListener {
            public a() {
            }

            @Override
            public void onCancelClick(@NotNull HitDialog hitDialog) {
                i0.f(hitDialog, "dialog");
                super.onCancelClick(hitDialog);
                NewPlayActivity.this.finish();
            }

            @Override
            public void onOkClick(@NotNull HitDialog hitDialog) {
                i0.f(hitDialog, "dialog");
                super.onOkClick(hitDialog);
                NewPlayActivity.this.finish();
            }
        }

        public f(Context context) {
            super(context, 0, false, false, 14, null);
        }

        @Override
        public void a(@NotNull VodBean vodBean) {
            i0.f(vodBean, "data");
            NewPlayActivity.this.f3396h = vodBean;
            NewPlayActivity.this.f3401m = 0;
            NewPlayActivity.this.f3402n = -1;
            NewPlayActivity.this.v = App.f3146l;
            NewPlayActivity newPlayActivity = NewPlayActivity.this;
            PlayScoreBean playScoreBean = newPlayActivity.v;
            newPlayActivity.f3405q = playScoreBean != null ? playScoreBean.getUrlIndex() : 0;
            NewPlayActivity newPlayActivity2 = NewPlayActivity.this;
            PlayScoreBean playScoreBean2 = newPlayActivity2.v;
            newPlayActivity2.f3404p = playScoreBean2 != null ? playScoreBean2.getPlaySourceIndex() : 0;
            VodBean.PlayInfoBean e2 = vodBean.e();
            if (e2 != null) {
                NewPlayActivity.this.f3404p = e2.c();
                NewPlayActivity.this.f3405q = e2.e();
                NewPlayActivity newPlayActivity3 = NewPlayActivity.this;
                Long a2 = e2.a();
                i0.a((Object) a2, "playInfo.curProgress");
                newPlayActivity3.A = a2.longValue();
                NewPlayActivity newPlayActivity4 = NewPlayActivity.this;
                newPlayActivity4.y = newPlayActivity4.A;
            }
            NewPlayActivity newPlayActivity5 = NewPlayActivity.this;
            List<PlayFromBean> h0 = vodBean.h0();
            i0.a((Object) h0, "data.vod_play_list");
            newPlayActivity5.f3407s = h0;
            List<PlayFromBean> h02 = vodBean.h0();
            if (!(h02 == null || h02.isEmpty())) {
                String k0 = vodBean.k0();
                i0.a((Object) k0, "data.vod_play_url");
                if (!(k0.length() == 0) && !vodBean.g0().equals("no")) {
                    if (vodBean.h0() != null) {
                        NewPlayActivity newPlayActivity6 = NewPlayActivity.this;
                        List<PlayFromBean> h03 = vodBean.h0();
                        if (h03 == null) {
                            i0.f();
                        }
                        PlayFromBean playFromBean = h03.get(NewPlayActivity.this.f3404p);
                        i0.a((Object) playFromBean, "data.vod_play_list!![playSourceIndex]");
                        newPlayActivity6.t = playFromBean;
                    }
                    NewPlayActivity newPlayActivity7 = NewPlayActivity.this;
                    newPlayActivity7.u = NewPlayActivity.m(newPlayActivity7).i();
                    LogUtils.d("=====问题 getVideoDetail");
                    NewPlayActivity.this.w();
                    NewPlayActivity.this.p();
                    return;
                }
            }
            HitDialog hitDialog = new HitDialog(NewPlayActivity.this);
            String string = StringUtils.getString(com.movie.all.R.string.tip);
            i0.a((Object) string, "StringUtils.getString(R.string.tip)");
            hitDialog.setTitle(string).setMessage("无播放地址,联系客服添加").setOnHitDialogClickListener(new a()).show();
        }

        @Override
        public void a(@NotNull h.e.a.a.a.exception.d dVar) {
            i0.f(dVar, "e");
            NewPlayActivity.this.finish();
        }
    }

    public static final class g implements ControllerClickListener {
        public g() {
        }

        @Override
        public final void onClick(View view) {
            i0.a((Object) view, "it");
            switch (view.getId()) {
                case com.movie.all.R.id.btn_pop_danmaku:
                    Object tag = view.getTag();
                    if (tag != null) {
                        NewPlayActivity.this.g((String) tag);
                        return;
                    }
                    throw new n0("null cannot be cast to non-null type kotlin.String");
                case com.movie.all.R.id.iv_av_back:
                case com.movie.all.R.id.iv_av_back1:
                case com.movie.all.R.id.iv_av_back2:
                    Log.i("bds", "back===========");
                    App.f3146l = null;
                    NewPlayActivity.this.v = null;
                    NewPlayActivity.this.a(true);
                    NewPlayActivity.this.setResult(3);
                    return;
                case com.movie.all.R.id.iv_av_miracast:
                    NewPlayActivity.this.C();
                    return;
                case com.movie.all.R.id.iv_av_next:
                    NewPlayActivity.this.y();
                    return;
                case com.movie.all.R.id.tvEndPayButton:
                case com.movie.all.R.id.tvPayButton:
                    NewPlayActivity.this.x();
                    return;
                case com.movie.all.R.id.tvEndUpdateButton:
                case com.movie.all.R.id.tvUpdateButton:
                    NewPlayActivity.this.H();
                    return;
                case com.movie.all.R.id.tvPlaySource:
                    NewPlayActivity.this.E();
                    return;
                case com.movie.all.R.id.tv_av_hd:
                    NewPlayActivity.this.t();
                    return;
                case com.movie.all.R.id.tv_av_selected:
                    NewPlayActivity.this.D();
                    return;
                case com.movie.all.R.id.tv_av_speed:
                    NewPlayActivity newPlayActivity = NewPlayActivity.this;
                    Object tag2 = view.getTag();
                    if (tag2 == null) {
                        throw new n0("null cannot be cast to non-null type kotlin.Int");
                    }
                    newPlayActivity.d(((Integer) tag2).intValue());
                    return;
                default:
                    return;
            }
        }
    }

    public static final class h implements VideoView.OnStateChangeListener {
        public h() {
        }

        @Override
        public void onPlayStateChanged(int i2) {
            StartBean startBean;
            if (i2 == 5) {
                NewPlayActivity newPlayActivity = NewPlayActivity.this;
                float a = newPlayActivity.a(newPlayActivity.y, NewPlayActivity.this.z);
                StringBuilder sb = new StringBuilder();
                sb.append("进度9:=");
                sb.append(NewPlayActivity.e(NewPlayActivity.this).getPercentage());
                sb.append("  2:");
                PlayScoreBean playScoreBean = NewPlayActivity.this.v;
                sb.append(playScoreBean != null ? Long.valueOf(playScoreBean.getCurProgress()) : null);
                sb.append(" 3=");
                sb.append(NewPlayActivity.this.y);
                sb.append(" 4=");
                sb.append(a);
                System.out.println((Object) sb.toString());
                if (a > 0.01f && a < 0.99f) {
                    System.out.println((Object) ("进度1:==" + NewPlayActivity.this.y));
                    NewPlayActivity.e(NewPlayActivity.this).setReplayByCurProgress(true);
                    return;
                }
                System.out.println((Object) "进度5:==");
                NewPlayActivity.this.y();
                return;
            }
            if (i2 != 2) {
                if (i2 == -1) {
                    LogUtils.d("=====问题 video OnError");
                    NewPlayActivity.e(NewPlayActivity.this).setReplayByCurProgress(true);
                    NewPlayActivity.this.x = true;
                    NewPlayActivity.this.f3401m++;
                    NewPlayActivity.this.w();
                    return;
                }
                if (i2 != 4 || (startBean = App.f3140f) == null) {
                    return;
                }
                i0.a((Object) startBean, "App.startBean");
                if (startBean.a() != null) {
                    StartBean startBean2 = App.f3140f;
                    i0.a((Object) startBean2, "App.startBean");
                    StartBean.Ads a2 = startBean2.a();
                    i0.a((Object) a2, "App.startBean.ads");
                    if (a2.d() != null) {
                        StartBean startBean3 = App.f3140f;
                        i0.a((Object) startBean3, "App.startBean");
                        StartBean.Ads a3 = startBean3.a();
                        i0.a((Object) a3, "App.startBean.ads");
                        StartBean.Ad d2 = a3.d();
                        i0.a((Object) d2, "App.startBean.ads.player_pause");
                        if (d2.a() != null) {
                            StartBean startBean4 = App.f3140f;
                            i0.a((Object) startBean4, "App.startBean");
                            StartBean.Ads a4 = startBean4.a();
                            i0.a((Object) a4, "App.startBean.ads");
                            StartBean.Ad d3 = a4.d();
                            i0.a((Object) d3, "App.startBean.ads.player_pause");
                            if (d3.d() == 1) {
                                StartBean startBean5 = App.f3140f;
                                i0.a((Object) startBean5, "App.startBean");
                                StartBean.Ads a5 = startBean5.a();
                                i0.a((Object) a5, "App.startBean.ads");
                                StartBean.Ad d4 = a5.d();
                                i0.a((Object) d4, "App.startBean.ads.player_pause");
                                String a6 = d4.a();
                                if (a6 == null) {
                                    i0.f();
                                }
                                Object[] array = new Regex(h.k.b.c.f13093g).c(a6, 0).toArray(new String[0]);
                                if (array != null) {
                                    String[] strArr = (String[]) array;
                                    NewPlayActivity.e(NewPlayActivity.this).showAd(strArr[1], strArr[0]);
                                    return;
                                }
                                throw new n0("null cannot be cast to non-null type kotlin.Array<T>");
                            }
                            return;
                        }
                        return;
                    }
                    return;
                }
                return;
            }
            NewPlayActivity.this.w = true;
            if (!NewPlayActivity.this.f3397i) {
                if (NewPlayActivity.this.x) {
                    ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).seekTo(NewPlayActivity.this.y);
                    System.out.println((Object) ("进度2:==" + NewPlayActivity.this.y));
                } else {
                    if (NewPlayActivity.this.A != 0) {
                        long duration = NewPlayActivity.e(NewPlayActivity.this).getDuration();
                        if (duration == 0) {
                            NewPlayActivity.e(NewPlayActivity.this).addDefaultControlComponent(NewPlayActivity.k(NewPlayActivity.this).L(), true);
                        } else if (duration > NewPlayActivity.this.A) {
                            ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).seekTo(NewPlayActivity.this.A);
                        }
                    }
                    System.out.println((Object) ("进度4:== videoNetProgress=" + NewPlayActivity.this.A));
                }
            } else {
                StringBuilder sb2 = new StringBuilder();
                sb2.append("iko===");
                PlayScoreBean playScoreBean2 = App.f3146l;
                sb2.append(playScoreBean2 != null ? playScoreBean2.getCurProgress() : 0L);
                Log.i("dsd", sb2.toString());
                AvVideoView avVideoView = (AvVideoView) NewPlayActivity.this.a(R.id.videoView);
                PlayScoreBean playScoreBean3 = NewPlayActivity.this.v;
                avVideoView.seekTo(playScoreBean3 != null ? playScoreBean3.getCurProgress() : 0L);
                StringBuilder sb3 = new StringBuilder();
                sb3.append("进度3:==");
                PlayScoreBean playScoreBean4 = NewPlayActivity.this.v;
                sb3.append(playScoreBean4 != null ? Long.valueOf(playScoreBean4.getCurProgress()) : null);
                System.out.println((Object) sb3.toString());
                NewPlayActivity.this.f3397i = false;
            }
            NewPlayActivity newPlayActivity2 = NewPlayActivity.this;
            newPlayActivity2.z = NewPlayActivity.e(newPlayActivity2).getDuration();
            System.out.println((Object) ("进度12:==" + NewPlayActivity.this.z));
            int i3 = SPUtils.getInstance().getInt(AvVideoController.KEY_SPEED_INDEX, 3);
            if (i3 == 0) {
                ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).setSpeed(2.0f);
                NewPlayActivity.e(NewPlayActivity.this).setSpeed("2.00");
                return;
            }
            if (i3 == 1) {
                ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).setSpeed(1.5f);
                NewPlayActivity.e(NewPlayActivity.this).setSpeed("1.50");
                return;
            }
            if (i3 == 2) {
                ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).setSpeed(1.25f);
                NewPlayActivity.e(NewPlayActivity.this).setSpeed("1.25");
                return;
            }
            if (i3 == 3) {
                ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).setSpeed(1.0f);
                NewPlayActivity.e(NewPlayActivity.this).setSpeed("1.00");
            } else if (i3 == 4) {
                ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).setSpeed(0.75f);
                NewPlayActivity.e(NewPlayActivity.this).setSpeed("0.75");
            } else {
                if (i3 != 5) {
                    return;
                }
                ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).setSpeed(0.5f);
                NewPlayActivity.e(NewPlayActivity.this).setSpeed("0.50");
            }
        }

        @Override
        public void onPlayerStateChanged(int i2) {
            if (i2 == 10) {
                NewPlayActivity.this.H = false;
            } else if (i2 == 11) {
                NewPlayActivity.this.H = true;
            }
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000'\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\b\n\u0000\n\u0002\u0010$\n\u0000*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J\u0012\u0010\u0004\u001a\u00020\u00032\b\u0010\u0005\u001a\u0004\u0018\u00010\u0006H\u0016J4\u0010\u0007\u001a\u00020\u00032\b\u0010\b\u001a\u0004\u0018\u00010\u00062\u0006\u0010\t\u001a\u00020\n2\u0018\u0010\u000b\u001a\u0014\u0012\u0006\u0012\u0004\u0018\u00010\u0006\u0012\u0006\u0012\u0004\u0018\u00010\u0006\u0018\u00010\fH\u0016¨\u0006\r"}, d2 = {"cn/luckxy/vod/ui/play/NewPlayActivity$onJiexiResultListener$1", "Lcn/luckxy/vod/jiexi/BackListener;", "onError", "", "onProgressUpdate", NotificationCompat.CATEGORY_MESSAGE, "", "onSuccess", "url", "curParseIndex", "", "headers", "", "app_release"}, k = 1, mv = {1, 1, 15})
    public static final class i implements g.a.b.i.c {

        public static final class a implements Runnable {
            public a() {
            }

            @Override
            public final void run() {
                NewPlayActivity.this.t();
            }
        }

        public i() {
        }

        @Override
        public void a(@Nullable String str, int i2, @Nullable Map<String, String> map) {
            System.out.println((Object) ("===Jiexi onSuccess 坐标:" + i2 + " url=" + str));
            StringBuilder sb = new StringBuilder();
            sb.append("---play----onSuccess");
            sb.append(str);
            System.out.println((Object) sb.toString());
            if (NewPlayActivity.this.I) {
                Log.d(NewPlayActivity.this.f3394f, "====ParseonFail  \n url=" + str);
                return;
            }
            Log.d(NewPlayActivity.this.f3394f, "====ParseonSuccess  \n url=" + str);
            NewPlayActivity.this.f3402n = i2;
            if (map != null) {
                NewPlayActivity.this.B = n1.f(map);
            }
            System.out.println((Object) ("---play----onSuccess=false curFailIndex=" + NewPlayActivity.this.f3402n + " 当前url" + str));
            if (str != null) {
                if (!(str.length() == 0)) {
                    System.out.println((Object) ("---play----isPlay=" + NewPlayActivity.this.f3403o));
                    if (NewPlayActivity.this.f3403o) {
                        return;
                    }
                    Log.d(NewPlayActivity.this.f3394f, "====ParseonSuccess  play() url=" + str);
                    NewPlayActivity.this.f(str);
                    NewPlayActivity.this.f3398j = str;
                    NewPlayActivity.this.f3403o = true;
                    return;
                }
            }
            System.out.println((Object) "===修复onSuccess");
            NewPlayActivity.this.runOnUiThread(new a());
        }

        @Override
        public void b(@Nullable String str) {
            NewPlayActivity.e(NewPlayActivity.this).updateJiexiProgess(str);
        }

        @Override
        public void onError() {
            NewPlayActivity.e(NewPlayActivity.this).updateJiexiProgess("获取资源失败,请换来源或者联系客服解决!");
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u001d\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0010\u0010\u0007\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\u0002H\u0016¨\u0006\t"}, d2 = {"cn/luckxy/vod/ui/play/NewPlayActivity$payPlay$1", "Lcom/github/StormWyrm/wanandroid/base/net/observer/BaseObserver;", "", "onError", "", "e", "Lcom/github/StormWyrm/wanandroid/base/exception/ResponseException;", "onSuccess", "data", "app_release"}, k = 1, mv = {1, 1, 15})
    public static final class j extends h.e.a.a.a.b.d.a<String> {

        public static final class a implements Runnable {
            public static final a a = new a();

            @Override
            public final void run() {
                ToastUtils.showShort("购买成功!", new Object[0]);
            }
        }

        public j() {
            super(false, 1, null);
        }

        @Override
        public void a(@NotNull String str) {
            i0.f(str, "data");
            NewPlayActivity.this.runOnUiThread(a.a);
            NewPlayActivity.this.s();
        }

        @Override
        public void a(@NotNull h.e.a.a.a.exception.d dVar) {
            i0.f(dVar, "e");
            ToastUtils.showShort("积分不足,请到个人中心充值!", new Object[0]);
        }
    }

    public static final class k implements Runnable {
        public final String b;

        public final g1.h f3411c;

        public k(String str, g1.h hVar) {
            this.b = str;
            this.f3411c = hVar;
        }

        @Override
        public final void run() {
            if (b0.d(this.b, "//", false, 2, null)) {
                ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).setUrl(d0.f19384e + this.b);
            } else if (c0.c((CharSequence) this.f3411c.a, (CharSequence) "bilibili.com", false, 2, (Object) null)) {
                Map d2 = c1.d(new x(q.b.a.c.l.R, (String) this.f3411c.a), new x("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36"));
                if (NewPlayActivity.this.B != null) {
                    Map map = NewPlayActivity.this.B;
                    if (map == null) {
                        i0.f();
                    }
                    map.putAll(d2);
                } else {
                    NewPlayActivity.this.B = c1.e(new x(q.b.a.c.l.R, (String) this.f3411c.a));
                    Map map2 = NewPlayActivity.this.B;
                    if (map2 == null) {
                        i0.f();
                    }
                    map2.putAll(d2);
                }
                ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).setUrl(this.b, NewPlayActivity.this.B);
            } else {
                ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).setUrl(this.b);
            }
            ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).start();
        }
    }

    public static final class l extends h.e.a.a.a.b.d.a<UserVideo> {

        public final boolean f3413d;

        public l(boolean z) {
            super(false, 1, null);
            this.f3413d = z;
        }

        @Override
        public void a(@NotNull UserVideo userVideo) {
            i0.f(userVideo, "data");
            Log.i("play", "addPlayLogsucess");
            NewPlayActivity.this.sendBroadcast(new Intent("android.intent.action.AddPlayScore"));
            if (this.f3413d) {
                NewPlayActivity.this.finish();
            }
        }

        @Override
        public void a(@NotNull h.e.a.a.a.exception.d dVar) {
            i0.f(dVar, "e");
            Log.i("play", "addPlayfaied");
            if (this.f3413d) {
                NewPlayActivity.this.finish();
            }
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u001d\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0010\u0010\u0007\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\u0002H\u0016¨\u0006\t"}, d2 = {"cn/luckxy/vod/ui/play/NewPlayActivity$savePlayRecord$2", "Lcom/github/StormWyrm/wanandroid/base/net/observer/BaseObserver;", "Lcn/luckxy/vod/bean/GetScoreBean;", "onError", "", "e", "Lcom/github/StormWyrm/wanandroid/base/exception/ResponseException;", "onSuccess", "data", "app_release"}, k = 1, mv = {1, 1, 15})
    public static final class m extends h.e.a.a.a.b.d.a<GetScoreBean> {

        public static final class a implements Runnable {
            public final GetScoreBean a;

            public a(GetScoreBean getScoreBean) {
                this.a = getScoreBean;
            }

            @Override
            public final void run() {
                ToastUtils.showShort("已观影30分钟,获得" + this.a.a() + "积分", new Object[0]);
            }
        }

        public m() {
            super(false, 1, null);
        }

        @Override
        public void a(@NotNull GetScoreBean getScoreBean) {
            i0.f(getScoreBean, "data");
            if (!i0.a((Object) getScoreBean.a(), (Object) "0")) {
                NewPlayActivity.this.runOnUiThread(new a(getScoreBean));
            }
        }

        @Override
        public void a(@NotNull h.e.a.a.a.exception.d dVar) {
            i0.f(dVar, "e");
            System.out.println((Object) "watchVideoLong==  onError");
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u001d\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0010\u0010\u0007\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\u0002H\u0016¨\u0006\t"}, d2 = {"cn/luckxy/vod/ui/play/NewPlayActivity$sendDanmu$1", "Lcom/github/StormWyrm/wanandroid/base/net/observer/BaseObserver;", "Lcn/luckxy/vod/bean/GetScoreBean;", "onError", "", "e", "Lcom/github/StormWyrm/wanandroid/base/exception/ResponseException;", "onSuccess", "data", "app_release"}, k = 1, mv = {1, 1, 15})
    public static final class n extends h.e.a.a.a.b.d.a<GetScoreBean> {

        public static final class a implements Runnable {
            public final h.e.a.a.a.exception.d a;

            public a(h.e.a.a.a.exception.d dVar) {
                this.a = dVar;
            }

            @Override
            public final void run() {
                ToastUtils.showShort(this.a.b(), new Object[0]);
            }
        }

        public static final class b implements Runnable {
            public final GetScoreBean a;

            public b(GetScoreBean getScoreBean) {
                this.a = getScoreBean;
            }

            @Override
            public final void run() {
                ToastUtils.showShort("发送弹幕成功,获得" + this.a.a() + "积分", new Object[0]);
            }
        }

        public n() {
            super(false, 1, null);
        }

        @Override
        public void a(@NotNull GetScoreBean getScoreBean) {
            i0.f(getScoreBean, "data");
            if (!i0.a((Object) getScoreBean.a(), (Object) "0")) {
                NewPlayActivity.this.runOnUiThread(new b(getScoreBean));
            }
        }

        @Override
        public void a(@NotNull h.e.a.a.a.exception.d dVar) {
            i0.f(dVar, "e");
            NewPlayActivity.this.runOnUiThread(new a(dVar));
        }
    }

    public static final class o implements Runnable {
        public o() {
        }

        @Override
        public final void run() {
            StartBean.Document d2;
            StartBean.Register c2;
            StartBean startBean = App.f3140f;
            if (startBean == null || (d2 = startBean.d()) == null || (c2 = d2.c()) == null) {
                return;
            }
            String a = c2.a();
            i0.a((Object) a, "it.content");
            if ((a.length() > 0) && i0.a((Object) c2.b(), (Object) "1")) {
                NewPlayActivity.e(NewPlayActivity.this).showAnnouncement(c2.a());
            }
        }
    }

    public static final class p implements Runnable {
        public static final p a = new p();

        @Override
        public final void run() {
            ToastUtils.showShort("暂无观影次数请邀请好友或升级会员!", new Object[0]);
        }
    }

    public static final class q implements g.a.b.l.a.i {
        public q() {
        }

        @Override
        public final void a(h.h.a.a.h.a aVar) {
            NewPlayActivity newPlayActivity = NewPlayActivity.this;
            i0.a((Object) aVar, "it");
            newPlayActivity.a(aVar);
        }
    }

    public static final class r extends TimerTask {
        public r() {
        }

        @Override
        public void run() {
            if (NewPlayActivity.this.O == 0) {
                NewPlayActivity.this.O++;
            } else {
                NewPlayActivity.this.a(false);
                NewPlayActivity.this.N += 60;
            }
        }
    }

    public static final AvVideoController e(NewPlayActivity newPlayActivity) {
        AvVideoController avVideoController = newPlayActivity.f3395g;
        if (avVideoController == null) {
            i0.k("controller");
        }
        return avVideoController;
    }

    public static final VodBean k(NewPlayActivity newPlayActivity) {
        VodBean vodBean = newPlayActivity.f3396h;
        if (vodBean == null) {
            i0.k("mVodBean");
        }
        return vodBean;
    }

    public static final List l(NewPlayActivity newPlayActivity) {
        List<? extends PlayFromBean> list = newPlayActivity.f3407s;
        if (list == null) {
            i0.k("playFormList");
        }
        return list;
    }

    public static final PlayFromBean m(NewPlayActivity newPlayActivity) {
        PlayFromBean playFromBean = newPlayActivity.t;
        if (playFromBean == null) {
            i0.k("playFrom");
        }
        return playFromBean;
    }

    @Override
    public View a(int i2) {
        if (this.P == null) {
            this.P = new HashMap();
        }
        View view = (View) this.P.get(Integer.valueOf(i2));
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i2);
        this.P.put(Integer.valueOf(i2), findViewById);
        return findViewById;
    }

    @Override
    public void b() {
        HashMap hashMap = this.P;
        if (hashMap != null) {
            hashMap.clear();
        }
    }

    @Override
    public int d() {
        return com.movie.all.R.layout.activity_new_play;
    }

    @Override
    public void initData() {
        super.initData();
        v();
    }

    @Override
    public void onBackPressedSupport() {
        if (((AvVideoView) a(R.id.videoView)).onBackPressed()) {
            return;
        }
        try {
            z();
        } catch (Exception unused) {
        } catch (Throwable th) {
            super.onBackPressedSupport();
            throw th;
        }
        super.onBackPressedSupport();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        g.a.b.i.f.INSTANCE.a();
        AvVideoController avVideoController = this.f3395g;
        if (avVideoController == null) {
            i0.k("controller");
        }
        avVideoController.onDestroy();
        ((AvVideoView) a(R.id.videoView)).release();
        LocalBroadcastManager localBroadcastManager = this.J;
        if (localBroadcastManager != null) {
            localBroadcastManager.unregisterReceiver(this.K);
        }
        q();
    }

    @Override
    public boolean onKeyDown(int keyCode, @Nullable KeyEvent event) {
        if (keyCode == 4) {
            AvVideoController avVideoController = this.f3395g;
            if (avVideoController == null) {
                i0.k("controller");
            }
            if (avVideoController.isLocked()) {
                AvVideoController avVideoController2 = this.f3395g;
                if (avVideoController2 == null) {
                    i0.k("controller");
                }
                avVideoController2.show();
                ToastUtils.showShort(com.movie.all.R.string.av_lock_tip);
                return true;
            }
            AvVideoController avVideoController3 = this.f3395g;
            if (avVideoController3 == null) {
                i0.k("controller");
            }
            if (avVideoController3.isFullScreen()) {
                AvVideoController avVideoController4 = this.f3395g;
                if (avVideoController4 == null) {
                    i0.k("controller");
                }
                return avVideoController4.tzFullScreen();
            }
            App.f3146l = null;
            this.v = null;
            a(true);
            setResult(3);
            finish();
            return false;
        }
        return super.onKeyDown(keyCode, event);
    }

    @Override
    public void onPause() {
        super.onPause();
    }

    @Override
    public void onResume() {
        super.onResume();
        s();
    }

    @Override
    public void onStart() {
        super.onStart();
        ((AvVideoView) a(R.id.videoView)).resume();
        if (this.G) {
            s();
        }
    }

    @Override
    public void onStop() {
        super.onStop();
        ((AvVideoView) a(R.id.videoView)).pause();
    }

    private final void A() {
        LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(this);
        this.J = localBroadcastManager;
        if (localBroadcastManager == null) {
            i0.f();
        }
        localBroadcastManager.registerReceiver(this.K, new IntentFilter("cn.whiner.av.AvVideoController"));
    }

    private final void B() {
        runOnUiThread(new o());
    }

    public final void C() {
        if (this.f3399k) {
            new XPopup.Builder(this).a((BasePopupView) new DlanListPop(this, new q())).r();
        } else {
            runOnUiThread(p.a);
        }
    }

    public final void D() {
        if (this.u != null) {
            BaseActivity e2 = e();
            int i2 = this.f3405q;
            List<? extends UrlBean> list = this.u;
            if (list == null) {
                i0.f();
            }
            new PlayListDialog(e2, i2, list).show();
        }
    }

    public final void E() {
        BaseActivity e2 = e();
        int i2 = this.f3404p;
        List<? extends PlayFromBean> list = this.f3407s;
        if (list == null) {
            i0.k("playFormList");
        }
        new PlaySourceDialog(e2, i2, list).show();
    }

    private final void F() {
        AppConfigBean appConfigBean = App.f3141g;
        if (appConfigBean != null) {
            String a2 = appConfigBean.a();
            i0.a((Object) a2, "it.img");
            if (a2.length() > 0) {
                AvVideoController avVideoController = this.f3395g;
                if (avVideoController == null) {
                    i0.k("controller");
                }
                avVideoController.showAd(appConfigBean.a(), appConfigBean.b());
            }
        }
    }

    private final void G() {
        if (this.L == null && this.M == null) {
            this.L = new Timer();
            this.M = new r();
            Timer timer = this.L;
            if (timer == null) {
                i0.f();
            }
            timer.schedule(this.M, 0L, 30000L);
        }
    }

    public final void H() {
        if (!UserUtils.d()) {
            LoginActivity.f3338o.a();
            return;
        }
        UserInfoBean c2 = UserUtils.c();
        if (c2 != null && c2.b() == 3) {
            s();
            return;
        }
        Intent intent = new Intent(e(), (Class<?>) PayActivity.class);
        intent.putExtra("type", 1);
        ActivityUtils.startActivity(intent);
    }

    private final void q() {
        Timer timer = this.L;
        if (timer != null) {
            if (timer == null) {
                i0.f();
            }
            timer.cancel();
            this.L = null;
        }
        TimerTask timerTask = this.M;
        if (timerTask != null) {
            if (timerTask == null) {
                i0.f();
            }
            timerTask.cancel();
            this.M = null;
        }
    }

    private final void r() {
        VodBean vodBean = this.f3396h;
        if (vodBean == null) {
            i0.k("mVodBean");
        }
        String c0 = vodBean.c0();
        VodBean vodBean2 = this.f3396h;
        if (vodBean2 == null) {
            i0.k("mVodBean");
        }
        if (vodBean2.g() == 2 && this.u != null) {
            StringBuilder sb = new StringBuilder();
            sb.append(c0);
            sb.append(' ');
            List<? extends UrlBean> list = this.u;
            if (list == null) {
                i0.f();
            }
            sb.append(list.get(this.f3405q).b());
            c0 = sb.toString();
        }
        AvVideoController avVideoController = this.f3395g;
        if (avVideoController == null) {
            i0.k("controller");
        }
        avVideoController.setTitle(c0);
    }

    public final void s() {
        if (this.u == null) {
            return;
        }
        VodService vodService = (VodService) g.a.b.utils.j.INSTANCE.a(VodService.class);
        if (g.a.b.utils.a.a(vodService)) {
            return;
        }
        BaseActivity e2 = e();
        VodBean vodBean = this.f3396h;
        if (vodBean == null) {
            i0.k("mVodBean");
        }
        String valueOf = String.valueOf(vodBean.U());
        String valueOf2 = String.valueOf(1);
        List<? extends UrlBean> list = this.u;
        if (list == null) {
            i0.f();
        }
        h.e.a.a.a.b.a.a(e2, vodService.d(valueOf, valueOf2, String.valueOf(list.get(this.f3405q).c())), new c());
    }

    public final void t() {
        this.f3401m++;
        w();
    }

    public final void u() {
        this.f3401m = 0;
        this.f3402n = -1;
        LogUtils.d("=====问题 chengeNextLineFromHead");
        w();
    }

    private final void v() {
        VodService vodService = (VodService) g.a.b.utils.j.INSTANCE.a(VodService.class);
        g.a.b.utils.a.a(vodService);
        VodBean vodBean = this.f3396h;
        if (vodBean == null) {
            i0.k("mVodBean");
        }
        h.e.a.a.a.b.a.a(this, vodService.a(vodBean.U(), 10), new f(e()));
    }

    public final void w() {
        String str;
        LogUtils.d("=====问题 parseData");
        if (this.f3403o) {
            ((AvVideoView) a(R.id.videoView)).release();
        }
        this.w = false;
        this.f3403o = false;
        F();
        B();
        PlayFromBean playFromBean = this.t;
        if (playFromBean == null) {
            i0.k("playFrom");
        }
        PlayerInfoBean c2 = playFromBean.c();
        i0.a((Object) c2, "playFrom.player_info");
        String e2 = c2.e();
        List<? extends UrlBean> list = this.u;
        if (list != null) {
            if (list == null) {
                i0.f();
            }
            String d2 = list.get(this.f3405q).d();
            i0.a((Object) d2, "playList!![urlIndex].url");
            str = d2;
        } else {
            str = "";
        }
        LogUtils.d("", "====Parse start url=" + str + "  parse=" + e2);
        s();
        r();
        if (!c0.c((CharSequence) str, (CharSequence) PictureFileUtils.POST_VIDEO, false, 2, (Object) null) && !c0.c((CharSequence) str, (CharSequence) ".m3u8", false, 2, (Object) null)) {
            this.I = false;
            AvVideoController avVideoController = this.f3395g;
            if (avVideoController == null) {
                i0.k("controller");
            }
            avVideoController.showJiexi();
            LogUtils.d("", "====Parse start url=正常进这??");
            g.a.b.i.f.INSTANCE.a(e2, str, this.f3401m, this.C, this.f3402n);
            return;
        }
        this.f3403o = true;
        this.f3398j = str;
        f(str);
    }

    public final void x() {
        if (!UserUtils.d()) {
            LoginActivity.f3338o.a();
            return;
        }
        if (this.u == null) {
            return;
        }
        VodService vodService = (VodService) g.a.b.utils.j.INSTANCE.a(VodService.class);
        if (g.a.b.utils.a.a(vodService)) {
            return;
        }
        BaseActivity e2 = e();
        String valueOf = String.valueOf(4);
        VodBean vodBean = this.f3396h;
        if (vodBean == null) {
            i0.k("mVodBean");
        }
        String valueOf2 = String.valueOf(vodBean.U());
        PlayFromBean playFromBean = this.t;
        if (playFromBean == null) {
            i0.k("playFrom");
        }
        String valueOf3 = String.valueOf(playFromBean.f());
        List<? extends UrlBean> list = this.u;
        if (list == null) {
            i0.f();
        }
        h.e.a.a.a.b.a.a(e2, vodService.b(valueOf, valueOf2, valueOf3, String.valueOf(list.get(this.f3405q).c()), String.valueOf(1)), new j());
    }

    public final void y() {
        this.y = 0L;
        this.x = false;
        this.A = 0L;
        int i2 = this.f3405q + 1;
        this.f3405q = i2;
        PlayFromBean playFromBean = this.t;
        if (playFromBean == null) {
            i0.k("playFrom");
        }
        if (i2 >= playFromBean.i().size()) {
            this.f3405q = 0;
        }
        a(this, 0, 1, null);
        w();
    }

    private final void z() {
        PlayScoreBean playScoreBean = this.v;
        if (playScoreBean != null) {
            if (playScoreBean != null) {
                AvVideoController avVideoController = this.f3395g;
                if (avVideoController == null) {
                    i0.k("controller");
                }
                playScoreBean.setPercentage(avVideoController.getPercentage());
                AvVideoController avVideoController2 = this.f3395g;
                if (avVideoController2 == null) {
                    i0.k("controller");
                }
                playScoreBean.setCurProgress(avVideoController2.getCurProgress());
                playScoreBean.setPlaySourceIndex(this.f3404p);
                if (this.u != null) {
                    playScoreBean.setUrlIndex(this.f3405q);
                    List<? extends UrlBean> list = this.u;
                    if (list == null) {
                        i0.f();
                    }
                    playScoreBean.setVodSelectedWorks(list.get(playScoreBean.getUrlIndex()).b());
                }
                String[] strArr = new String[2];
                strArr[0] = "vodId = ?";
                VodBean vodBean = this.f3396h;
                if (vodBean == null) {
                    i0.k("mVodBean");
                }
                strArr[1] = String.valueOf(vodBean.U());
                playScoreBean.saveOrUpdate(strArr);
                return;
            }
            return;
        }
        PlayScoreBean playScoreBean2 = new PlayScoreBean();
        VodBean vodBean2 = this.f3396h;
        if (vodBean2 == null) {
            i0.k("mVodBean");
        }
        playScoreBean2.setVodId(vodBean2.U());
        VodBean vodBean3 = this.f3396h;
        if (vodBean3 == null) {
            i0.k("mVodBean");
        }
        playScoreBean2.setTypeId(vodBean3.g());
        VodBean vodBean4 = this.f3396h;
        if (vodBean4 == null) {
            i0.k("mVodBean");
        }
        playScoreBean2.setVodName(vodBean4.c0());
        VodBean vodBean5 = this.f3396h;
        if (vodBean5 == null) {
            i0.k("mVodBean");
        }
        playScoreBean2.setVodImgUrl(vodBean5.d0());
        AvVideoController avVideoController3 = this.f3395g;
        if (avVideoController3 == null) {
            i0.k("controller");
        }
        playScoreBean2.setPercentage(avVideoController3.getPercentage());
        AvVideoController avVideoController4 = this.f3395g;
        if (avVideoController4 == null) {
            i0.k("controller");
        }
        playScoreBean2.setCurProgress(avVideoController4.getCurProgress());
        playScoreBean2.setPlaySourceIndex(this.f3404p);
        if (this.u != null) {
            playScoreBean2.setUrlIndex(this.f3405q);
            List<? extends UrlBean> list2 = this.u;
            if (list2 == null) {
                i0.f();
            }
            playScoreBean2.setVodSelectedWorks(list2.get(playScoreBean2.getUrlIndex()).b());
        }
        playScoreBean2.save();
        this.v = playScoreBean2;
    }

    public final void j() {
        FragmentTransaction beginTransaction = getSupportFragmentManager().beginTransaction();
        PlayListFragment playListFragment = this.F;
        if (playListFragment == null) {
            i0.f();
        }
        beginTransaction.hide(playListFragment).commitAllowingStateLoss();
    }

    public final void k() {
        FragmentTransaction beginTransaction = getSupportFragmentManager().beginTransaction();
        SummaryFragment summaryFragment = this.E;
        if (summaryFragment == null) {
            i0.f();
        }
        beginTransaction.hide(summaryFragment).commitAllowingStateLoss();
    }

    public final boolean getF3399k() {
        return this.f3399k;
    }

    @NotNull
    public final String getF3398j() {
        return this.f3398j;
    }

    public final void n() {
        List<? extends UrlBean> list;
        PlayListFragment playListFragment = this.F;
        if (playListFragment == null) {
            VodBean vodBean = this.f3396h;
            if (vodBean == null) {
                i0.k("mVodBean");
            }
            PlayListFragment a2 = PlayListFragment.f3427r.a(vodBean.g() == 3 ? 2 : 5);
            List<? extends UrlBean> list2 = this.u;
            if (list2 != null) {
                if (list2 == null) {
                    i0.f();
                }
                a2.a(list2, this.f3405q);
            }
            this.F = a2;
            FragmentTransaction beginTransaction = getSupportFragmentManager().beginTransaction();
            PlayListFragment playListFragment2 = this.F;
            if (playListFragment2 == null) {
                i0.f();
            }
            beginTransaction.add(com.movie.all.R.id.flContainer, playListFragment2).commitAllowingStateLoss();
            return;
        }
        if (playListFragment != null && (list = this.u) != null) {
            if (list == null) {
                i0.f();
            }
            playListFragment.a(list, this.f3405q);
        }
        FragmentTransaction beginTransaction2 = getSupportFragmentManager().beginTransaction();
        PlayListFragment playListFragment3 = this.F;
        if (playListFragment3 == null) {
            i0.f();
        }
        beginTransaction2.show(playListFragment3).commitAllowingStateLoss();
    }

    public final void o() {
        if (this.E == null) {
            SummaryFragment.a aVar = SummaryFragment.f3446o;
            VodBean vodBean = this.f3396h;
            if (vodBean == null) {
                i0.k("mVodBean");
            }
            this.E = aVar.a(vodBean);
            FragmentTransaction beginTransaction = getSupportFragmentManager().beginTransaction();
            SummaryFragment summaryFragment = this.E;
            if (summaryFragment == null) {
                i0.f();
            }
            beginTransaction.add(com.movie.all.R.id.flContainer, summaryFragment).commitAllowingStateLoss();
            return;
        }
        FragmentTransaction beginTransaction2 = getSupportFragmentManager().beginTransaction();
        SummaryFragment summaryFragment2 = this.E;
        if (summaryFragment2 == null) {
            i0.f();
        }
        beginTransaction2.show(summaryFragment2).commitAllowingStateLoss();
    }

    public final void p() {
        VideoDetailFragment videoDetailFragment = this.D;
        if (videoDetailFragment == null) {
            VideoDetailFragment.b bVar = VideoDetailFragment.I;
            VodBean vodBean = this.f3396h;
            if (vodBean == null) {
                i0.k("mVodBean");
            }
            this.D = bVar.a(vodBean, this.f3405q, this.f3404p);
            FragmentTransaction beginTransaction = getSupportFragmentManager().beginTransaction();
            VideoDetailFragment videoDetailFragment2 = this.D;
            if (videoDetailFragment2 == null) {
                i0.f();
            }
            beginTransaction.add(com.movie.all.R.id.flContainer, videoDetailFragment2).commitNowAllowingStateLoss();
            return;
        }
        if (videoDetailFragment != null) {
            videoDetailFragment.b(this.f3405q);
        }
        FragmentTransaction beginTransaction2 = getSupportFragmentManager().beginTransaction();
        VideoDetailFragment videoDetailFragment3 = this.D;
        if (videoDetailFragment3 == null) {
            i0.f();
        }
        beginTransaction2.show(videoDetailFragment3).commitNowAllowingStateLoss();
    }

    public final void i() {
        ToastUtils.showShort("广告播放结束后将获得观影权限!", new Object[0]);
        s.a.a.a.a((Activity) this, (s.a.b.d) new a());
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000%\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u001c\u0010\u0002\u001a\u00020\u00032\b\u0010\u0004\u001a\u0004\u0018\u00010\u00052\b\u0010\u0006\u001a\u0004\u0018\u00010\u0007H\u0016J\u001c\u0010\b\u001a\u00020\u00032\b\u0010\u0004\u001a\u0004\u0018\u00010\u00052\b\u0010\t\u001a\u0004\u0018\u00010\nH\u0016¨\u0006\u000b"}, d2 = {"cn/luckxy/vod/ui/play/NewPlayActivity$getSameActorData$1", "Lcn/luckxy/vod/utils/OkHttpUtils$MyNetCall;", "failed", "", NotificationCompat.CATEGORY_CALL, "Lokhttp3/Call;", "e", "Ljava/io/IOException;", "success", "response", "Lokhttp3/Response;", "app_release"}, k = 1, mv = {1, 1, 15})
    public static final class d implements i.f {
        public final String b;

        public static final class a implements Runnable {
            public a() {
            }

            @Override
            public final void run() {
                Toast.makeText(NewPlayActivity.this, "此源暂时无法播放,请更换播放源再试", 0).show();
            }
        }

        public static final class b implements Runnable {
            public final Integer b;

            public b(Integer num) {
                this.b = num;
            }

            @Override
            public final void run() {
                Integer num = this.b;
                if (num != null && num.intValue() == 403) {
                    if (c0.c((CharSequence) d.this.b, (CharSequence) "mgtv.com", false, 2, (Object) null)) {
                        Map d2 = c1.d(new x(q.b.a.c.l.R, "https://www.mgtv.com/"), new x("User-Agent", "6666"));
                        if (NewPlayActivity.this.B != null) {
                            Map map = NewPlayActivity.this.B;
                            if (map == null) {
                                i0.f();
                            }
                            map.putAll(d2);
                        } else {
                            NewPlayActivity.this.B = c1.e(new x(q.b.a.c.l.R, "https://baidu.com/"));
                            Map map2 = NewPlayActivity.this.B;
                            if (map2 == null) {
                                i0.f();
                            }
                            map2.putAll(d2);
                        }
                        LogUtils.d("", "====Parse  url=" + d.this.b);
                        LogUtils.d("", "====Parse avheaderss url=" + NewPlayActivity.this.B);
                    }
                    AvVideoView avVideoView = (AvVideoView) NewPlayActivity.this.a(R.id.videoView);
                    d dVar = d.this;
                    avVideoView.setUrl(dVar.b, NewPlayActivity.this.B);
                } else {
                    ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).setUrl(d.this.b);
                }
                ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).start();
            }
        }

        public d(String str) {
            this.b = str;
        }

        @Override
        public void a(@Nullable Call call, @Nullable Response response) {
            ResponseBody z;
            if (response != null && (z = response.z()) != null) {
                z.string();
            }
            Integer valueOf = response != null ? Integer.valueOf(response.getCode()) : null;
            LogUtils.d("", "====Parse avheaderss1 url=" + valueOf);
            ((AvVideoView) NewPlayActivity.this.a(R.id.videoView)).post(new b(valueOf));
        }

        @Override
        public void a(@Nullable Call call, @Nullable IOException iOException) {
            NewPlayActivity.this.e().runOnUiThread(new a());
        }
    }

    public final void d(int i2) {
        new SpeedListDialog(e(), this, i2).show();
    }

    private final ArrayList<String> e(String str) {
        ArrayList<String> arrayList = new ArrayList<>();
        if (c0.c((CharSequence) str, (CharSequence) h.k.b.c.f13093g, false, 2, (Object) null)) {
            Object[] array = new Regex(h.k.b.c.f13093g).c(str, 0).toArray(new String[0]);
            if (array != null) {
                for (String str2 : (String[]) array) {
                    arrayList.add(str2);
                }
            } else {
                throw new n0("null cannot be cast to non-null type kotlin.Array<T>");
            }
        } else {
            arrayList.add(str);
        }
        return arrayList;
    }

    @Override
    public void f() {
        super.f();
        AvVideoController avVideoController = this.f3395g;
        if (avVideoController == null) {
            i0.k("controller");
        }
        avVideoController.setControllerClickListener(new g());
        ((AvVideoView) a(R.id.videoView)).setOnStateChangeListener(new h());
    }

    @Override
    public void g() {
        super.g();
        BarUtils.setStatusBarColor(this, ColorUtils.getColor(com.movie.all.R.color.player_status_color));
        Parcelable parcelableExtra = getIntent().getParcelableExtra(PlayActivity.f3416k);
        if (parcelableExtra != null) {
            this.f3396h = (VodBean) parcelableExtra;
            this.f3397i = getIntent().getBooleanExtra(PlayActivity.f3417l, false);
            this.f3395g = new AvVideoController((AvVideoView) a(R.id.videoView), this);
            AvVideoView avVideoView = (AvVideoView) a(R.id.videoView);
            AvVideoController avVideoController = this.f3395g;
            if (avVideoController == null) {
                i0.k("controller");
            }
            avVideoView.setVideoController(avVideoController);
            A();
            return;
        }
        throw new n0("null cannot be cast to non-null type cn.luckxy.vod.bean.VodBean");
    }

    @NotNull
    public final String d(@NotNull String str) {
        i0.f(str, "url");
        ((AvVideoView) a(R.id.videoView)).post(new e(str));
        return str;
    }

    public final void c(int i2) {
        VideoDetailFragment videoDetailFragment = this.D;
        if (videoDetailFragment != null) {
            videoDetailFragment.b(this.f3405q);
        }
        this.f3401m = 0;
        this.f3402n = -1;
    }

    public final void f(String str) {
        System.out.println((Object) ("---play----" + str));
        this.I = true;
        G();
        AvVideoController avVideoController = this.f3395g;
        if (avVideoController == null) {
            i0.k("controller");
        }
        avVideoController.hideJiexi();
        LogUtils.d("", "====Parse play url=" + str);
        LogUtils.d("", "====Parse avheaders url=" + this.B);
        if (c0.c((CharSequence) str, (CharSequence) ".m3u8", false, 2, (Object) null)) {
            c(str);
            return;
        }
        g1.h hVar = new g1.h();
        hVar.a = "";
        List<? extends UrlBean> list = this.u;
        if (list != null) {
            if (list == null) {
                i0.f();
            }
            ?? d2 = list.get(this.f3405q).d();
            i0.a((Object) d2, "playList!![urlIndex].url");
            hVar.a = d2;
        }
        ((AvVideoView) a(R.id.videoView)).post(new k(str, hVar));
    }

    public final void b(int i2) {
        this.f3405q = i2;
        this.y = 0L;
        this.A = 0L;
        this.x = false;
        this.f3402n = -1;
        this.f3401m = 0;
        LogUtils.d("=====问题 changeSelection");
        w();
    }

    @NotNull
    public final String c(@NotNull String str) {
        i0.f(str, "url");
        g.a.b.utils.i.b().b(str, new d(str));
        return "";
    }

    public final void g(String str) {
        if (str.length() == 0) {
            return;
        }
        VodService vodService = (VodService) g.a.b.utils.j.INSTANCE.a(VodService.class);
        if (g.a.b.utils.a.a(vodService)) {
            return;
        }
        BaseActivity e2 = e();
        VodBean vodBean = this.f3396h;
        if (vodBean == null) {
            i0.k("mVodBean");
        }
        h.e.a.a.a.b.a.a(e2, vodService.f(str, String.valueOf(vodBean.U()), String.valueOf(System.currentTimeMillis())), new n());
    }

    public final void a(@NotNull VodBean vodBean) {
        i0.f(vodBean, "vodBean");
        a(false);
        this.y = 0L;
        this.A = 0L;
        z();
        App.f3146l = null;
        this.v = null;
        this.f3396h = vodBean;
        FragmentTransaction beginTransaction = getSupportFragmentManager().beginTransaction();
        VideoDetailFragment videoDetailFragment = this.D;
        if (videoDetailFragment == null) {
            i0.f();
        }
        beginTransaction.remove(videoDetailFragment).commitNowAllowingStateLoss();
        this.D = null;
        if (this.E != null) {
            FragmentTransaction beginTransaction2 = getSupportFragmentManager().beginTransaction();
            SummaryFragment summaryFragment = this.E;
            if (summaryFragment == null) {
                i0.f();
            }
            beginTransaction2.remove(summaryFragment).commitNowAllowingStateLoss();
            this.E = null;
        }
        if (this.F != null) {
            FragmentTransaction beginTransaction3 = getSupportFragmentManager().beginTransaction();
            PlayListFragment playListFragment = this.F;
            if (playListFragment == null) {
                i0.f();
            }
            beginTransaction3.remove(playListFragment).commitNowAllowingStateLoss();
            this.F = null;
        }
        ((AvVideoView) a(R.id.videoView)).release();
        AvVideoController avVideoController = this.f3395g;
        if (avVideoController == null) {
            i0.k("controller");
        }
        VodBean vodBean2 = this.f3396h;
        if (vodBean2 == null) {
            i0.k("mVodBean");
        }
        avVideoController.setTitle(vodBean2.L());
        v();
    }

    public static void a(NewPlayActivity newPlayActivity, int i2, int i3, Object obj) {
        if ((i3 & 1) != 0) {
            i2 = -1;
        }
        newPlayActivity.c(i2);
    }

    public final void a(@NotNull PlayFromBean playFromBean, int i2) {
        i0.f(playFromBean, "playFromBean");
        this.f3406r = this.f3405q + 1;
        this.t = playFromBean;
        if (playFromBean == null) {
            i0.k("playFrom");
        }
        this.u = playFromBean.i();
        this.f3404p = i2;
        this.f3401m = 0;
        this.f3402n = -1;
        if (playFromBean.i().size() >= this.f3406r) {
            LogUtils.d(Integer.valueOf(playFromBean.i().size()));
            LogUtils.d("=====问题 changePlaySource");
            w();
            VideoDetailFragment videoDetailFragment = this.D;
            if (videoDetailFragment != null) {
                videoDetailFragment.c(i2);
                return;
            }
            return;
        }
        this.f3405q = 0;
        w();
        VideoDetailFragment videoDetailFragment2 = this.D;
        if (videoDetailFragment2 != null) {
            videoDetailFragment2.c(i2);
        }
        a(this, 0, 1, null);
        Toast.makeText(this, "此源暂无此集,正在播放第一集,请重新选集", 0).show();
    }

    public final void a(@NotNull h.h.a.a.h.a aVar) {
        String str;
        i0.f(aVar, "device");
        if (this.w) {
            if (this.f3398j.length() > 0) {
                if (b0.d(this.f3398j, "//", false, 2, null)) {
                    str = d0.f19384e + this.f3398j;
                } else {
                    str = this.f3398j;
                }
                h.h.a.a.e.d().c(aVar);
                Intent intent = new Intent(this, (Class<?>) CastScreenActivity2.class);
                VodBean vodBean = this.f3396h;
                if (vodBean == null) {
                    i0.k("mVodBean");
                }
                intent.putExtra("vod", vodBean);
                intent.putExtra("playSourceIndex", this.f3404p);
                intent.putExtra(VideoDetailFragment.G, this.f3405q);
                intent.putExtra("vodurl", str);
                AvVideoController avVideoController = this.f3395g;
                if (avVideoController == null) {
                    i0.k("controller");
                }
                intent.putExtra("vodLong", avVideoController.getDuration());
                System.out.println((Object) ("vodurl+=" + str));
                ArrayList<? extends Parcelable> arrayList = new ArrayList<>();
                List<? extends PlayFromBean> list = this.f3407s;
                if (list == null) {
                    i0.k("playFormList");
                }
                ArrayList arrayList2 = new ArrayList(z.a(list, 10));
                Iterator<T> it = list.iterator();
                while (it.hasNext()) {
                    arrayList2.add(Boolean.valueOf(arrayList.add((PlayFromBean) it.next())));
                }
                intent.putParcelableArrayListExtra("playFormList", arrayList);
                ActivityUtils.startActivity(intent);
                return;
            }
        }
        runOnUiThread(b.a);
    }

    public final void a(boolean z) {
        String str;
        AvVideoController avVideoController = this.f3395g;
        if (avVideoController == null) {
            i0.k("controller");
        }
        long curProgress = avVideoController.getCurProgress();
        if (curProgress == 0) {
            if (z) {
                finish();
                return;
            }
            return;
        }
        if (curProgress != 0) {
            this.y = curProgress;
        }
        VodBean vodBean = this.f3396h;
        if (vodBean == null) {
            i0.k("mVodBean");
        }
        String valueOf = String.valueOf(vodBean.U());
        Log.e(this.f3394f, "======voidid===" + valueOf);
        AvVideoController avVideoController2 = this.f3395g;
        if (avVideoController2 == null) {
            i0.k("controller");
        }
        String valueOf2 = String.valueOf(avVideoController2.getPercentage());
        if (i0.a((Object) valueOf2, (Object) "NaN")) {
            valueOf2 = "0.0";
        }
        String str2 = valueOf2;
        System.out.println((Object) ("进度 ---savePlayRecord---  curProgress=" + curProgress));
        List<? extends UrlBean> list = this.u;
        if ((list == null || list.isEmpty()) && z) {
            finish();
            return;
        }
        int i2 = this.f3405q;
        List<? extends UrlBean> list2 = this.u;
        if (list2 == null) {
            i0.f();
        }
        String b2 = list2.get(i2).b();
        VodBean vodBean2 = this.f3396h;
        if (vodBean2 == null) {
            i0.k("mVodBean");
        }
        if (vodBean2.h0() != null) {
            VodBean vodBean3 = this.f3396h;
            if (vodBean3 == null) {
                i0.k("mVodBean");
            }
            List<PlayFromBean> h0 = vodBean3.h0();
            if (h0 == null) {
                i0.f();
            }
            PlayFromBean playFromBean = h0.get(this.f3404p);
            i0.a((Object) playFromBean, "playFromBean");
            PlayerInfoBean c2 = playFromBean.c();
            playFromBean.i();
            i0.a((Object) c2, "playerInfo");
            str = c2.g();
            i0.a((Object) str, "playerInfo.show");
        } else {
            str = "";
        }
        if (StringUtils.isEmpty(str)) {
            str = "默认";
        }
        if (!UserUtils.d()) {
            if (z) {
                finish();
                return;
            }
            return;
        }
        VodService vodService = (VodService) g.a.b.utils.j.INSTANCE.a(VodService.class);
        if (g.a.b.utils.a.a(vodService)) {
            return;
        }
        Log.d(this.f3394f, "voidid=" + valueOf + "  vodSelectedWorks=" + b2 + "  playSource=" + str + "  percentage=" + str2 + " curProgress=" + curProgress);
        i0.a((Object) b2, "vodSelectedWorks");
        h.e.a.a.a.b.a.a(this, vodService.a(valueOf, b2, str.toString(), str2, String.valueOf(i2), String.valueOf(curProgress), String.valueOf(this.f3404p)), new l(z));
        StringBuilder sb = new StringBuilder();
        sb.append("watchVideoLong==");
        sb.append(this.N);
        System.out.println((Object) sb.toString());
        int i3 = this.N;
        if (i3 != 0) {
            h.e.a.a.a.b.a.a(this, vodService.a(i3), new m());
        }
    }

    @Override
    public void a(@NotNull String str) {
        i0.f(str, "speed");
        AvVideoController avVideoController = this.f3395g;
        if (avVideoController == null) {
            i0.k("controller");
        }
        avVideoController.setSpeedSelect(str);
    }

    public final float a(long j2, long j3) {
        float f2 = ((float) j2) / (((float) j3) * 1.0f);
        DecimalFormat decimalFormat = new DecimalFormat("#.00");
        DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols();
        decimalFormatSymbols.setDecimalSeparator(q.a.a.a.p.f18493d);
        decimalFormat.setDecimalFormatSymbols(decimalFormatSymbols);
        Float valueOf = Float.valueOf(decimalFormat.format(f2));
        i0.a((Object) valueOf, "java.lang.Float.valueOf(…t(percentage.toDouble()))");
        return valueOf.floatValue();
    }
}