QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685

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


package com.tencent.mtt.video.internal.player.ui;

import android.app.ActivityManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.TextureView;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.ValueCallback;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
import com.tencent.common.http.Apn;
import com.tencent.common.manifest.EventEmiter;
import com.tencent.common.manifest.EventMessage;
import com.tencent.common.threadpool.BrowserExecutorSupplier;
import com.tencent.common.utils.FileUtils;
import com.tencent.common.utils.GdiMeasureImpl;
import com.tencent.common.utils.IntentUtils;
import com.tencent.connect.common.Constants;
import com.tencent.mtt.ContextHolder;
import com.tencent.mtt.apkplugin.impl.IAPInjectService;
import com.tencent.mtt.base.stat.utils.PlatformStatUtils;
import com.tencent.mtt.base.utils.permission.PermissionRequest;
import com.tencent.mtt.base.utils.permission.PermissionUtils;
import com.tencent.mtt.browser.jsextension.open.IOpenJsApis;
import com.tencent.mtt.log.access.Logs;
import com.tencent.mtt.multiproc.QBSharedPreferences;
import com.tencent.mtt.video.browser.export.constant.StatVideoConsts;
import com.tencent.mtt.video.browser.export.constant.VideoConstants;
import com.tencent.mtt.video.browser.export.data.H5VideoEpisodeInfo;
import com.tencent.mtt.video.browser.export.db.IVideoDbHelper;
import com.tencent.mtt.video.browser.export.external.dlna.DmrDevice;
import com.tencent.mtt.video.browser.export.external.dlna.IDlnaListener;
import com.tencent.mtt.video.browser.export.external.dlna.IJDlna;
import com.tencent.mtt.video.browser.export.media.IMediaPlayer;
import com.tencent.mtt.video.browser.export.player.IH5VideoEpisoder;
import com.tencent.mtt.video.browser.export.player.IPlayerShareController;
import com.tencent.mtt.video.browser.export.player.IVideoWebViewProxy;
import com.tencent.mtt.video.browser.export.player.ui.IVideoExtraAbilityControllerHolder;
import com.tencent.mtt.video.browser.export.player.ui.VideoMediaAbilityControllerBase;
import com.tencent.mtt.video.browser.export.player.ui.ext.IVideoViewExt;
import com.tencent.mtt.video.browser.export.player.ui.ext.IVideoViewExtCreator;
import com.tencent.mtt.video.browser.export.player.ui.ext.IVideoViewExtEventListener;
import com.tencent.mtt.video.export.H5VideoInfo;
import com.tencent.mtt.video.export.IH5VideoPlayer;
import com.tencent.mtt.video.export.PlayerEnv;
import com.tencent.mtt.video.export.VideoHost;
import com.tencent.mtt.video.export.VideoProxyDefault;
import com.tencent.mtt.video.internal.adapter.PlayerSwitchController;
import com.tencent.mtt.video.internal.engine.IH5VideoMediaControllerInter;
import com.tencent.mtt.video.internal.engine.VideoManager;
import com.tencent.mtt.video.internal.engine.VideoNetworkStatus;
import com.tencent.mtt.video.internal.engine.VideoPrefDefine;
import com.tencent.mtt.video.internal.facade.IVideoService;
import com.tencent.mtt.video.internal.media.IMediaPlayerInter;
import com.tencent.mtt.video.internal.media.SuperPlayerPluginSession;
import com.tencent.mtt.video.internal.media.WonderPlayer;
import com.tencent.mtt.video.internal.player.H5VideoPlayer;
import com.tencent.mtt.video.internal.player.ability.VideoMediaDspAbility;
import com.tencent.mtt.video.internal.player.ui.base.VideoSeekBar;
import com.tencent.mtt.video.internal.player.ui.episode.PagePickEpisodeController;
import com.tencent.mtt.video.internal.player.ui.floatelement.H5VideoAlertWndHintController;
import com.tencent.mtt.video.internal.player.ui.floatelement.H5VideoDlnaDialogController;
import com.tencent.mtt.video.internal.player.ui.floatelement.H5VideoPageSettingDialog;
import com.tencent.mtt.video.internal.player.ui.floatelement.H5VideoSettingController;
import com.tencent.mtt.video.internal.player.ui.floatelement.VideoTipsController;
import com.tencent.mtt.video.internal.player.ui.floatelement.bubble.VideoBubbleController;
import com.tencent.mtt.video.internal.player.ui.floatelement.playspeed.page.H5VideoSpeedControlPageDialog;
import com.tencent.mtt.video.internal.player.ui.guide.H5VideoGuideConstantsKt;
import com.tencent.mtt.video.internal.player.ui.guide.H5VideoGuideManager;
import com.tencent.mtt.video.internal.player.ui.inline.IVideoInlinePanel;
import com.tencent.mtt.video.internal.player.ui.inline.VideoInlineExpKt;
import com.tencent.mtt.video.internal.player.ui.longpress.H5VideoLongPressController;
import com.tencent.mtt.video.internal.player.ui.panel.VideoDlnaPanelView;
import com.tencent.mtt.video.internal.player.ui.panel.VideoMediaControllerStatusBtn;
import com.tencent.mtt.video.internal.player.ui.panel.VideoMediaControllerView;
import com.tencent.mtt.video.internal.player.ui.panel.VideoQueenGuideUI;
import com.tencent.mtt.video.internal.player.ui.panel.VideoSecondPanelView;
import com.tencent.mtt.video.internal.player.ui.render.QBVideoRenderer;
import com.tencent.mtt.video.internal.player.ui.settings.H5VideoSettingCenter;
import com.tencent.mtt.video.internal.player.ui.tencentvideo.definition.TVideoDefinitionDialogController;
import com.tencent.mtt.video.internal.player.ui.tencentvideo.episode.TVideoEpisodeController;
import com.tencent.mtt.video.internal.player.ui.tencentvideo.episode.bean.TVBaseInfo;
import com.tencent.mtt.video.internal.player.ui.tencentvideo.settings.TVideoSettingsDialogController;
import com.tencent.mtt.video.internal.resource.VideoResources;
import com.tencent.mtt.video.internal.stat.FeatureStat;
import com.tencent.mtt.video.internal.stat.LiteWindowStat;
import com.tencent.mtt.video.internal.stat.VideoErrorStatSession;
import com.tencent.mtt.video.internal.tvideo.TVideoProxy;
import com.tencent.mtt.video.internal.tvideo.TVideoStatHelperKt;
import com.tencent.mtt.video.internal.utils.CommonUtils;
import com.tencent.mtt.video.internal.utils.DeviceUtils;
import com.tencent.mtt.video.internal.utils.SafeBundleUtil;
import com.tencent.mtt.video.internal.utils.TaskUtils;
import com.tencent.mtt.video.internal.utils.VideoLogHelper;
import com.tencent.mtt.video.internal.utils.VideoProgressUserGestureListener;
import com.tencent.mtt.video.internal.utils.VideoSharedPreferences;
import com.tencent.mtt.view.dialog.newui.DialogABTestHelper;
import com.tencent.mtt.view.dialog.newui.SimpleDialogBuilder;
import com.tencent.mtt.view.dialog.newui.dialog.DialogBase;
import com.tencent.mtt.view.dialog.newui.view.ViewOnClickListener;
import com.tencent.mtt.view.toast.MttToaster;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;

public class H5VideoMediaController implements View.OnClickListener, View.OnKeyListener, IDlnaListener, IVideoViewExtEventListener, IH5VideoMediaControllerInter, VideoSeekBar.OnSeekBarChangeListener, VideoDlnaPanelView.IDlnaPanelViewListener, VideoMediaControllerView.IMediaControllerViewListener {
    private static String l = "H5VideoMediaController";
    private VideoMediaAbilityControllerBase A;
    private IVideoExtraAbilityControllerHolder.VideoLoadUrlAbilityController B;
    private IPlayerShareController C;
    private IVideoExtraAbilityControllerHolder.IH5VideoErrorController D;
    private H5VideoAlertWndHintController E;
    private H5VideoSystemStatusController F;
    private H5VideoProgressBarController G;
    private VideoAutoHideShowController H;
    private MuteBtnShowController I;
    private VideoScreenshotController J;
    private final TVideoDefinitionDialogController K;
    private VideoMediaDspAbility L;
    private VideoGestureDispatcher O;
    private Context P;
    private IVideoInlinePanel Q;
    private int U;
    private TVKAdvController W;
    private SharedPreferences Z;
    private H5VideoSpeedControlPageDialog ab;
    private IVideoExtraAbilityControllerHolder.DlnaInitListener ad;
    private final H5VideoGuideManager ae;

    public final VideoMediaControllerView f72811b;

    public VideoSecondPanelView f72812c;

    public VideoDlnaPanelView f72813d;
    H5VideoPlayer e;
    IVideoExtraAbilityControllerHolder.VideoDlnaAbilityController f;
    protected boolean g;
    public TVideoEpisodeController h;
    public TVideoSettingsDialogController i;
    public final VideoBubbleController j;
    public final PagePickEpisodeController k;
    private VideoQueenGuideUI p;
    private H5VideoSettingController q;
    private H5VideoDlnaDialogController r;
    private VideoTipsController s;
    private H5VideoProductOperationController t;
    private H5VideoLongPressController u;
    private IVideoExtraAbilityControllerHolder.VideoMediaCacheAbilityController v;
    private IVideoExtraAbilityControllerHolder.VideoMediaCollectAbilityController w;
    private VideoMediaAbilityControllerBase x;
    private IJDlna z;

    final int f72810a = -1;
    private int m = 0;
    private final int n = 2;
    private Handler o = new Handler(Looper.getMainLooper());
    private final AtomicBoolean y = new AtomicBoolean(false);
    private VideoMediaControllerStatusBtn M = new VideoMediaControllerStatusBtn();
    private int N = 0;
    private VideoSameFullScreenPanel R = null;
    private int S = -1;
    private int T = Integer.MAX_VALUE;
    private int V = -1;
    private boolean X = true;
    private boolean Y = false;
    private IVideoViewExtCreator aa = null;
    private VideoSharedPreferences ac = VideoSharedPreferences.a();
    private int af = 2;
    private final Set<VideoProgressUserGestureListener> ag = new LinkedHashSet();

    public static class AnonymousClass10 {

        static final int[] f72816b = new int[IMediaPlayer.PlayerType.values().length];

        static {
            try {
                f72816b[IMediaPlayer.PlayerType.SYSTEM_PLAYER.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                f72816b[IMediaPlayer.PlayerType.WONDER_PLAYER.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                f72816b[IMediaPlayer.PlayerType.OUTSIDE_PLAYER.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                f72816b[IMediaPlayer.PlayerType.UNKNOW.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                f72816b[IMediaPlayer.PlayerType.QVOD_PLAYER.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            f72815a = new int[VideoMediaControllerStatusBtn.DownloadTips.values().length];
            try {
                f72815a[VideoMediaControllerStatusBtn.DownloadTips.INITING.ordinal()] = 1;
            } catch (NoSuchFieldError unused6) {
            }
            try {
                f72815a[VideoMediaControllerStatusBtn.DownloadTips.MSEVIDEO.ordinal()] = 2;
            } catch (NoSuchFieldError unused7) {
            }
            try {
                f72815a[VideoMediaControllerStatusBtn.DownloadTips.COPYRIGHT.ordinal()] = 3;
            } catch (NoSuchFieldError unused8) {
            }
            try {
                f72815a[VideoMediaControllerStatusBtn.DownloadTips.LIVEVIDEO.ordinal()] = 4;
            } catch (NoSuchFieldError unused9) {
            }
            try {
                f72815a[VideoMediaControllerStatusBtn.DownloadTips.NOTINITED.ordinal()] = 5;
            } catch (NoSuchFieldError unused10) {
            }
            try {
                f72815a[VideoMediaControllerStatusBtn.DownloadTips.LOCALVIDEO.ordinal()] = 6;
            } catch (NoSuchFieldError unused11) {
            }
            try {
                f72815a[VideoMediaControllerStatusBtn.DownloadTips.SRCLIMITED.ordinal()] = 7;
            } catch (NoSuchFieldError unused12) {
            }
            try {
                f72815a[VideoMediaControllerStatusBtn.DownloadTips.EPISODERNULL.ordinal()] = 8;
            } catch (NoSuchFieldError unused13) {
            }
            try {
                f72815a[VideoMediaControllerStatusBtn.DownloadTips.VIDEOSRCNULL.ordinal()] = 9;
            } catch (NoSuchFieldError unused14) {
            }
        }
    }

    public interface OnPermissionCheckCallback {
        void a(boolean z);
    }

    public H5VideoMediaController(Context context, H5VideoPlayer h5VideoPlayer) {
        this.Z = null;
        this.P = context;
        this.e = h5VideoPlayer;
        this.Z = QBSharedPreferences.getSharedPreferences(context, VideoConstants.VIDEO_PREFS_NAME, 0);
        this.f72811b = new VideoMediaControllerView(this.P, h5VideoPlayer, this);
        this.f72811b.setItemOnClickListener(this);
        this.f72811b.setSeekBarChangeListener(this);
        this.f72811b.setMediaControllerViewListener(this);
        this.f72811b.setVideoViewExtEventListener(this);
        this.f72811b.setId(53);
        this.f72811b.setOnKeyListener(this);
        this.f72812c = new VideoSecondPanelView(this.P, this);
        this.f72812c.setId(77);
        this.f72813d = new VideoDlnaPanelView(this.P, this);
        this.f72813d.setId(83);
        this.f72813d.setDlnaPanelShowStateListener(this);
        this.H = new VideoAutoHideShowController(this);
        this.f72811b.setOnDispatchTouchListener(this.H);
        this.F = new H5VideoSystemStatusController(this.f72811b);
        this.G = new H5VideoProgressBarController(this, this.e, this.f72811b);
        this.q = new H5VideoSettingController(this.P, this);
        if (!bt()) {
            this.t = new H5VideoProductOperationController(this.P, this);
            this.f72811b.setH5VideoProductOperationController(this.t);
        }
        this.u = new H5VideoLongPressController(this);
        this.r = new H5VideoDlnaDialogController(this);
        this.E = new H5VideoAlertWndHintController(this, this.P);
        this.W = new TVKAdvController();
        this.W.a(this.f72811b);
        this.I = new MuteBtnShowController(context, this.f72811b);
        this.ae = new H5VideoGuideManager();
        this.ae.b(this.u);
        this.h = new TVideoEpisodeController(this.P, this);
        this.i = new TVideoSettingsDialogController(this, h5VideoPlayer, this.P);
        Context context2 = this.P;
        this.K = new TVideoDefinitionDialogController(context2 == null ? ContextHolder.getAppContext() : context2, this, h5VideoPlayer);
        this.j = new VideoBubbleController(this);
        this.k = new PagePickEpisodeController(this);
        this.e.a(this.k);
    }

    private String A(int i) {
        String str;
        if (i != 207) {
            switch (i) {
                case 200:
                    str = "video_sdk_play_speed_cant_tip_player_init";
                    break;
                case 201:
                    str = "video_sdk_play_speed_cant_tip_decoder_version_too_low";
                    break;
                case 202:
                    str = "video_sdk_play_speed_cant_tip_source_living";
                    break;
                case 203:
                    str = "video_sdk_play_speed_cant_tip_source_mse";
                    break;
                case 204:
                    str = "video_sdk_play_speed_cant_tip_source_system";
                    break;
                default:
                    str = "video_sdk_play_speed_cant_tip_source_unknown";
                    break;
            }
        } else {
            str = "video_sdk_play_speed_cant_tip_source_in_black_list";
        }
        return VideoResources.b(str);
    }

    private void a(VideoMediaAbilityControllerBase videoMediaAbilityControllerBase) {
        if (videoMediaAbilityControllerBase != null) {
            videoMediaAbilityControllerBase.destory();
        }
    }

    private void a(final OnPermissionCheckCallback onPermissionCheckCallback) {
        PermissionUtils.a(PermissionUtils.a(4), new PermissionRequest.Callback() {
            @Override
            public void onPermissionRequestGranted(boolean z) {
                onPermissionCheckCallback.a(true);
            }

            @Override
            public void onPermissionRevokeCanceled() {
                onPermissionCheckCallback.a(false);
                H5VideoMediaController.this.bJ();
            }
        }, true);
    }

    private void b(final View view) {
        a(new OnPermissionCheckCallback() {
            @Override
            public void a(boolean z) {
                if (z) {
                    H5VideoMediaController.this.t(view.getId());
                    H5VideoMediaController.this.aP();
                    VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION30, H5VideoMediaController.this.e.cg());
                }
            }
        });
    }

    private void bA() {
        this.q.b(1);
        p();
        setControllerBtnStatus(35, 0);
    }

    private void bB() {
        aw();
        VideoManager.getInstance().getVideoHost().userBehaviorStatistics("BZWSP108");
    }

    private void bC() {
        VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION175, this.e.cg());
        if (DeviceUtils.a(this.P)) {
            this.e.switchScreen(111);
        } else {
            this.E.a();
        }
    }

    private void bD() {
        boolean bJ = this.e.bJ();
        H5VideoPlayer h5VideoPlayer = this.e;
        float f = bJ ? 1.0f : 0.0f;
        h5VideoPlayer.setVolume(f, f);
        this.I.a(!bJ, true);
        VideoManager.getInstance().getVideoHost().userBehaviorStatistics("MUTE002");
    }

    private void bE() {
        VideoHost videoHost;
        Map<String, String> cg;
        String str;
        if (this.e.cn().t()) {
            if (o()) {
                this.e.cn().c(TVideoStatHelperKt.b("2"));
                this.i.a();
                p();
                return;
            }
            return;
        }
        if (o()) {
            bA();
            this.H.b();
            VideoManager.getInstance().getVideoHost().userBehaviorStatistics("N344");
            videoHost = VideoManager.getInstance().getVideoHost();
            cg = this.e.cg();
            str = StatVideoConsts.VALUE_EVENT_VIDEO_ACTION17;
        } else {
            bF();
            ch();
            videoHost = VideoManager.getInstance().getVideoHost();
            cg = this.e.cg();
            str = StatVideoConsts.VALUE_EVENT_VIDEO_ACTION94;
        }
        videoHost.userBehaviorWithParams(str, cg);
    }

    private void bF() {
        List<ActivityManager.RunningTaskInfo> runningTasks;
        ComponentName componentName;
        if (this.e.getScreenMode() != 109 || (runningTasks = ((ActivityManager) this.P.getSystemService("activity")).getRunningTasks(1)) == null || runningTasks.size() <= 0 || (componentName = runningTasks.get(0).topActivity) == null || this.P.getPackageName().equals(componentName.getClassName())) {
            return;
        }
        this.P.startActivity(this.P.getPackageManager().getLaunchIntentForPackage(this.P.getPackageName()));
    }

    private void bG() {
        if (this.G.p()) {
            return;
        }
        this.G.k(3);
        a(false, false);
    }

    private void bH() {
        if (this.G.o() == 6) {
            this.D.onNotFoundVideoUrl(this.e.getWebUrl());
            X();
            return;
        }
        if (this.G.o() == 4) {
            IVideoExtraAbilityControllerHolder.IH5VideoErrorController iH5VideoErrorController = this.D;
            if (iH5VideoErrorController != null) {
                iH5VideoErrorController.onSdcardNoSpace(false);
                return;
            }
            return;
        }
        if (this.G.o() == 10) {
            al();
            this.f72811b.d(true);
            return;
        }
        if (this.G.o() == 13) {
            return;
        }
        if (this.G.o() == 15 || this.G.o() == 8) {
            this.G.k(2);
            a(true, false);
            return;
        }
        if (this.G.p()) {
            return;
        }
        if (!TextUtils.isEmpty(getWebUrl()) && this.e.getProxyType() == 2 && CommonUtils.a(this.G.o()) && this.G.o() != -21010) {
            exitPlayerAndJmmpPage(getWebUrl());
            return;
        }
        boolean z = this.G.o() == 1;
        this.G.k(3);
        a(false, z);
    }

    public String bI() {
        switch (this.M.i) {
            case INITING:
                return StatVideoConsts.VALUE_EVENT_VIDEO_ACTION62;
            case MSEVIDEO:
                return StatVideoConsts.VALUE_EVENT_VIDEO_ACTION61;
            case COPYRIGHT:
                return StatVideoConsts.VALUE_EVENT_VIDEO_ACTION54;
            case LIVEVIDEO:
                return StatVideoConsts.VALUE_EVENT_VIDEO_ACTION60;
            case NOTINITED:
                return StatVideoConsts.VALUE_EVENT_VIDEO_ACTION59;
            case LOCALVIDEO:
                return StatVideoConsts.VALUE_EVENT_VIDEO_ACTION57;
            case SRCLIMITED:
                return StatVideoConsts.VALUE_EVENT_VIDEO_ACTION58;
            case EPISODERNULL:
                return StatVideoConsts.VALUE_EVENT_VIDEO_ACTION55;
            case VIDEOSRCNULL:
                return StatVideoConsts.VALUE_EVENT_VIDEO_ACTION56;
            default:
                return null;
        }
    }

    public void bJ() {
        MttToaster.show("“SD卡存储”权限被拒绝,无法进行下载", 1);
    }

    private boolean bK() {
        return this.e.cn().t() && this.h.b();
    }

    private boolean bL() {
        return this.e.cn().t() && this.h.c();
    }

    private boolean bM() {
        return false;
    }

    private boolean bN() {
        return H5VideoPlayer.m(getVideoUrl()) && o();
    }

    private boolean bO() {
        if (this.e.j(3) || aK() || H5VideoPlayer.m(this.e.getVideoUrl()) || this.e.bU() || IOpenJsApis.TRUE.equals(this.e.u(14))) {
            return false;
        }
        return (getCurrentProxy().getProxyType() != 6 || aM()) && !this.e.cn().t();
    }

    private boolean bP() {
        return (this.w == null || this.e.getEpisodeInfo() == null || !this.e.a(2L) || FileUtils.l(this.e.getVideoUrl()) || this.e.bU()) ? false : true;
    }

    private void bQ() {
        if (this.e.ad() || v(this.e.bf())) {
            this.G.f();
        }
    }

    private void bR() {
        String videoTitle = this.e.getVideoTitle();
        if (this.e.az()) {
            this.f72811b.a("", "");
        } else if (TextUtils.isEmpty(videoTitle)) {
            this.f72811b.a("", "");
        } else {
            this.f72811b.a(videoTitle, "");
        }
    }

    private void bS() {
        if (this.f != null && this.z == null && j(5) && this.y.compareAndSet(false, true)) {
            if (this.ad == null) {
                this.ad = new IVideoExtraAbilityControllerHolder.DlnaInitListener() {
                    @Override
                    public void onInit(boolean z, int i, IJDlna iJDlna) {
                        boolean a2 = H5VideoMediaController.this.r.a();
                        H5VideoMediaController.this.r.a(false);
                        if (H5VideoMediaController.this.f != null) {
                            H5VideoMediaController h5VideoMediaController = H5VideoMediaController.this;
                            h5VideoMediaController.z = h5VideoMediaController.f.getDlnaInstance();
                            if (H5VideoMediaController.this.z != null) {
                                H5VideoMediaController.this.r.a(H5VideoMediaController.this.z);
                                H5VideoMediaController.this.z.setIDlnaListener(H5VideoMediaController.this);
                                VideoLogHelper.d(H5VideoMediaController.l, "Set listener(initDlnaIfNeed) to " + this);
                                if (a2) {
                                    H5VideoMediaController.this.bx();
                                }
                            } else if (a2) {
                                MttToaster.show("投屏插件加载失败", 0);
                            }
                        }
                        H5VideoMediaController.this.y.set(false);
                        H5VideoMediaController.this.r.e();
                    }
                };
            }
            this.f.setInitListener(this.ad);
            this.f.request(null);
        }
    }

    private void bT() {
        int i = this.M.g;
        if (isLocalVideo() && bn()) {
            this.M.g = 0;
        } else {
            this.M.g = 1;
        }
        if (i == 1 && this.M.g == 0) {
            VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION37, this.e.cg());
        }
    }

    private void bU() {
        VideoMediaControllerStatusBtn videoMediaControllerStatusBtn;
        int i;
        int bf = this.e.bf();
        boolean isLiveStreaming = isLiveStreaming();
        boolean isPlaying = this.e.isPlaying();
        int i2 = 2;
        if (bf == 4 || bf == 3 || bf == 6) {
            VideoMediaControllerStatusBtn videoMediaControllerStatusBtn2 = this.M;
            if (isLiveStreaming) {
                videoMediaControllerStatusBtn2.r = 1;
                videoMediaControllerStatusBtn2.h = 1;
            } else {
                videoMediaControllerStatusBtn2.r = 0;
                videoMediaControllerStatusBtn2.h = 0;
            }
            if (isPlaying) {
                videoMediaControllerStatusBtn = this.M;
                i = 1001;
            } else {
                videoMediaControllerStatusBtn = this.M;
                i = 1000;
            }
            videoMediaControllerStatusBtn.f73460c = i;
        } else {
            VideoMediaControllerStatusBtn videoMediaControllerStatusBtn3 = this.M;
            videoMediaControllerStatusBtn3.f73460c = 2;
            videoMediaControllerStatusBtn3.r = 2;
        }
        VideoMediaControllerStatusBtn videoMediaControllerStatusBtn4 = this.M;
        if ((bf == 3 || bf == 4) && !isLiveStreaming) {
            i2 = 0;
        }
        videoMediaControllerStatusBtn4.f73461d = i2;
    }

    private void bV() {
        VideoMediaControllerView videoMediaControllerView;
        int i;
        if (this.e.isLiveStreaming()) {
            videoMediaControllerView = this.f72811b;
            i = 101;
        } else {
            videoMediaControllerView = this.f72811b;
            i = 100;
        }
        videoMediaControllerView.setContentMode(i);
    }

    private void bW() {
        VideoMediaControllerStatusBtn videoMediaControllerStatusBtn;
        int i;
        if (this.e.aT() && this.e.aV()) {
            videoMediaControllerStatusBtn = this.M;
            i = 0;
        } else {
            videoMediaControllerStatusBtn = this.M;
            i = 1;
        }
        videoMediaControllerStatusBtn.t = i;
    }

    private void bX() {
        VideoMediaControllerStatusBtn videoMediaControllerStatusBtn;
        H5VideoPlayer h5VideoPlayer = this.e;
        if (h5VideoPlayer != null) {
            int i = 1;
            if (h5VideoPlayer.isLocalVideo() || VideoManager.getInstance().getVideoHostType() != 1) {
                videoMediaControllerStatusBtn = this.M;
            } else {
                videoMediaControllerStatusBtn = this.M;
                i = 0;
            }
            videoMediaControllerStatusBtn.n = i;
        }
    }

    private void bY() {
        if (!this.e.isLocalVideo() || aS() || this.e.ci()) {
            return;
        }
        this.M.o = 0;
    }

    private void bZ() {
        if (this.e.isLocalVideo()) {
            if (this.M.p != 0) {
                VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION28, this.e.cg());
            }
            this.M.p = 0;
        }
    }

    private void bs() {
        if (this.s == null) {
            this.s = new VideoTipsController(this, this.P);
            this.s.b(getPlayerScreenMode());
        }
    }

    private boolean bt() {
        int a2 = GdiMeasureImpl.a(this.P);
        int b2 = GdiMeasureImpl.b(this.P);
        return Math.min(a2, b2) < 480 && Math.max(a2, b2) < 800;
    }

    private void bu() {
        if (this.e.bz()) {
            this.e.cn().c(TVideoStatHelperKt.b("0"));
        }
        if (this.e.cn().H() || this.e.ab()) {
            return;
        }
        X();
    }

    private void bv() {
        if (this.e.isLiveStreaming()) {
            return;
        }
        int currentPosition = this.e.getCurrentPosition();
        int duration = this.e.getDuration();
        int i = currentPosition + 15000;
        if (i > duration) {
            i = duration;
        }
        this.e.a(i, true);
    }

    private void bw() {
        this.e.d(2);
        SimpleDialogBuilder.e().e("体验投屏功能,请确认您的电视和移动设备连接到同一WI-FI").b(true).a("我知道了").a_(new ViewOnClickListener() {
            @Override
            public void onClick(View view, DialogBase dialogBase) {
                dialogBase.dismiss();
            }
        }).e();
    }

    public void bx() {
        VideoHost videoHost;
        Map<String, String> cg;
        String str;
        IJDlna iJDlna = this.z;
        if (iJDlna != null) {
            iJDlna.setIDlnaListener(this);
            VideoLogHelper.d(l, "Set listener(showDlnaDialogWithServiceStarted): " + this);
        }
        BrowserExecutorSupplier.forTimeoutTasks().execute(new Runnable() {
            @Override
            public void run() {
                H5VideoMediaController.this.z.start();
            }
        });
        this.r.c();
        VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION19, this.e.cg());
        if (this.e.isLocalVideo()) {
            VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION108, this.e.cg());
        }
        if (this.f72811b.u()) {
            videoHost = VideoManager.getInstance().getVideoHost();
            cg = this.e.cg();
            str = StatVideoConsts.VALUE_EVENT_VIDEO_ACTION107;
        } else {
            if (!this.f72811b.w()) {
                return;
            }
            videoHost = VideoManager.getInstance().getVideoHost();
            cg = this.e.cg();
            str = StatVideoConsts.VALUE_EVENT_VIDEO_ACTION106;
        }
        videoHost.userBehaviorWithParams(str, cg);
    }

    private void by() {
        this.o.post(new Runnable() {
            @Override
            public void run() {
                H5VideoMediaController.this.bz();
            }
        });
    }

    public void bz() {
        H5VideoDlnaDialogController h5VideoDlnaDialogController;
        IJDlna iJDlna = this.z;
        if (iJDlna == null || (h5VideoDlnaDialogController = this.r) == null || !h5VideoDlnaDialogController.b() || !iJDlna.isStarted()) {
            return;
        }
        iJDlna.search();
    }

    private void c(final View view) {
        bF();
        a(new OnPermissionCheckCallback() {
            @Override
            public void a(boolean z) {
                if (z) {
                    if (30 == view.getId() || 72 == view.getId()) {
                        Map<String, String> cg = H5VideoMediaController.this.e.cg();
                        HashMap hashMap = cg == null ? new HashMap() : new HashMap(cg);
                        StatVideoConsts.addExtraToParams(hashMap, Collections.singletonMap(StatVideoConsts.KEY_DIALOG_STYLE, DialogABTestHelper.a() ? "new" : "old"));
                        VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION5, hashMap);
                        if (H5VideoMediaController.this.M.i != VideoMediaControllerStatusBtn.DownloadTips.NONE) {
                            String bI = H5VideoMediaController.this.bI();
                            if (!TextUtils.isEmpty(bI)) {
                                VideoManager.getInstance().getVideoHost().userBehaviorWithParams(bI, H5VideoMediaController.this.e.cg());
                            }
                            MttToaster.show(VideoMediaControllerStatusBtn.f73458a.get(H5VideoMediaController.this.M.i), 0);
                            return;
                        }
                    }
                    H5VideoMediaController.this.l(1);
                    Bundle a2 = SafeBundleUtil.a();
                    a2.putBoolean("show_encrypt_download_menu", 30 == view.getId() || 72 == view.getId());
                    a2.putBoolean("show_downloadtf_dialog", 69 == view.getId());
                    a2.putBoolean("is_landscape_mode", H5VideoMediaController.this.aR());
                    a2.putBoolean("isFullScreen", H5VideoMediaController.this.o());
                    if (69 == view.getId()) {
                        try {
                            H5VideoMediaController.this.Z.edit().putBoolean(VideoConstants.VIDEO_PREFS_KEY_SHOW_REDICON, false).commit();
                        } catch (Throwable unused) {
                        }
                        a2.putString("file_path", H5VideoMediaController.this.getVideoUrl());
                    }
                    H5VideoMediaController.this.a(a2);
                    H5VideoMediaController.this.t(view.getId());
                    H5VideoMediaController.this.f72811b.d(true);
                }
            }
        });
    }

    private void ca() {
        if (this.e != null) {
            this.M.n = 1 ^ (j(1) ? 1 : 0);
        }
    }

    private void cb() {
        VideoMediaControllerStatusBtn videoMediaControllerStatusBtn;
        int i;
        if (this.e.bZ()) {
            videoMediaControllerStatusBtn = this.M;
            i = 0;
        } else {
            videoMediaControllerStatusBtn = this.M;
            i = 1;
        }
        videoMediaControllerStatusBtn.q = i;
    }

    private void cc() {
        VideoMediaControllerStatusBtn videoMediaControllerStatusBtn;
        int i;
        if ((this.e.ca() & 1) == 0) {
            videoMediaControllerStatusBtn = this.M;
            i = 4;
        } else {
            if ((this.e.ca() & 2) == 0) {
                return;
            }
            videoMediaControllerStatusBtn = this.M;
            i = 0;
        }
        videoMediaControllerStatusBtn.u = i;
    }

    private void cd() {
        VideoMediaControllerStatusBtn videoMediaControllerStatusBtn;
        VideoMediaControllerStatusBtn.DownloadTips downloadTips;
        int i;
        if (this.v == null) {
            this.M.e = 1;
            return;
        }
        if (this.e.a(this.M)) {
            if (this.e.isLiveStreaming()) {
                videoMediaControllerStatusBtn = this.M;
                downloadTips = VideoMediaControllerStatusBtn.DownloadTips.LIVEVIDEO;
            } else if (this.e.aL()) {
                videoMediaControllerStatusBtn = this.M;
                downloadTips = VideoMediaControllerStatusBtn.DownloadTips.INITING;
            } else {
                this.e.aw();
                videoMediaControllerStatusBtn = this.M;
                downloadTips = VideoMediaControllerStatusBtn.DownloadTips.NONE;
            }
            videoMediaControllerStatusBtn.i = downloadTips;
        } else if (this.e.isLocalVideo()) {
            i = 0;
            this.M.e = i ^ 1;
        }
        i = 1;
        this.M.e = i ^ 1;
    }

    private void ce() {
        VideoMediaControllerStatusBtn videoMediaControllerStatusBtn;
        int i;
        if (aS() && this.e.a(16384L)) {
            videoMediaControllerStatusBtn = this.M;
            i = 0;
        } else {
            videoMediaControllerStatusBtn = this.M;
            i = 1;
        }
        videoMediaControllerStatusBtn.k = i;
    }

    private void cf() {
        this.F.b();
    }

    private void cg() {
        this.q.b(2);
        p();
        setControllerBtnStatus(35, 0);
        VideoManager.getInstance().getVideoHost().userBehaviorStatistics("BZWSP102_0");
    }

    private void ch() {
        new H5VideoPageSettingDialog(this.P, new Bundle(), this, B()).show();
        p();
        l(2);
    }

    private void ci() {
        if (this.X || (o() && !this.Y)) {
            if (this.f72811b.getParent() == null) {
                this.e.a(this.f72811b, new ViewGroup.LayoutParams(-1, -1));
            }
            if (o() && this.f72812c.getParent() == null) {
                this.e.a(this.f72812c, new ViewGroup.LayoutParams(-1, -1));
            }
            if (this.f72813d.getParent() == null) {
                this.e.a(this.f72813d, new ViewGroup.LayoutParams(-1, -1));
            }
            View videoView = this.e.getVideoView();
            if (videoView != null) {
                videoView.setOnTouchListener(this.O);
            }
        } else if (!this.X) {
            if (this.f72811b.getParent() != null) {
                this.e.d(this.f72811b);
                View videoView2 = this.e.getVideoView();
                if (videoView2 != null) {
                    videoView2.setOnTouchListener(null);
                }
            }
            if (this.f72812c.getParent() != null) {
                this.e.d(this.f72812c);
            }
            if (this.f72813d.getParent() != null) {
                this.e.d(this.f72813d);
            }
            this.u.h();
        }
        MuteBtnShowController muteBtnShowController = this.I;
        if (muteBtnShowController != null) {
            muteBtnShowController.a(this.e.bJ(), false);
        }
        ck();
    }

    private void cj() {
        VideoTipsController videoTipsController = this.s;
        if (videoTipsController != null) {
            videoTipsController.a();
        }
    }

    private void ck() {
        if (this.e.cl().c()) {
            if (this.p == null) {
                FeatureStat.a(this.e);
                this.p = VideoQueenGuideUI.a(this.P, this.e.cl());
            }
            if (this.p.getParent() == null) {
                this.e.a(this.p, new FrameLayout.LayoutParams(-1, -1));
            }
        }
    }

    private void d(int i, boolean z) {
        if (z) {
            this.f72811b.o();
        }
        switch (this.e.getScreenMode()) {
            case 101:
                if (!this.e.S()) {
                    this.f72811b.setUIBaseMode(5);
                    this.f72811b.b(13);
                } else if (v(i)) {
                    this.f72811b.setUIBaseMode(7);
                } else {
                    if (!this.e.aS() || this.e.bz()) {
                        this.f72811b.setUIBaseMode(3);
                    } else {
                        this.f72811b.setUIBaseMode(4);
                        bW();
                        bR();
                    }
                    bU();
                    cd();
                    cf();
                    ak();
                    cb();
                    bT();
                }
                cc();
                break;
            case 102:
                if (!v(i)) {
                    this.f72811b.setUIBaseMode(10);
                    bU();
                    bR();
                    cd();
                    ce();
                    cf();
                    ak();
                    bX();
                    bY();
                    bZ();
                    ca();
                    bT();
                    break;
                }
                this.f72811b.setUIBaseMode(8);
                break;
            case 103:
            case 106:
                cb();
                this.f72811b.setUIBaseMode(6);
                q();
                break;
            case 105:
                if (!v(i)) {
                    if (DeviceUtils.c(this.P) >= DeviceUtils.d(this.P)) {
                        this.f72811b.setUIBaseMode(10);
                        bU();
                        bR();
                        cd();
                        ce();
                        cf();
                        ak();
                        ca();
                        bY();
                        bZ();
                        bT();
                        break;
                    }
                    this.f72811b.setUIBaseMode(11);
                    bU();
                    bR();
                    cd();
                    ce();
                    cf();
                    ak();
                    ca();
                    bY();
                    bZ();
                    bT();
                }
                this.f72811b.setUIBaseMode(8);
                break;
            case 109:
            case 110:
                this.f72811b.setUIBaseMode(13);
                bU();
                cd();
                cf();
                ak();
                cb();
                bT();
                break;
        }
        this.f72811b.a(this.M);
        if (this.M.u != 4) {
            this.I.a();
        }
    }

    private void e(int i, boolean z) {
        c((int) a(this.e.getDuration()), this.g);
    }

    private void e(String str) {
        FeatureStat.e(this.e);
        if (this.B != null && !TextUtils.isEmpty(str)) {
            VideoManager.getInstance().exitFullScreenPlayers(0);
            this.B.loadUrl(str, null);
        }
        VideoMediaDspAbility videoMediaDspAbility = this.L;
        if (videoMediaDspAbility != null) {
            videoMediaDspAbility.d();
        }
    }

    private void f(boolean z) {
        if (this.e.isLiveStreaming()) {
            return;
        }
        int currentPosition = this.e.getCurrentPosition();
        int duration = this.e.getDuration();
        int i = z ? currentPosition + 10000 : currentPosition - 10000;
        if (i > duration) {
            i = duration;
        }
        this.e.a(i, true);
    }

    private void g(boolean z) {
        TextureView ck = this.e.ck();
        if (ck == null || O()) {
            return;
        }
        this.J = new VideoScreenshotController(this.P, this, this.e, z);
        this.J.a(ck);
    }

    public void t(int i) {
        int screenMode = this.e.getScreenMode();
        if (i != 69) {
            if (i == 30 || i == 64) {
                return;
            }
            if (i == 72) {
                EventEmiter.getDefault().emit(new EventMessage("custom_download_btn_clicked", Boolean.valueOf(o())));
                return;
            }
            return;
        }
        if (screenMode != 102) {
            if (screenMode != 104) {
                if (screenMode != 105) {
                    return;
                }
            }
            VideoManager.getInstance().getVideoHost().userBehaviorStatistics("BZSP102");
            return;
        }
        VideoManager.getInstance().getVideoHost().userBehaviorStatistics("BZSP107");
    }

    private void u(int i) {
        d(i, false);
    }

    private boolean v(int i) {
        return i == 0 && this.e.K;
    }

    private void w(int i) {
        if (i != 2) {
            if (i == 3) {
                if (this.e.bz()) {
                    this.H.a();
                    return;
                }
                return;
            } else if (i != 4) {
                if (i != 6) {
                    p();
                    return;
                } else if (!o() && this.e.getScreenMode() != 101) {
                    return;
                }
            } else if (this.e.getScreenMode() != 101) {
                return;
            }
        } else if (!o()) {
            return;
        }
        q();
    }

    private boolean x(int i) {
        if (i == 4) {
            this.S = 4;
            return true;
        }
        if (i != 79) {
            if (i == 82) {
                this.S = 82;
                return true;
            }
            if (i == 24) {
                bs();
                aF().a(true);
                this.S = 24;
                return true;
            }
            if (i == 25) {
                aF().a(false);
                this.S = 25;
                return true;
            }
            if (i == 84) {
                this.S = 84;
                return true;
            }
            if (i != 85) {
                return false;
            }
        }
        this.S = 85;
        return true;
    }

    private Boolean y(int i) {
        if (i == 4) {
            if (this.S == 4) {
                if (x().H()) {
                    return true;
                }
                X();
            }
            return true;
        }
        if (i != 79) {
            if (i == 82) {
                if (this.S == 82) {
                    this.f72811b.r();
                }
                return true;
            }
            if (i != 24 && i != 25 && i != 84) {
                if (i != 85) {
                    return null;
                }
            }
            return true;
        }
        if (this.S != 85) {
            return null;
        }
        ao();
        return null;
    }

    private void z(int i) {
        if (this.O != null) {
            if ((this.e.aT() && i == 101) || ap()) {
                this.O.c(false);
            } else {
                this.O.c(true);
            }
        }
    }

    public void A() {
        this.f72811b.t();
    }

    public Map<String, String> B() {
        return this.e.cg();
    }

    public void C() {
        View view = new View(m());
        view.setId(30);
        onClick(view);
    }

    public void D() {
        bF();
        if (this.f == null) {
            MttToaster.show(VideoResources.b("video_sdk_dlna_plugin_loading"), 0);
            return;
        }
        if (!Apn.isWifiMode(true)) {
            bw();
        } else {
            if (this.f.getDlnaInstance() != null) {
                bx();
                return;
            }
            this.r.d();
            this.r.a(true);
            bS();
        }
    }

    public void E() {
    }

    public void F() {
        this.f72813d.f();
    }

    public void G() {
        this.f72813d.g();
    }

    public void H() {
        a(true);
        this.f72813d.e();
    }

    public void I() {
        VideoDlnaPanelView videoDlnaPanelView = this.f72813d;
        if (videoDlnaPanelView == null || !videoDlnaPanelView.d()) {
            return;
        }
        this.f72813d.a();
        if (this.e.isActive()) {
            return;
        }
        VideoManager.getInstance().destroyDlnaFloatPlayerWhenDlnaPanelHide(this.e);
    }

    public void J() {
        this.f72813d.b();
    }

    public void K() {
        this.f72813d.c();
    }

    public boolean L() {
        return this.f72813d.d();
    }

    public boolean M() {
        VideoScreenshotController videoScreenshotController = this.J;
        return videoScreenshotController != null && videoScreenshotController.b();
    }

    public void N() {
        VideoHost videoHost;
        String str;
        int playerScreenMode = getPlayerScreenMode();
        if (playerScreenMode != 103) {
            if (playerScreenMode == 101) {
                videoHost = VideoManager.getInstance().getVideoHost();
                str = "N338";
            }
            if (playerScreenMode == 103 && playerScreenMode != 106) {
                H5VideoPlayer h5VideoPlayer = this.e;
                h5VideoPlayer.switchScreen(h5VideoPlayer.bA());
                VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION30, this.e.cg());
                return;
            } else if (DeviceUtils.a(this.P)) {
                this.E.a();
                return;
            } else {
                this.e.switchScreen(109);
                return;
            }
        }
        videoHost = VideoManager.getInstance().getVideoHost();
        str = "N358";
        videoHost.userBehaviorStatistics(str);
        if (playerScreenMode == 103) {
        }
        if (DeviceUtils.a(this.P)) {
        }
    }

    public boolean O() {
        StringBuilder sb;
        String str;
        if (v()) {
            return true;
        }
        VideoHost videoHost = VideoManager.getInstance().getVideoHost();
        if (videoHost == null) {
            sb = new StringBuilder();
            sb.append(l);
            str = "::VideoHost==null, cannot use screenShot";
        } else {
            if (videoHost.getVideoService() != null) {
                return aK() || this.e.ck() == null;
            }
            sb = new StringBuilder();
            sb.append(l);
            str = "::VideoService==null, cannot use screenShot";
        }
        sb.append(str);
        Logs.c(IH5VideoPlayer.TAG, sb.toString());
        return true;
    }

    @Override
    public void P() {
    }

    @Override
    public void Q() {
    }

    public int R() {
        return this.f72813d.getCurDlnaPosition();
    }

    public void S() {
        X();
    }

    public void T() {
        VideoMediaControllerView videoMediaControllerView = this.f72811b;
        if (videoMediaControllerView != null) {
            videoMediaControllerView.B();
        }
    }

    public void U() {
        TaskUtils.a(new Runnable() {
            @Override
            public void run() {
                H5VideoMediaController.this.f72811b.f();
            }
        });
    }

    public H5VideoSettingCenter V() {
        return this.e.ch();
    }

    public void W() {
        VideoLogHelper.d(l, this + " destroyed...");
        DlnaTechStatSession.a();
        this.H.h();
        this.I.b();
        VideoTipsController videoTipsController = this.s;
        if (videoTipsController != null) {
            videoTipsController.b();
        }
        cj();
        a(this.v);
        a(this.w);
        a(this.f);
        this.r.m();
        a(this.x);
        a(this.A);
        this.F.a();
        this.G.m();
        H5VideoProductOperationController h5VideoProductOperationController = this.t;
        if (h5VideoProductOperationController != null) {
            h5VideoProductOperationController.destory();
            this.t.b();
        }
        this.u.i();
        this.f72811b.y();
        this.f72812c.h();
        this.f72813d.h();
        this.J = null;
        IJDlna iJDlna = this.z;
        if (iJDlna != null) {
            iJDlna.setIDlnaListener(null);
            VideoLogHelper.d(l, "Set listener(destroy) to null: " + this);
        }
    }

    public void X() {
        if (o()) {
            if (L()) {
                this.e.doExitPlay(false);
                return;
            }
            this.e.aX();
            this.e.ap();
            this.e.aY();
        }
    }

    public void Y() {
        IPlayerShareController iPlayerShareController = this.C;
        if (iPlayerShareController != null) {
            iPlayerShareController.doReportShareClick();
        }
    }

    public IVideoExtraAbilityControllerHolder.VideoDlnaAbilityController Z() {
        return this.f;
    }

    public long a(long j) {
        return (j * this.N) / 1000;
    }

    @Override
    public VideoMediaAbilityControllerBase a(IH5VideoMediaControllerInter iH5VideoMediaControllerInter, Context context) {
        return null;
    }

    @Override
    public String a() {
        return this.e.aR();
    }

    public void a(float f, float f2) {
        this.f72813d.b((int) f);
    }

    public void a(int i) {
        if (i != this.af) {
            this.af = i;
            this.ae.a(H5VideoGuideConstantsKt.a(i));
        }
    }

    public void a(int i, int i2) {
        if (i <= 0) {
            return;
        }
        u(this.e.bf());
        boolean z = i == 101 || i == 106;
        boolean z2 = i2 == 101 || i2 == 106;
        if (!z || !z2) {
            if (i2 == 103 || i2 == 109 || z2) {
                this.H.g();
            } else if (!z || i2 == 110) {
                H5VideoProductOperationController h5VideoProductOperationController = this.t;
                if (h5VideoProductOperationController != null) {
                    this.H.b(h5VideoProductOperationController);
                }
            } else {
                this.H.f();
            }
        }
        this.G.b(i, i2);
        cj();
        H5VideoProductOperationController h5VideoProductOperationController2 = this.t;
        if (h5VideoProductOperationController2 != null) {
            h5VideoProductOperationController2.b(i, i2);
        }
        VideoTipsController videoTipsController = this.s;
        if (videoTipsController != null) {
            videoTipsController.b(i2);
        }
        z(i2);
        if (this.e.Z()) {
            if (this.f72813d.d()) {
                PlatformStatUtils.a("CLOSE_DLNA_PANEL_FROM_FULL_TO_INLINE");
            }
            this.f72813d.a();
        }
        this.u.h();
        ci();
        this.ae.c();
    }

    public void a(int i, int i2, Throwable th) {
        this.G.a(i, i2, th);
    }

    public void a(int i, int i2, boolean z) {
        this.G.a(i, i2, z);
    }

    @Override
    public void a(int i, boolean z) {
        this.e.a(i, z);
    }

    public void a(Bitmap bitmap, int i) {
        IPlayerShareController iPlayerShareController = this.C;
        if (iPlayerShareController != null) {
            iPlayerShareController.normalShareImage(null, bitmap, i);
        }
    }

    public void a(Bundle bundle) {
        if (this.v != null) {
            if (bundle == null) {
                bundle = SafeBundleUtil.a();
            }
            if (!bundle.containsKey(IVideoDbHelper.COLUMN_TITLE)) {
                bundle.putString(IVideoDbHelper.COLUMN_TITLE, getVideoTitle());
            }
            if (!bundle.containsKey("video_url")) {
                bundle.putString("video_url", getVideoUrl());
            }
            if (!bundle.containsKey("video_file_size")) {
                bundle.putLong("video_file_size", this.e.aP());
            }
            if (!bundle.containsKey("video_position")) {
                bundle.putInt("video_position", this.e.getCurrentPosition());
            }
            this.v.request(bundle);
        }
    }

    @Override
    public void a(View view) {
        this.f72811b.c(view);
    }

    @Override
    public void a(View view, FrameLayout.LayoutParams layoutParams, int i) {
        this.f72811b.a(view, layoutParams, i);
    }

    public void a(ValueCallback<Integer> valueCallback) {
        IVideoExtraAbilityControllerHolder.VideoMediaCollectAbilityController videoMediaCollectAbilityController = this.w;
        if (videoMediaCollectAbilityController != null) {
            videoMediaCollectAbilityController.updateFavoriteStatus(this.e.getEpisodeInfo(), valueCallback);
        }
    }

    public void a(DmrDevice dmrDevice) {
        if (this.f72813d != null) {
            p();
            this.f72813d.a(dmrDevice);
            l(2);
        }
    }

    public void a(IVideoExtraAbilityControllerHolder iVideoExtraAbilityControllerHolder) {
        if (iVideoExtraAbilityControllerHolder == null) {
            return;
        }
        this.E.a(iVideoExtraAbilityControllerHolder);
        VideoMediaAbilityControllerBase extraAbilityController = iVideoExtraAbilityControllerHolder.getExtraAbilityController(1, this);
        if (extraAbilityController != null) {
            this.v = (IVideoExtraAbilityControllerHolder.VideoMediaCacheAbilityController) extraAbilityController;
        }
        VideoMediaAbilityControllerBase extraAbilityController2 = iVideoExtraAbilityControllerHolder.getExtraAbilityController(2, this);
        if (extraAbilityController2 != null) {
            this.w = (IVideoExtraAbilityControllerHolder.VideoMediaCollectAbilityController) extraAbilityController2;
        }
        VideoMediaAbilityControllerBase extraAbilityController3 = iVideoExtraAbilityControllerHolder.getExtraAbilityController(4, this);
        if (extraAbilityController3 != null) {
            this.f = (IVideoExtraAbilityControllerHolder.VideoDlnaAbilityController) extraAbilityController3;
        }
        VideoMediaAbilityControllerBase extraAbilityController4 = iVideoExtraAbilityControllerHolder.getExtraAbilityController(6, this);
        if (extraAbilityController != null) {
            this.B = (IVideoExtraAbilityControllerHolder.VideoLoadUrlAbilityController) extraAbilityController4;
        }
        this.x = iVideoExtraAbilityControllerHolder.getExtraAbilityController(3, this);
        this.A = iVideoExtraAbilityControllerHolder.getExtraAbilityController(5, this);
        this.C = (IPlayerShareController) iVideoExtraAbilityControllerHolder.getExtraAbility(IPlayerShareController.class, this);
        this.D = (IVideoExtraAbilityControllerHolder.IH5VideoErrorController) iVideoExtraAbilityControllerHolder.getExtraAbility(IVideoExtraAbilityControllerHolder.IH5VideoErrorController.class, this);
        this.L = (VideoMediaDspAbility) iVideoExtraAbilityControllerHolder.getExtraAbilityController(7, this);
        this.f72811b.setDspAbility(this.L);
    }

    public void a(IMediaPlayerInter iMediaPlayerInter) {
        this.G.a(iMediaPlayerInter);
    }

    @Override
    public void a(VideoSeekBar videoSeekBar) {
        this.g = true;
        Iterator<VideoProgressUserGestureListener> it = bq().iterator();
        while (it.hasNext()) {
            it.next().a(this.e.getDuration() > 0 ? this.e.getCurrentPosition() : -1L, false);
        }
    }

    @Override
    public void a(VideoSeekBar videoSeekBar, int i, boolean z) {
        boolean z2 = this.N <= i;
        this.N = i;
        e(i, z2);
    }

    public void a(H5VideoGuideManager.H5VideoGuideElement h5VideoGuideElement) {
        if (h5VideoGuideElement == null) {
            return;
        }
        this.ae.b(h5VideoGuideElement);
    }

    public void a(TVBaseInfo tVBaseInfo) {
        Bundle bundle = new Bundle();
        bundle.putParcelable("baseInfo", tVBaseInfo);
        this.e.a("onNewTVEpisodeClick", bundle);
    }

    public void a(VideoProgressUserGestureListener videoProgressUserGestureListener) {
        if (videoProgressUserGestureListener == null) {
            return;
        }
        this.ag.add(videoProgressUserGestureListener);
    }

    @Override
    public void a(String str) {
        this.e.as = str;
    }

    public void a(String str, int i) {
        IPlayerShareController iPlayerShareController = this.C;
        if (iPlayerShareController != null) {
            iPlayerShareController.normalShareImage(str, null, i);
        }
    }

    public void a(String str, String str2, int i) {
        Bundle bundle = new Bundle();
        bundle.putString("video_vid", str);
        bundle.putString("video_cid", str2);
        bundle.putInt("direction", i);
        this.e.a("loadMoreTVEpisodes", bundle);
    }

    public void a(boolean z) {
        this.r.f();
        I();
        if (z) {
            a(0, false);
        } else if (this.f72813d.getLastPosition() != -1) {
            a(this.f72813d.getLastPosition() * 1000, false);
        }
    }

    public void a(boolean z, boolean z2) {
        this.e.b(z);
        if (this.e.getScreenMode() == 101 && !this.e.S() && this.e.isCanAttachVideoToWebView()) {
            H5VideoPlayer h5VideoPlayer = this.e;
            h5VideoPlayer.switchScreen(h5VideoPlayer.bA());
        }
        if (z2) {
            this.e.F();
        }
    }

    public void a(String[] strArr, int i) {
        IPlayerShareController iPlayerShareController = this.C;
        if (iPlayerShareController != null) {
            iPlayerShareController.sendFilesUsingApp(m(), strArr, i);
        }
    }

    public boolean a(float f) {
        H5VideoPlayer h5VideoPlayer = this.e;
        if (h5VideoPlayer != null) {
            return h5VideoPlayer.a(f);
        }
        return false;
    }

    public boolean aA() {
        return this.f72811b.p();
    }

    public void aB() {
    }

    public void aC() {
    }

    public VideoMediaControllerStatusBtn aD() {
        return this.M;
    }

    public void aE() {
        ci();
        this.O = new VideoGestureDispatcher(this.P, this.e, this);
        this.O.a(this.e.bQ());
        this.O.a(this.u);
        this.f72811b.setOnTouchListener(this.O);
        this.f72813d.setOnTouchListener(this.O);
    }

    public VideoTipsController aF() {
        if (this.s == null) {
            this.s = new VideoTipsController(this, this.P);
            this.s.b(getPlayerScreenMode());
        }
        return this.s;
    }

    @Override
    public void aG() {
        this.G.k();
        this.H.a();
        bg();
        this.f72812c.c();
        this.e.cn().b(TVideoStatHelperKt.b());
        this.j.a(true, this.f72811b.getBottomBarWrapper(), this.f72811b.getBottomBar());
        TVideoProxy x = x();
        if (x != null) {
            x.I();
        }
    }

    @Override
    public void aH() {
        this.G.l();
        this.H.c();
        bh();
        this.f72812c.d();
        H5VideoSpeedControlPageDialog h5VideoSpeedControlPageDialog = this.ab;
        if (h5VideoSpeedControlPageDialog != null) {
            h5VideoSpeedControlPageDialog.dismiss();
        }
        this.j.a(false, this.f72811b.getBottomBarWrapper(), this.f72811b.getBottomBar());
        TVideoProxy x = x();
        if (x != null) {
            x.J();
        }
    }

    @Override
    public void aI() {
        this.e.j(true);
    }

    @Override
    public void aJ() {
        this.e.j(false);
        VideoManager.getInstance().getVideoHost().userBehaviorStatistics("N331");
    }

    public boolean aK() {
        return VideoManager.getInstance().getVideoHostType() == 3;
    }

    public int aL() {
        return this.G.t();
    }

    public boolean aM() {
        return this.e.bH();
    }

    public IVideoInlinePanel aN() {
        if (this.Q == null) {
            this.Q = VideoInlineExpKt.a(ContextHolder.getAppContext());
            this.Q.setH5VideoMediaController(this);
            this.Q.setPlayer(this.e);
            this.Q.a().setId(53);
        }
        return this.Q;
    }

    public FrameLayout aO() {
        if (this.R == null) {
            this.R = new VideoSameFullScreenPanel(this.P, this);
            this.R.setPlayer(this.e);
        }
        return this.R;
    }

    public void aP() {
        Bundle a2 = SafeBundleUtil.a();
        a2.putBoolean("show_encrypt_download_menu", true);
        a2.putBoolean("is_landscape_mode", aR());
        a(a2);
    }

    public IVideoWebViewProxy aQ() {
        return this.e.by();
    }

    public boolean aR() {
        if (this.e.getScreenMode() == 102) {
            return true;
        }
        return this.e.getScreenMode() == 105 && e() > f();
    }

    public boolean aS() {
        if (aj()) {
            return false;
        }
        return this.e.isSdkMode() || VideoManager.getInstance().isQbThrdCall();
    }

    public int aT() {
        return this.f72811b.getTopBarHeight();
    }

    public int aU() {
        return this.f72811b.getBottomBarHeight();
    }

    public IMediaPlayer.PlayerType aV() {
        return this.e.am();
    }

    public long aW() {
        return this.e.bD();
    }

    public PlayerEnv aX() {
        return this.e.b();
    }

    public void aY() {
        this.f72811b.x();
    }

    public void aZ() {
        this.e.bL();
    }

    public String[] aa() {
        return this.e.getValidAudioTrackTitles();
    }

    public int ab() {
        return this.e.getCurAudioTrackIdx();
    }

    public boolean ac() {
        IVideoExtraAbilityControllerHolder.VideoMediaCollectAbilityController videoMediaCollectAbilityController = this.w;
        if (videoMediaCollectAbilityController != null) {
            return videoMediaCollectAbilityController.isFavorite();
        }
        return false;
    }

    public void ad() {
        IVideoExtraAbilityControllerHolder.VideoMediaCollectAbilityController videoMediaCollectAbilityController = this.w;
        if (videoMediaCollectAbilityController != null) {
            videoMediaCollectAbilityController.request(this.e.getEpisodeInfo());
        }
    }

    public void ae() {
        IVideoExtraAbilityControllerHolder.VideoMediaCollectAbilityController videoMediaCollectAbilityController = this.w;
        if (videoMediaCollectAbilityController != null) {
            videoMediaCollectAbilityController.cancelFavorite(this.e.getEpisodeInfo());
        }
    }

    public boolean af() {
        H5VideoPlayer h5VideoPlayer = this.e;
        if (h5VideoPlayer != null) {
            return h5VideoPlayer.Z();
        }
        return false;
    }

    public void ag() {
        this.H.d();
        bQ();
        this.G.s();
    }

    public void ah() {
        this.H.e();
        bQ();
        this.G.r();
    }

    public int ai() {
        return this.e.bs();
    }

    public boolean aj() {
        return this.e.j();
    }

    public void ak() {
        this.M.f73459b = !this.e.ae() ? 1 : 0;
    }

    public void al() {
        this.G.n();
        this.u.h();
        H5VideoProductOperationController h5VideoProductOperationController = this.t;
        if (h5VideoProductOperationController != null) {
            h5VideoProductOperationController.j();
        }
        this.W.b();
        this.ae.b();
        this.j.f();
    }

    public void am() {
        this.G.a();
        VideoScreenshotController videoScreenshotController = this.J;
        if (videoScreenshotController != null) {
            videoScreenshotController.a(3);
        }
    }

    public void an() {
        this.G.c();
    }

    public void ao() {
        if (this.G.q()) {
            a(false, false);
            return;
        }
        if (this.e.getScreenMode() == 101 && !this.e.S() && this.e.isCanAttachVideoToWebView()) {
            H5VideoPlayer h5VideoPlayer = this.e;
            h5VideoPlayer.switchScreen(h5VideoPlayer.bA());
        }
        aq();
    }

    public boolean ap() {
        return this.e.getScreenMode() == 103;
    }

    public void aq() {
        if (!this.e.isPlaying()) {
            this.G.e();
            this.e.m(2);
            this.e.c(1);
        } else {
            this.G.d();
            this.e.d(1);
            if (o()) {
                VideoManager.getInstance().getVideoHost().userBehaviorStatistics("ADHP1");
            }
        }
    }

    public void ar() {
        H5VideoInfo videoInfo = this.e.getVideoInfo();
        if (videoInfo == null || TextUtils.isEmpty(videoInfo.mWebUrl)) {
            return;
        }
        IVideoExtraAbilityControllerHolder.VideoLoadUrlAbilityController videoLoadUrlAbilityController = this.B;
        if (videoLoadUrlAbilityController != null) {
            videoLoadUrlAbilityController.loadUrl(videoInfo.mWebUrl, null);
        }
        IVideoService iVideoService = (IVideoService) VideoManager.getInstance().getVideoHost().getVideoService();
        if (iVideoService != null) {
            iVideoService.exitFullScreenPlayers((byte) 0);
        }
    }

    public H5VideoInfo as() {
        return this.e.getVideoInfo();
    }

    public void at() {
        String str = this.e.bx() ? "qb://tab/file?&entry=true&callFrom=videos_all&callerName=XT&whichTimesShowBubble=1&target=3&jumpUrl=qb%3a%2f%2ffilesdk%2fvideopage%2flist" : "qb://filesdk/videopage/list?entry=true&callFrom=videos_all&callerName=QB&whichTimesShowBubble=1&target=3";
        IVideoExtraAbilityControllerHolder.VideoLoadUrlAbilityController videoLoadUrlAbilityController = this.B;
        if (videoLoadUrlAbilityController != null) {
            videoLoadUrlAbilityController.loadUrl(str, null);
        }
        VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION29, this.e.cg());
    }

    public void au() {
        if (j(15)) {
            if (o()) {
                cg();
            } else {
                az();
            }
            this.e.cn().c(TVideoStatHelperKt.b(Constants.VIA_SHARE_TYPE_INFO));
            this.e.cn().b(TVideoStatHelperKt.a(this.e.cf()));
            VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION8, B());
            return;
        }
        int i = i(15);
        Logs.c(IH5VideoPlayer.TAG, l + " 不支持倍速功能,playSpeedReason:" + i);
        makeText(A(i));
    }

    public void av() {
        VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION4, this.e.cg());
        if (this.E == null || DeviceUtils.a(this.P)) {
            this.e.switchScreen(103);
        } else {
            this.E.a();
        }
    }

    protected void aw() {
        H5VideoPlayer h5VideoPlayer;
        int screenMode = this.e.getScreenMode();
        int i = 102;
        if (screenMode != 107) {
            if (screenMode != 102) {
                if (screenMode != 104) {
                    if (screenMode == 105) {
                    }
                    VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION15, this.e.cg());
                }
            }
            h5VideoPlayer = this.e;
            i = h5VideoPlayer.bN();
            h5VideoPlayer.switchScreen(i);
            VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION15, this.e.cg());
        }
        h5VideoPlayer = this.e;
        h5VideoPlayer.switchScreen(i);
        VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION15, this.e.cg());
    }

    public void ax() {
        this.f72811b.r();
    }

    public void ay() {
        TVideoProxy x;
        String str;
        if (getPlayerScreenMode() == 103) {
            return;
        }
        if (this.e.ad()) {
            if (this.e.isPlaying()) {
                x = x();
                str = "1";
            } else {
                x = x();
                str = "0";
            }
            x.d(TVideoStatHelperKt.c(str));
            ao();
        }
        if (this.e.isPlaying()) {
            VideoManager.getInstance().getVideoHost().userBehaviorStatistics("ADHP8");
            VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION27, B());
        }
    }

    public void az() {
        H5VideoSpeedControlPageDialog h5VideoSpeedControlPageDialog = this.ab;
        if (h5VideoSpeedControlPageDialog != null && h5VideoSpeedControlPageDialog.d()) {
            this.ab.dismiss();
        }
        this.ab = new H5VideoSpeedControlPageDialog(this, m());
        this.ab.a();
        q();
    }

    @Override
    public String b() {
        return this.e.f72682d;
    }

    public void b(int i) {
        this.f72811b.d(i);
    }

    public void b(int i, int i2) {
        if (this.V == -1) {
            this.V = Math.max(VideoManager.getInstance().getHeight(), VideoManager.getInstance().getWidth());
        }
        int i3 = (this.V - i2) / 2;
        if (i3 != this.T) {
            this.T = i3;
            VideoSameFullScreenPanel videoSameFullScreenPanel = this.R;
            if (videoSameFullScreenPanel != null) {
                videoSameFullScreenPanel.b(this.T);
            }
        }
        this.U = i2;
        H5VideoProductOperationController h5VideoProductOperationController = this.t;
        if (h5VideoProductOperationController != null) {
            h5VideoProductOperationController.a(i, i2);
        }
    }

    public void b(int i, boolean z) {
        System.currentTimeMillis();
        IVideoInlinePanel iVideoInlinePanel = this.Q;
        if (iVideoInlinePanel != null) {
            iVideoInlinePanel.a(i);
        }
        VideoSameFullScreenPanel videoSameFullScreenPanel = this.R;
        if (videoSameFullScreenPanel != null) {
            videoSameFullScreenPanel.a(i);
        }
        VideoSecondPanelView videoSecondPanelView = this.f72812c;
        if (videoSecondPanelView != null) {
            videoSecondPanelView.a(i);
        }
        this.G.g(i);
        x().d(i);
        w(i);
        d(i, z);
        bV();
        VideoScreenshotController videoScreenshotController = this.J;
        if (videoScreenshotController != null) {
            videoScreenshotController.a(i);
        }
    }

    public void b(Bundle bundle) {
        this.h.a(bundle);
    }

    @Override
    public void b(VideoSeekBar videoSeekBar) {
        this.g = false;
        long a2 = a(this.e.getDuration());
        if (a2 == 0) {
            a2 = 1;
        }
        this.G.b(this.N);
        this.e.a((int) a2, true);
        r(200);
        Iterator<VideoProgressUserGestureListener> it = bq().iterator();
        while (it.hasNext()) {
            it.next().b(a2, false);
        }
    }

    public void b(VideoProgressUserGestureListener videoProgressUserGestureListener) {
        if (videoProgressUserGestureListener == null) {
            return;
        }
        this.ag.remove(videoProgressUserGestureListener);
    }

    public void b(String str) {
        IPlayerShareController iPlayerShareController = this.C;
        if (iPlayerShareController != null) {
            iPlayerShareController.recordShareScene(str);
        }
    }

    public void b(boolean z) {
        this.f72811b.setBottomBarDisabled(z);
    }

    public void ba() {
        this.f72811b.A();
    }

    public int bb() {
        return this.T;
    }

    public int bc() {
        return this.U;
    }

    public FrameLayout bd() {
        return this.W.a(this.P);
    }

    public void be() {
        this.W.a();
    }

    public int bf() {
        return this.M.u;
    }

    @Override
    public void bg() {
        this.e.a("onPannelShow", (Bundle) null);
    }

    @Override
    public void bh() {
        this.e.a("onPannelHide", (Bundle) null);
    }

    public float bi() {
        H5VideoPlayer h5VideoPlayer = this.e;
        if (h5VideoPlayer != null) {
            return h5VideoPlayer.cf();
        }
        return 1.0f;
    }

    public boolean bj() {
        H5VideoPlayer h5VideoPlayer = this.e;
        if (h5VideoPlayer != null) {
            return h5VideoPlayer.ce();
        }
        return false;
    }

    public boolean bk() {
        H5VideoPlayer h5VideoPlayer = this.e;
        if (h5VideoPlayer != null) {
            return h5VideoPlayer.ci();
        }
        return false;
    }

    public boolean bl() {
        H5VideoInfo videoInfo = this.e.getVideoInfo();
        return (videoInfo == null || videoInfo.getPlayList().isEmpty()) ? false : true;
    }

    public boolean bm() {
        H5VideoProductOperationController h5VideoProductOperationController = this.t;
        if (h5VideoProductOperationController != null) {
            return h5VideoProductOperationController.d();
        }
        return false;
    }

    public boolean bn() {
        H5VideoInfo videoInfo = this.e.getVideoInfo();
        return (videoInfo == null || TextUtils.isEmpty(videoInfo.mWebUrl)) ? false : true;
    }

    public boolean bo() {
        if (bl()) {
            if (!this.ac.b()) {
                this.f72811b.d(true);
                this.f72811b.a(false);
                this.ac.a(true);
                this.ac.a(System.currentTimeMillis());
                return true;
            }
            if (this.f72811b.d()) {
                this.f72811b.b(true);
                return true;
            }
        }
        return false;
    }

    public void bp() {
        String webUrl = getWebUrl();
        if (TextUtils.isEmpty(webUrl)) {
            webUrl = "";
        } else if (webUrl.length() >= 200) {
            webUrl = webUrl.substring(0, 200);
        }
        String str = webUrl;
        doExitPlay(false);
        String videoUrl = getVideoUrl();
        HashMap hashMap = new HashMap();
        hashMap.put("videoUrl", videoUrl);
        hashMap.put("wdpv", String.valueOf(WonderPlayer.getVersion()));
        hashMap.put("title", getVideoTitle());
        hashMap.put("playerType", String.valueOf(aV()));
        hashMap.put("superVersion", SuperPlayerPluginSession.a(ContextHolder.getAppContext()).getCurrentVersion());
        hashMap.put("recentErrorCode", String.valueOf(VideoErrorStatSession.f()));
        hashMap.put("playerSwitchVal", String.valueOf(PlayerSwitchController.a().f72377a));
        hashMap.put("useSuperPlayer", String.valueOf(PlayerSwitchController.a().c()));
        hashMap.put("newRenderer", String.valueOf(QBVideoRenderer.h()));
        hashMap.put("videoSwitchStatus", VideoPrefDefine.a());
        hashMap.put("fileExist", (TextUtils.isEmpty(videoUrl) || !FileUtils.l(videoUrl)) ? "notFile" : String.valueOf(new File(videoUrl).exists()));
        VideoManager.getInstance().getVideoHost().jumpToFeedBack(v() ? "https://bbs.mb.qq.com/mobilefb/fbTree?desc=%E5%B0%8F%E7%A8%8B%E5%BA%8F%3E%E8%85%BE%E8%AE%AF%E8%A7%86%E9%A2%91&levelinfos=341526ef-3d8a-40d6-8bcc-6c8141d7f6fe&tname=%E8%85%BE%E8%AE%AF%E8%A7%86%E9%A2%91&level=341526ef-3d8a-40d6-8bcc-6c8141d7f6fe&levelName=%E8%85%BE%E8%AE%AF%E8%A7%86%E9%A2%91&pl=%E8%AF%B7%E5%B0%BD%E5%8F%AF%E8%83%BD%E8%AF%A6%E7%BB%86%E7%9A%84%E6%8F%8F%E8%BF%B0%E4%BD%A0%E7%9A%84%E9%97%AE%E9%A2%98%EF%BC%8C%E5%A6%82%EF%BC%9A%E6%8F%90%E4%BE%9B%E7%BD%91%E9%A1%B5%E9%93%BE%E6%8E%A5%E3%80%81%E6%88%AA%E5%9B%BE%E7%AD%89%E4%BF%A1%E6%81%AF&dr=fb&arg=" : null, str, aW(), hashMap);
    }

    public List<VideoProgressUserGestureListener> bq() {
        return new ArrayList(this.ag);
    }

    @Override
    public RelativeLayout c() {
        return null;
    }

    public void c(int i) {
        if (this.C != null) {
            String b2 = b();
            if (this.e.aT() && !TextUtils.isEmpty(this.e.bO())) {
                b2 = this.e.bO();
            }
            this.C.normalShare(b2, i);
        }
    }

    public void c(int i, boolean z) {
        if (z) {
            aF().a(3, this.G.f(i), this.G.f(this.e.getDuration()), 0);
        }
        if (L()) {
            return;
        }
        this.G.j(i);
    }

    public void c(Bundle bundle) {
        this.e.a("doTVideoState", bundle);
    }

    public void c(String str) {
        this.G.a(str);
        this.u.e();
        H5VideoProductOperationController h5VideoProductOperationController = this.t;
        if (h5VideoProductOperationController != null) {
            h5VideoProductOperationController.a();
        }
    }

    public void c(boolean z) {
        this.G.a(z);
        VideoScreenshotController videoScreenshotController = this.J;
        if (videoScreenshotController != null) {
            videoScreenshotController.a(4);
        }
    }

    @Override
    public boolean canDownloadVideo() {
        return this.e.a((VideoMediaControllerStatusBtn) null);
    }

    @Override
    public RelativeLayout d() {
        return null;
    }

    public void d(String str) {
        this.o.postDelayed(new Runnable() {
            @Override
            public void run() {
                if (H5VideoMediaController.this.B != null) {
                    H5VideoMediaController.this.B.loadUrl("qb://tab/file?callFrom=videos_all&entry=true&target=2&whichTimesShowBubble=1", null);
                }
            }
        }, 300L);
    }

    public void d(boolean z) {
        this.X = z;
        View videoView = this.e.getVideoView();
        if (videoView != null) {
            videoView.setOnTouchListener(this.X ? this.O : null);
        }
        ci();
    }

    public boolean d(int i) {
        IPlayerShareController iPlayerShareController = this.C;
        if (iPlayerShareController != null) {
            return iPlayerShareController.canShareTo(i);
        }
        return false;
    }

    @Override
    public void dispatchPlay(int i) {
        this.e.c(i);
    }

    @Override
    public void doExitPlay(boolean z) {
        this.e.d(z);
    }

    @Override
    public int e() {
        return this.f72811b.getWidth();
    }

    public int e(int i) {
        IPlayerShareController iPlayerShareController = this.C;
        if (iPlayerShareController != null) {
            return iPlayerShareController.getShareId(i);
        }
        return -1;
    }

    public void e(boolean z) {
        if (this.Y != z) {
            this.Y = z;
            ci();
        }
    }

    @Override
    public void exitPlayerAndJmmpPage(String str) {
        this.e.doExitPlay(false);
        VideoManager.getInstance().getVideoHost().openUrl(str, false);
    }

    @Override
    public int f() {
        return this.f72811b.getHeight();
    }

    public void f(int i) {
        IPlayerShareController iPlayerShareController = this.C;
        if (iPlayerShareController != null) {
            iPlayerShareController.recordCurrentShareChannel(i);
        }
    }

    @Override
    public int g() {
        return this.e.getDuration();
    }

    public boolean g(int i) {
        return this.e.g(i);
    }

    @Override
    public Map<String, String> getABeaconParams() {
        return this.e.cg();
    }

    @Override
    public int getCurrentPosition() {
        return this.e.getCurrentPosition();
    }

    @Override
    public VideoProxyDefault getCurrentProxy() {
        return this.e.Y;
    }

    @Override
    public H5VideoEpisodeInfo getEpisodeInfo() {
        return this.e.getEpisodeInfo();
    }

    @Override
    public IH5VideoEpisoder getEpisoder() {
        return this.e.m;
    }

    @Override
    public Boolean getIsCompletioned() {
        return Boolean.valueOf(this.e.isCompletioned());
    }

    @Override
    public int getPlayerScreenMode() {
        return this.e.getScreenMode();
    }

    @Override
    public IMediaPlayer.PlayerType getPlayerType() {
        return this.e.al();
    }

    @Override
    public String getVideoFromSp() {
        return this.e.ay();
    }

    @Override
    public String getVideoTitle() {
        String videoTitle = this.e.getVideoTitle();
        return videoTitle != null ? videoTitle : "";
    }

    @Override
    public int getVideoType() {
        return this.e.Q();
    }

    @Override
    public String getVideoUrl() {
        return this.e.getVideoUrl();
    }

    @Override
    public IVideoViewExtCreator getVideoViewExtCreator() {
        return this.aa;
    }

    @Override
    public String getWebUrl() {
        String webUrl = this.e.getWebUrl();
        return webUrl != null ? webUrl : "";
    }

    @Override
    public int h() {
        return this.e.E;
    }

    public void h(int i) {
        this.e.l(i);
    }

    public int i(int i) {
        if (i != 0) {
            if (i != 1 && i != 2) {
                if (i == 3) {
                    r0 = this.e.bU() ? 101 : -1;
                    if (FileUtils.l(this.e.getVideoUrl())) {
                        return 102;
                    }
                    if (!this.e.a(2L)) {
                        return 103;
                    }
                    if (this.w == null) {
                        return 100;
                    }
                    if (this.e.getEpisodeInfo() == null) {
                        return this.e.av() ? 103 : 100;
                    }
                } else if (i != 5) {
                    if (i != 12) {
                        if (i == 15) {
                            H5VideoPlayer h5VideoPlayer = this.e;
                            if (h5VideoPlayer == null || h5VideoPlayer.al() == null) {
                                return 200;
                            }
                            if (isLiveStreaming()) {
                                return 202;
                            }
                            if (this.e.j(2)) {
                                return 207;
                            }
                            int i2 = AnonymousClass10.f72816b[this.e.al().ordinal()];
                            if (i2 == 1) {
                                return 204;
                            }
                            if (i2 != 2) {
                                return i2 != 3 ? 205 : 203;
                            }
                            if (WonderPlayer.getVersion() < 9400) {
                                return 201;
                            }
                        } else if (i == 7 || i != 8) {
                        }
                    }
                } else {
                    if (!VideoNetworkStatus.a().e()) {
                        return 1;
                    }
                    if (this.e.j(3)) {
                        return 13;
                    }
                    IVideoExtraAbilityControllerHolder.VideoDlnaAbilityController videoDlnaAbilityController = this.f;
                    if (videoDlnaAbilityController == null) {
                        this.m++;
                        return this.m >= 2 ? 12 : 2;
                    }
                    if (videoDlnaAbilityController.getDlnaInstance() == null) {
                        return this.f.getPluginErrorCode() != 0 ? 11 : 2;
                    }
                    if ((isLocalVideo() && CommonUtils.f(getVideoUrl()) == 1) && this.f.getDlnaInstance().getVersion() < 11) {
                        return 10;
                    }
                    if (aK()) {
                        return 3;
                    }
                    if (H5VideoPlayer.m(this.e.getVideoUrl())) {
                        return 5;
                    }
                    if (this.e.bU()) {
                        return 7;
                    }
                    if (IOpenJsApis.TRUE.equals(this.e.u(14))) {
                        return 8;
                    }
                }
            }
        }
        return r0;
    }

    @Override
    public void i() {
        this.e.ah();
    }

    @Override
    public boolean isBlackSite(int i) {
        return this.e.j(i);
    }

    @Override
    public boolean isDownloadBlackSite() {
        return this.e.aM();
    }

    @Override
    public boolean isLiveStreaming() {
        return this.e.isLiveStreaming();
    }

    @Override
    public boolean isLocalVideo() {
        return this.e.isLocalVideo();
    }

    @Override
    public boolean isPlayerInMyVideo() {
        return this.e.isPlayerInMyVideo();
    }

    @Override
    public Boolean isPlaying() {
        return Boolean.valueOf(this.e.isPlaying());
    }

    @Override
    public boolean isShowEpisodesButton() {
        return this.e.ax();
    }

    @Override
    public boolean isVideoUrlChanged() {
        return this.e.aQ();
    }

    @Override
    public void j() {
        this.e.ai();
    }

    public boolean j(int i) {
        switch (i) {
            case 0:
            case 4:
            case 6:
            case 10:
            case 11:
            case 13:
            case 14:
            case 18:
            case 21:
            case 22:
            case 25:
            case 27:
            default:
                return false;
            case 1:
                return this.C != null && this.e.aK();
            case 2:
                return this.e.br();
            case 3:
                return bP();
            case 5:
                return bO();
            case 7:
                return this.e.ad();
            case 8:
                return aR();
            case 9:
                return VideoManager.getInstance().getVideoHostType() == 1;
            case 12:
                return true;
            case 15:
                return this.e.ce();
            case 16:
                return bM();
            case 17:
                return bN();
            case 19:
            case 20:
                return !this.e.cn().t();
            case 23:
                return bK();
            case 24:
                return bL();
            case 26:
            case 28:
                return this.e.cn().t();
        }
    }

    public void k(int i) {
        this.e.n(i);
    }

    @Override
    public boolean k() {
        return this.e.bg();
    }

    @Override
    public void l() {
        if (this.t != null && this.e.cd()) {
            this.t.c();
        }
        if (this.e.aU()) {
            this.f72811b.setFeedsVideosMode(true);
            this.f72811b.z();
            this.H.i();
        } else {
            this.f72811b.setFeedsVideosMode(false);
        }
        z(this.e.getScreenMode());
        this.ae.c();
    }

    public void l(int i) {
        this.e.d(i);
    }

    @Override
    public Context m() {
        return this.e.getActivity();
    }

    public void m(int i) {
        this.G.c(i);
    }

    @Override
    public void makeText(String str) {
        VideoManager.getInstance().getVideoHost().showToast(str, 1);
    }

    @Override
    public Context n() {
        return this.P;
    }

    public void n(int i) {
        this.G.d(i);
    }

    public void o(int i) {
        this.G.e(i);
    }

    @Override
    public boolean o() {
        return this.e.bz();
    }

    @Override
    public void onCallRingPause() {
        this.e.ag();
    }

    @Override
    public void onClick(View view) {
        EventCollector.getInstance().onViewClickedBefore(view);
        int id = view.getId();
        boolean z = true;
        if (30 == id || 69 == id || 72 == id) {
            c(view);
        } else if (64 == id) {
            b(view);
        } else if (32 == id) {
            bu();
        } else {
            if (34 == id) {
                LiteWindowStat.c(view, this.e);
                if (this.e.ad() && !L()) {
                    x().c(TVideoStatHelperKt.e(this.e.isPlaying() ? "1" : "0"));
                }
            } else if (id != 0) {
                if (44 == id) {
                    LiteWindowStat.a(view, this.e);
                    VideoManager.getInstance().getVideoHost().userBehaviorStatistics("N340");
                    this.e.bB();
                    this.e.d(false);
                } else if (14 == id || 12 == id) {
                    bH();
                } else if (16 == id) {
                    bG();
                } else if (33 == id) {
                    av();
                } else if (35 == id) {
                    bE();
                } else if (48 == id) {
                    bD();
                } else if (55 == id) {
                    IVideoExtraAbilityControllerHolder.VideoMediaCacheAbilityController videoMediaCacheAbilityController = this.v;
                    if (videoMediaCacheAbilityController != null) {
                        videoMediaCacheAbilityController.showDownloadController();
                    }
                } else if (49 == id) {
                    LiteWindowStat.b(view, this.e);
                    this.e.cn().c(TVideoStatHelperKt.b("1"));
                    N();
                } else if (50 == id) {
                    IntentUtils.a(this.P);
                } else if (63 == id) {
                    bB();
                } else if (62 == id) {
                    c(-1);
                } else if (65 == id) {
                    aw();
                } else {
                    if (70 != id && 71 != id) {
                        if (73 == id) {
                            at();
                        } else if (75 == id) {
                            ar();
                            VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION38, this.e.cg());
                        } else if (76 == id) {
                            D();
                        } else if (90 == id) {
                            g(false);
                        } else if (91 == id) {
                            g(true);
                        } else if (93 == id) {
                            LiteWindowStat.e(view, this.e);
                            f(false);
                        } else if (92 == id) {
                            LiteWindowStat.d(view, this.e);
                            f(true);
                        } else if (95 == id) {
                            e((String) view.getTag());
                        } else if (97 == id) {
                            VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION159, this.e.cg());
                            bv();
                        } else if (104 == id) {
                            this.e.cn().c(TVideoStatHelperKt.b("7"));
                            this.K.a();
                        } else if (108 == id) {
                            this.e.cn().c(TVideoStatHelperKt.b("8"));
                            this.h.a();
                        } else if (110 != id) {
                            if (114 == id) {
                                this.e.cn().c(TVideoStatHelperKt.b("5"));
                                this.e.a("playNextTVideo", (Bundle) null);
                            } else if (120 == id) {
                                this.e.b(true);
                            } else if (124 == id) {
                                if (this.e.getScreenMode() == 109) {
                                    this.e.doExitPlay(false);
                                } else if (this.e.getScreenMode() == 110) {
                                    this.e.d(1);
                                    this.e.switchScreen(101);
                                }
                            } else if (125 == id) {
                                bC();
                            } else if (126 == id) {
                                this.k.a();
                            } else {
                                z = false;
                            }
                        }
                    }
                    au();
                }
            }
            ao();
        }
        if (z) {
            EventEmiter.getDefault().emit(new EventMessage("H5VideoMediaController.ConsumePanelClicked", id, 0));
        }
        EventCollector.getInstance().onViewClicked(view);
    }

    @Override
    public boolean onKey(View view, int i, KeyEvent keyEvent) {
        if (!o()) {
            return false;
        }
        if (keyEvent.getAction() == 1) {
            Boolean y = y(i);
            if (y != null) {
                return y.booleanValue();
            }
        } else if (keyEvent.getAction() == 0 && x(i)) {
            return true;
        }
        return false;
    }

    @Override
    public void onMediaAbilityControllerShow(VideoMediaAbilityControllerBase videoMediaAbilityControllerBase) {
        this.H.c(videoMediaAbilityControllerBase);
    }

    @Override
    public void onReceivedMessage(int i, int i2, Bundle bundle) {
        String str;
        VideoHost videoHost;
        String str2;
        String actionName = IJDlna.DlnaActionDesc.getActionName(i);
        if (bundle == null || bundle.size() <= 0) {
            str = IAPInjectService.EP_NULL;
        } else {
            str = "\n" + bundle.toString();
        }
        VideoLogHelper.d(l, "onReceivedMessage : " + i + "(" + actionName + ") result = " + i2 + " params = " + str);
        if (i == 0) {
            by();
            return;
        }
        if (i != 1) {
            if (i == 100) {
                this.r.j();
                return;
            }
            if (i == 101) {
                this.r.k();
                return;
            }
            if (i == 103) {
                this.r.i();
                return;
            }
            if (i == 104) {
                if (bundle == null || bundle.size() <= 0) {
                    return;
                }
                this.r.a((DmrDevice) bundle.getParcelable("oldDevice"), (DmrDevice) bundle.getParcelable("newDevice"));
                return;
            }
            if (i == 214 || i == 215 || i == 222 || i == 224) {
                return;
            }
            switch (i) {
                case 200:
                    DlnaTechStatSession.b();
                    videoHost = VideoManager.getInstance().getVideoHost();
                    str2 = "DICST7";
                    videoHost.userBehaviorStatistics(str2);
                    return;
                case 201:
                    if (i2 != 99) {
                        if (i2 == 0) {
                            DlnaTechStatSession.c();
                            this.r.b(true);
                            return;
                        }
                        return;
                    }
                    if (L()) {
                        K();
                        MttToaster.show(VideoResources.b("video_sdk_dlna_failed"), 1);
                    }
                    this.r.b(false);
                    videoHost = VideoManager.getInstance().getVideoHost();
                    str2 = "DICST13_1";
                    videoHost.userBehaviorStatistics(str2);
                    return;
                case 202:
                case 204:
                case 206:
                case 208:
                case 209:
                case 210:
                case 211:
                    return;
                case 203:
                    if (i2 == 0) {
                        E();
                        return;
                    }
                    return;
                case 205:
                    if (i2 == 0) {
                        F();
                        return;
                    }
                    return;
                case 207:
                    if (i2 == 0) {
                        G();
                        return;
                    }
                    return;
                default:
                    switch (i) {
                        case 300:
                            this.r.b(true);
                            VideoLogHelper.d(l, this + " call on play success.");
                            J();
                            return;
                        case 301:
                        case 302:
                        case 303:
                        case 305:
                        case 306:
                        case 308:
                        case 309:
                        default:
                            return;
                        case 304:
                            if (bundle == null || !L()) {
                                return;
                            }
                            a(bundle.getFloat("position"), bundle.getFloat("duration"));
                            return;
                        case 307:
                            H();
                            return;
                        case 310:
                            this.r.b(true);
                            return;
                    }
            }
        }
    }

    @Override
    public void onResponse(boolean z, Object obj, VideoMediaAbilityControllerBase videoMediaAbilityControllerBase) {
    }

    public void onTvkAdvEvent(int i, Bundle bundle) {
        this.W.onTvkAdvEvent(i, bundle);
    }

    @Override
    public void onVideoViewExtEvent(IVideoViewExt iVideoViewExt, int i, Bundle bundle) {
        if (i == 1) {
            this.ac.b(true);
            u(this.e.bf());
            VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION41, this.e.cg());
            this.e.onMiscCallBack("setUseLocalFilePanel", null);
            return;
        }
        if (i == 2) {
            at();
            VideoManager.getInstance().getVideoHost().userBehaviorWithParams(StatVideoConsts.VALUE_EVENT_VIDEO_ACTION42, this.e.cg());
        }
    }

    @Override
    public void p() {
        this.f72811b.e(true);
    }

    public void p(int i) {
        this.e.switchScreen(i);
    }

    @Override
    public void play(H5VideoInfo h5VideoInfo, int i) {
        this.e.play(h5VideoInfo, i);
    }

    @Override
    public void playEpisode(H5VideoEpisodeInfo h5VideoEpisodeInfo, boolean z) {
    }

    @Override
    public void q() {
        this.f72811b.d(true);
        this.H.a();
    }

    public void q(int i) {
        this.f72813d.c(i);
    }

    public VideoGestureDispatcher r() {
        return this.O;
    }

    public void r(int i) {
        VideoTipsController videoTipsController = this.s;
        if (videoTipsController != null) {
            videoTipsController.a(i);
        }
    }

    @Override
    public void registerController(VideoMediaAbilityControllerBase videoMediaAbilityControllerBase) {
        this.H.a(videoMediaAbilityControllerBase);
    }

    public ViewGroup s() {
        return this.f72811b.getTVideoPayButtonContainer();
    }

    public void s(int i) {
        if (this.e.getScreenMode() == 105) {
            this.f72811b.setUIBaseMode(i == 2 ? 10 : 11);
            this.f72811b.a(this.M);
            H5VideoProductOperationController h5VideoProductOperationController = this.t;
            if (h5VideoProductOperationController != null) {
                this.H.b(h5VideoProductOperationController);
            }
            cj();
        }
        H5VideoProductOperationController h5VideoProductOperationController2 = this.t;
        if (h5VideoProductOperationController2 != null) {
            h5VideoProductOperationController2.a(i);
        }
        VideoGestureDispatcher videoGestureDispatcher = this.O;
        if (videoGestureDispatcher != null) {
            videoGestureDispatcher.b(i == 2);
        }
    }

    @Override
    public void setControllerBtnStatus(int i, int i2) {
        this.M.a(i, i2);
        this.f72811b.a(this.M);
    }

    @Override
    public void setVideoViewExtCreator(IVideoViewExtCreator iVideoViewExtCreator) {
        this.aa = iVideoViewExtCreator;
    }

    public ViewGroup t() {
        return this.f72811b.getTVideoToastContainer();
    }

    public void u() {
        this.f72811b.a();
    }

    public boolean v() {
        return this.e.cn().t();
    }

    public boolean w() {
        return this.e.ae();
    }

    public TVideoProxy x() {
        return this.e.cn();
    }

    public void y() {
        this.ae.c();
    }

    public int z() {
        return this.f72811b.getLockPosition();
    }
}