package D1;

import B0.RunnableC0014a;
import B0.j0;
import C3.AbstractC0055q;
import C3.W;
import N1.T;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Looper;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.PopupWindow;
import android.widget.TextView;
import androidx.media3.ui.DefaultTimeBar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.martsnew.tv.R;
import java.util.Arrays;
import java.util.Collections;
import java.util.Formatter;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.CopyOnWriteArrayList;
import u0.AbstractC1589z;
import u0.C1565a;
import u0.C1566b;
import u0.C1579o;
import u0.Y;
import u0.Z;
import x0.AbstractC1709a;

/* JADX INFO: renamed from: D1.s, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0093s extends FrameLayout {

    /* JADX INFO: renamed from: P0, reason: collision with root package name */
    public static final float[] f1762P0;

    /* JADX INFO: renamed from: A, reason: collision with root package name */
    public final PopupWindow f1763A;

    /* JADX INFO: renamed from: A0, reason: collision with root package name */
    public boolean f1764A0;

    /* JADX INFO: renamed from: B, reason: collision with root package name */
    public final int f1765B;

    /* JADX INFO: renamed from: B0, reason: collision with root package name */
    public boolean f1766B0;

    /* JADX INFO: renamed from: C, reason: collision with root package name */
    public final ImageView f1767C;

    /* JADX INFO: renamed from: C0, reason: collision with root package name */
    public boolean f1768C0;
    public final ImageView D;

    /* JADX INFO: renamed from: D0, reason: collision with root package name */
    public boolean f1769D0;

    /* JADX INFO: renamed from: E, reason: collision with root package name */
    public final ImageView f1770E;

    /* JADX INFO: renamed from: E0, reason: collision with root package name */
    public boolean f1771E0;

    /* JADX INFO: renamed from: F, reason: collision with root package name */
    public final View f1772F;

    /* JADX INFO: renamed from: F0, reason: collision with root package name */
    public boolean f1773F0;

    /* JADX INFO: renamed from: G, reason: collision with root package name */
    public final View f1774G;

    /* JADX INFO: renamed from: G0, reason: collision with root package name */
    public int f1775G0;
    public final TextView H;

    /* JADX INFO: renamed from: H0, reason: collision with root package name */
    public int f1776H0;

    /* JADX INFO: renamed from: I, reason: collision with root package name */
    public final TextView f1777I;

    /* JADX INFO: renamed from: I0, reason: collision with root package name */
    public int f1778I0;

    /* JADX INFO: renamed from: J, reason: collision with root package name */
    public final ImageView f1779J;

    /* JADX INFO: renamed from: J0, reason: collision with root package name */
    public long[] f1780J0;

    /* JADX INFO: renamed from: K, reason: collision with root package name */
    public final ImageView f1781K;
    public boolean[] K0;

    /* JADX INFO: renamed from: L, reason: collision with root package name */
    public final ImageView f1782L;

    /* JADX INFO: renamed from: L0, reason: collision with root package name */
    public final long[] f1783L0;

    /* JADX INFO: renamed from: M, reason: collision with root package name */
    public final ImageView f1784M;

    /* JADX INFO: renamed from: M0, reason: collision with root package name */
    public final boolean[] f1785M0;

    /* JADX INFO: renamed from: N, reason: collision with root package name */
    public final ImageView f1786N;

    /* JADX INFO: renamed from: N0, reason: collision with root package name */
    public long f1787N0;

    /* JADX INFO: renamed from: O, reason: collision with root package name */
    public final ImageView f1788O;

    /* JADX INFO: renamed from: O0, reason: collision with root package name */
    public boolean f1789O0;

    /* JADX INFO: renamed from: P, reason: collision with root package name */
    public final View f1790P;

    /* JADX INFO: renamed from: Q, reason: collision with root package name */
    public final View f1791Q;

    /* JADX INFO: renamed from: R, reason: collision with root package name */
    public final View f1792R;

    /* JADX INFO: renamed from: S, reason: collision with root package name */
    public final TextView f1793S;

    /* JADX INFO: renamed from: T, reason: collision with root package name */
    public final TextView f1794T;

    /* JADX INFO: renamed from: U, reason: collision with root package name */
    public final L f1795U;

    /* JADX INFO: renamed from: V, reason: collision with root package name */
    public final StringBuilder f1796V;

    /* JADX INFO: renamed from: W, reason: collision with root package name */
    public final Formatter f1797W;

    /* JADX INFO: renamed from: a0, reason: collision with root package name */
    public final u0.P f1798a0;

    /* JADX INFO: renamed from: b0, reason: collision with root package name */
    public final u0.Q f1799b0;

    /* JADX INFO: renamed from: c0, reason: collision with root package name */
    public final RunnableC0014a f1800c0;

    /* JADX INFO: renamed from: d0, reason: collision with root package name */
    public final Drawable f1801d0;

    /* JADX INFO: renamed from: e0, reason: collision with root package name */
    public final Drawable f1802e0;

    /* JADX INFO: renamed from: f0, reason: collision with root package name */
    public final Drawable f1803f0;

    /* JADX INFO: renamed from: g0, reason: collision with root package name */
    public final Drawable f1804g0;

    /* JADX INFO: renamed from: h0, reason: collision with root package name */
    public final Drawable f1805h0;

    /* JADX INFO: renamed from: i0, reason: collision with root package name */
    public final String f1806i0;

    /* JADX INFO: renamed from: j0, reason: collision with root package name */
    public final String f1807j0;

    /* JADX INFO: renamed from: k0, reason: collision with root package name */
    public final String f1808k0;

    /* JADX INFO: renamed from: l0, reason: collision with root package name */
    public final Drawable f1809l0;

    /* JADX INFO: renamed from: m0, reason: collision with root package name */
    public final Drawable f1810m0;

    /* JADX INFO: renamed from: n0, reason: collision with root package name */
    public final float f1811n0;

    /* JADX INFO: renamed from: o0, reason: collision with root package name */
    public final float f1812o0;

    /* JADX INFO: renamed from: p0, reason: collision with root package name */
    public final String f1813p0;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final x f1814q;
    public final String q0;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final Resources f1815r;

    /* JADX INFO: renamed from: r0, reason: collision with root package name */
    public final Drawable f1816r0;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public final ViewOnClickListenerC0083h f1817s;

    /* JADX INFO: renamed from: s0, reason: collision with root package name */
    public final Drawable f1818s0;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public final CopyOnWriteArrayList f1819t;

    /* JADX INFO: renamed from: t0, reason: collision with root package name */
    public final String f1820t0;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public final RecyclerView f1821u;

    /* JADX INFO: renamed from: u0, reason: collision with root package name */
    public final String f1822u0;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public final C0089n f1823v;

    /* JADX INFO: renamed from: v0, reason: collision with root package name */
    public final Drawable f1824v0;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public final C0086k f1825w;

    /* JADX INFO: renamed from: w0, reason: collision with root package name */
    public final Drawable f1826w0;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public final C0082g f1827x;

    /* JADX INFO: renamed from: x0, reason: collision with root package name */
    public final String f1828x0;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public final C0082g f1829y;

    /* JADX INFO: renamed from: y0, reason: collision with root package name */
    public final String f1830y0;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public final K4.c f1831z;

    /* JADX INFO: renamed from: z0, reason: collision with root package name */
    public u0.M f1832z0;

    static {
        AbstractC1589z.a("media3.ui");
        f1762P0 = new float[]{0.25f, 0.5f, 0.75f, 1.0f, 1.25f, 1.5f, 2.0f};
    }

    public C0093s(Context context, AttributeSet attributeSet) {
        int i;
        int resourceId;
        int resourceId2;
        int resourceId3;
        int resourceId4;
        int resourceId5;
        int resourceId6;
        int i5;
        int resourceId7;
        int i8;
        int i9;
        boolean z8;
        boolean z9;
        boolean z10;
        boolean z11;
        boolean z12;
        boolean z13;
        int i10;
        int i11;
        int i12;
        boolean z14;
        int i13;
        boolean z15;
        boolean z16;
        boolean z17;
        ImageView imageView;
        boolean z18;
        int i14;
        int i15;
        int i16;
        int i17;
        int i18;
        boolean z19;
        boolean z20;
        boolean z21;
        boolean z22;
        int i19;
        ImageView imageView2;
        int i20;
        int i21;
        int i22;
        int i23;
        ViewOnClickListenerC0083h viewOnClickListenerC0083h;
        Typeface typefaceB;
        super(context, null, 0);
        this.f1769D0 = true;
        this.f1775G0 = 5000;
        this.f1778I0 = 0;
        this.f1776H0 = 200;
        int i24 = R.layout.exo_player_control_view;
        int resourceId8 = R.drawable.exo_styled_controls_next;
        if (attributeSet != null) {
            TypedArray typedArrayObtainStyledAttributes = context.getTheme().obtainStyledAttributes(attributeSet, E.f1657c, 0, 0);
            try {
                int resourceId9 = typedArrayObtainStyledAttributes.getResourceId(6, R.layout.exo_player_control_view);
                int resourceId10 = typedArrayObtainStyledAttributes.getResourceId(12, R.drawable.exo_styled_controls_play);
                int resourceId11 = typedArrayObtainStyledAttributes.getResourceId(11, R.drawable.exo_styled_controls_pause);
                resourceId8 = typedArrayObtainStyledAttributes.getResourceId(10, R.drawable.exo_styled_controls_next);
                int resourceId12 = typedArrayObtainStyledAttributes.getResourceId(7, R.drawable.exo_styled_controls_simple_fastforward);
                int resourceId13 = typedArrayObtainStyledAttributes.getResourceId(15, R.drawable.exo_styled_controls_previous);
                int resourceId14 = typedArrayObtainStyledAttributes.getResourceId(20, R.drawable.exo_styled_controls_simple_rewind);
                int resourceId15 = typedArrayObtainStyledAttributes.getResourceId(9, R.drawable.exo_styled_controls_fullscreen_exit);
                int resourceId16 = typedArrayObtainStyledAttributes.getResourceId(8, R.drawable.exo_styled_controls_fullscreen_enter);
                int resourceId17 = typedArrayObtainStyledAttributes.getResourceId(17, R.drawable.exo_styled_controls_repeat_off);
                resourceId7 = typedArrayObtainStyledAttributes.getResourceId(18, R.drawable.exo_styled_controls_repeat_one);
                resourceId = typedArrayObtainStyledAttributes.getResourceId(16, R.drawable.exo_styled_controls_repeat_all);
                resourceId2 = typedArrayObtainStyledAttributes.getResourceId(35, R.drawable.exo_styled_controls_shuffle_on);
                resourceId3 = typedArrayObtainStyledAttributes.getResourceId(34, R.drawable.exo_styled_controls_shuffle_off);
                resourceId4 = typedArrayObtainStyledAttributes.getResourceId(37, R.drawable.exo_styled_controls_subtitle_on);
                resourceId5 = typedArrayObtainStyledAttributes.getResourceId(36, R.drawable.exo_styled_controls_subtitle_off);
                resourceId6 = typedArrayObtainStyledAttributes.getResourceId(41, R.drawable.exo_styled_controls_vr);
                this.f1775G0 = typedArrayObtainStyledAttributes.getInt(32, this.f1775G0);
                this.f1778I0 = typedArrayObtainStyledAttributes.getInt(19, this.f1778I0);
                z9 = typedArrayObtainStyledAttributes.getBoolean(29, true);
                z10 = typedArrayObtainStyledAttributes.getBoolean(26, true);
                z11 = typedArrayObtainStyledAttributes.getBoolean(28, true);
                z12 = typedArrayObtainStyledAttributes.getBoolean(27, true);
                z8 = typedArrayObtainStyledAttributes.getBoolean(30, false);
                boolean z23 = typedArrayObtainStyledAttributes.getBoolean(31, false);
                boolean z24 = typedArrayObtainStyledAttributes.getBoolean(33, false);
                setTimeBarMinUpdateInterval(typedArrayObtainStyledAttributes.getInt(38, this.f1776H0));
                boolean z25 = typedArrayObtainStyledAttributes.getBoolean(2, true);
                typedArrayObtainStyledAttributes.recycle();
                i = resourceId17;
                i9 = resourceId14;
                i24 = resourceId9;
                z13 = z25;
                i5 = resourceId10;
                i11 = resourceId15;
                i8 = resourceId12;
                z14 = z24;
                i10 = resourceId11;
                i12 = resourceId13;
                i13 = resourceId16;
                z15 = z23;
            } catch (Throwable th) {
                typedArrayObtainStyledAttributes.recycle();
                throw th;
            }
        } else {
            i = R.drawable.exo_styled_controls_repeat_off;
            resourceId = R.drawable.exo_styled_controls_repeat_all;
            resourceId2 = R.drawable.exo_styled_controls_shuffle_on;
            resourceId3 = R.drawable.exo_styled_controls_shuffle_off;
            resourceId4 = R.drawable.exo_styled_controls_subtitle_on;
            resourceId5 = R.drawable.exo_styled_controls_subtitle_off;
            resourceId6 = R.drawable.exo_styled_controls_vr;
            i5 = R.drawable.exo_styled_controls_play;
            resourceId7 = R.drawable.exo_styled_controls_repeat_one;
            i8 = R.drawable.exo_styled_controls_simple_fastforward;
            i9 = R.drawable.exo_styled_controls_simple_rewind;
            z8 = false;
            z9 = true;
            z10 = true;
            z11 = true;
            z12 = true;
            z13 = true;
            i10 = R.drawable.exo_styled_controls_pause;
            i11 = R.drawable.exo_styled_controls_fullscreen_exit;
            i12 = R.drawable.exo_styled_controls_previous;
            z14 = false;
            i13 = R.drawable.exo_styled_controls_fullscreen_enter;
            z15 = false;
        }
        LayoutInflater.from(context).inflate(i24, this);
        setDescendantFocusability(262144);
        ViewOnClickListenerC0083h viewOnClickListenerC0083h2 = new ViewOnClickListenerC0083h(this);
        this.f1817s = viewOnClickListenerC0083h2;
        this.f1819t = new CopyOnWriteArrayList();
        this.f1798a0 = new u0.P();
        this.f1799b0 = new u0.Q();
        StringBuilder sb = new StringBuilder();
        this.f1796V = sb;
        int i25 = i;
        int i26 = i8;
        this.f1797W = new Formatter(sb, Locale.getDefault());
        this.f1780J0 = new long[0];
        this.K0 = new boolean[0];
        this.f1783L0 = new long[0];
        this.f1785M0 = new boolean[0];
        this.f1800c0 = new RunnableC0014a(6, this);
        this.f1793S = (TextView) findViewById(R.id.exo_duration);
        this.f1794T = (TextView) findViewById(R.id.exo_position);
        ImageView imageView3 = (ImageView) findViewById(R.id.exo_subtitle);
        this.f1784M = imageView3;
        if (imageView3 != null) {
            imageView3.setOnClickListener(viewOnClickListenerC0083h2);
        }
        ImageView imageView4 = (ImageView) findViewById(R.id.exo_fullscreen);
        this.f1786N = imageView4;
        C5.c cVar = new C5.c(1, this);
        if (imageView4 != null) {
            imageView4.setVisibility(8);
            imageView4.setOnClickListener(cVar);
        }
        ImageView imageView5 = (ImageView) findViewById(R.id.exo_minimal_fullscreen);
        this.f1788O = imageView5;
        C5.c cVar2 = new C5.c(1, this);
        if (imageView5 != null) {
            imageView5.setVisibility(8);
            imageView5.setOnClickListener(cVar2);
        }
        View viewFindViewById = findViewById(R.id.exo_settings);
        this.f1790P = viewFindViewById;
        if (viewFindViewById != null) {
            viewFindViewById.setOnClickListener(viewOnClickListenerC0083h2);
        }
        View viewFindViewById2 = findViewById(R.id.exo_playback_speed);
        this.f1791Q = viewFindViewById2;
        if (viewFindViewById2 != null) {
            viewFindViewById2.setOnClickListener(viewOnClickListenerC0083h2);
        }
        View viewFindViewById3 = findViewById(R.id.exo_audio_track);
        this.f1792R = viewFindViewById3;
        if (viewFindViewById3 != null) {
            viewFindViewById3.setOnClickListener(viewOnClickListenerC0083h2);
        }
        L l8 = (L) findViewById(R.id.exo_progress);
        View viewFindViewById4 = findViewById(R.id.exo_progress_placeholder);
        if (l8 != null) {
            this.f1795U = l8;
            z16 = z15;
            z17 = z14;
        } else if (viewFindViewById4 != null) {
            z17 = z14;
            z16 = z15;
            DefaultTimeBar defaultTimeBar = new DefaultTimeBar(context, null, attributeSet, R.style.ExoStyledControls_TimeBar);
            defaultTimeBar.setId(R.id.exo_progress);
            defaultTimeBar.setLayoutParams(viewFindViewById4.getLayoutParams());
            ViewGroup viewGroup = (ViewGroup) viewFindViewById4.getParent();
            int iIndexOfChild = viewGroup.indexOfChild(viewFindViewById4);
            viewGroup.removeView(viewFindViewById4);
            viewGroup.addView(defaultTimeBar, iIndexOfChild);
            this.f1795U = defaultTimeBar;
        } else {
            z16 = z15;
            z17 = z14;
            this.f1795U = null;
        }
        L l9 = this.f1795U;
        if (l9 != null) {
            ((DefaultTimeBar) l9).f8898N.add(viewOnClickListenerC0083h2);
        }
        Resources resources = context.getResources();
        this.f1815r = resources;
        ImageView imageView6 = (ImageView) findViewById(R.id.exo_play_pause);
        this.f1770E = imageView6;
        if (imageView6 != null) {
            imageView6.setOnClickListener(viewOnClickListenerC0083h2);
        }
        ImageView imageView7 = (ImageView) findViewById(R.id.exo_prev);
        this.f1767C = imageView7;
        if (imageView7 != null) {
            imageView7.setImageDrawable(resources.getDrawable(i12, context.getTheme()));
            imageView7.setOnClickListener(viewOnClickListenerC0083h2);
        }
        ImageView imageView8 = (ImageView) findViewById(R.id.exo_next);
        this.D = imageView8;
        if (imageView8 != null) {
            imageView8.setImageDrawable(resources.getDrawable(resourceId8, context.getTheme()));
            imageView8.setOnClickListener(viewOnClickListenerC0083h2);
        }
        ThreadLocal threadLocal = E.j.f1954a;
        if (context.isRestricted()) {
            imageView = imageView8;
            z18 = z8;
            i14 = resourceId7;
            i15 = resourceId;
            i16 = resourceId2;
            i17 = resourceId3;
            i18 = resourceId6;
            z19 = z9;
            z20 = z10;
            z21 = z11;
            z22 = z12;
            i19 = i26;
            imageView2 = imageView7;
            i20 = i13;
            i21 = i11;
            i22 = resourceId4;
            i23 = resourceId5;
            viewOnClickListenerC0083h = viewOnClickListenerC0083h2;
            typefaceB = null;
        } else {
            imageView = imageView8;
            z18 = z8;
            i14 = resourceId7;
            i15 = resourceId;
            i16 = resourceId2;
            i17 = resourceId3;
            i18 = resourceId6;
            z19 = z9;
            z20 = z10;
            z21 = z11;
            z22 = z12;
            i19 = i26;
            imageView2 = imageView7;
            i20 = i13;
            i21 = i11;
            i22 = resourceId4;
            i23 = resourceId5;
            viewOnClickListenerC0083h = viewOnClickListenerC0083h2;
            typefaceB = E.j.b(context, R.font.roboto_medium_numbers, new TypedValue(), 0, null, false, false);
        }
        ImageView imageView9 = (ImageView) findViewById(R.id.exo_rew);
        TextView textView = (TextView) findViewById(R.id.exo_rew_with_amount);
        if (imageView9 != null) {
            imageView9.setImageDrawable(resources.getDrawable(i9, context.getTheme()));
            this.f1774G = imageView9;
            this.f1777I = null;
        } else if (textView != null) {
            textView.setTypeface(typefaceB);
            this.f1777I = textView;
            this.f1774G = textView;
        } else {
            this.f1777I = null;
            this.f1774G = null;
        }
        View view = this.f1774G;
        if (view != null) {
            view.setOnClickListener(viewOnClickListenerC0083h);
        }
        ImageView imageView10 = (ImageView) findViewById(R.id.exo_ffwd);
        TextView textView2 = (TextView) findViewById(R.id.exo_ffwd_with_amount);
        if (imageView10 != null) {
            imageView10.setImageDrawable(resources.getDrawable(i19, context.getTheme()));
            this.f1772F = imageView10;
            this.H = null;
        } else if (textView2 != null) {
            textView2.setTypeface(typefaceB);
            this.H = textView2;
            this.f1772F = textView2;
        } else {
            this.H = null;
            this.f1772F = null;
        }
        View view2 = this.f1772F;
        if (view2 != null) {
            view2.setOnClickListener(viewOnClickListenerC0083h);
        }
        ImageView imageView11 = (ImageView) findViewById(R.id.exo_repeat_toggle);
        this.f1779J = imageView11;
        if (imageView11 != null) {
            imageView11.setOnClickListener(viewOnClickListenerC0083h);
        }
        ImageView imageView12 = (ImageView) findViewById(R.id.exo_shuffle);
        this.f1781K = imageView12;
        if (imageView12 != null) {
            imageView12.setOnClickListener(viewOnClickListenerC0083h);
        }
        this.f1811n0 = resources.getInteger(R.integer.exo_media_button_opacity_percentage_enabled) / 100.0f;
        this.f1812o0 = resources.getInteger(R.integer.exo_media_button_opacity_percentage_disabled) / 100.0f;
        ImageView imageView13 = (ImageView) findViewById(R.id.exo_vr);
        this.f1782L = imageView13;
        if (imageView13 != null) {
            imageView13.setImageDrawable(resources.getDrawable(i18, context.getTheme()));
            j(imageView13, false);
        }
        x xVar = new x(this);
        this.f1814q = xVar;
        xVar.f1844C = z13;
        C0089n c0089n = new C0089n(this, new String[]{resources.getString(R.string.exo_controls_playback_speed), resources.getString(R.string.exo_track_selection_title_audio)}, new Drawable[]{resources.getDrawable(R.drawable.exo_styled_controls_speed, context.getTheme()), resources.getDrawable(R.drawable.exo_styled_controls_audiotrack, context.getTheme())});
        this.f1823v = c0089n;
        this.f1765B = resources.getDimensionPixelSize(R.dimen.exo_settings_offset);
        RecyclerView recyclerView = (RecyclerView) LayoutInflater.from(context).inflate(R.layout.exo_styled_settings_list, (ViewGroup) null);
        this.f1821u = recyclerView;
        recyclerView.setAdapter(c0089n);
        getContext();
        recyclerView.setLayoutManager(new LinearLayoutManager(1));
        PopupWindow popupWindow = new PopupWindow((View) recyclerView, -2, -2, true);
        this.f1763A = popupWindow;
        if (x0.v.f18553a < 23) {
            popupWindow.setBackgroundDrawable(new ColorDrawable(0));
        }
        popupWindow.setOnDismissListener(viewOnClickListenerC0083h);
        this.f1789O0 = true;
        this.f1831z = new K4.c(getResources());
        this.f1816r0 = resources.getDrawable(i22, context.getTheme());
        this.f1818s0 = resources.getDrawable(i23, context.getTheme());
        this.f1820t0 = resources.getString(R.string.exo_controls_cc_enabled_description);
        this.f1822u0 = resources.getString(R.string.exo_controls_cc_disabled_description);
        this.f1827x = new C0082g(this, 1);
        this.f1829y = new C0082g(this, 0);
        this.f1825w = new C0086k(this, resources.getStringArray(R.array.exo_controls_playback_speeds), f1762P0);
        this.f1801d0 = resources.getDrawable(i5, context.getTheme());
        this.f1802e0 = resources.getDrawable(i10, context.getTheme());
        this.f1824v0 = resources.getDrawable(i21, context.getTheme());
        this.f1826w0 = resources.getDrawable(i20, context.getTheme());
        this.f1803f0 = resources.getDrawable(i25, context.getTheme());
        this.f1804g0 = resources.getDrawable(i14, context.getTheme());
        this.f1805h0 = resources.getDrawable(i15, context.getTheme());
        this.f1809l0 = resources.getDrawable(i16, context.getTheme());
        this.f1810m0 = resources.getDrawable(i17, context.getTheme());
        this.f1828x0 = resources.getString(R.string.exo_controls_fullscreen_exit_description);
        this.f1830y0 = resources.getString(R.string.exo_controls_fullscreen_enter_description);
        this.f1806i0 = resources.getString(R.string.exo_controls_repeat_off_description);
        this.f1807j0 = resources.getString(R.string.exo_controls_repeat_one_description);
        this.f1808k0 = resources.getString(R.string.exo_controls_repeat_all_description);
        this.f1813p0 = resources.getString(R.string.exo_controls_shuffle_on_description);
        this.q0 = resources.getString(R.string.exo_controls_shuffle_off_description);
        xVar.h((ViewGroup) findViewById(R.id.exo_bottom_bar), true);
        xVar.h(this.f1772F, z20);
        xVar.h(this.f1774G, z19);
        xVar.h(imageView2, z21);
        xVar.h(imageView, z22);
        xVar.h(imageView12, z18);
        xVar.h(this.f1784M, z16);
        xVar.h(imageView13, z17);
        xVar.h(imageView11, this.f1778I0 != 0);
        addOnLayoutChangeListener(new ViewOnLayoutChangeListenerC0081f(0, this));
    }

    public static boolean b(u0.M m8, u0.Q q8) {
        u0.S sO;
        int iO;
        O3.e eVar = (O3.e) m8;
        if (!eVar.o(17) || (iO = (sO = ((B0.I) eVar).O()).o()) <= 1 || iO > 100) {
            return false;
        }
        for (int i = 0; i < iO; i++) {
            if (sO.m(i, q8, 0L).f17195m == -9223372036854775807L) {
                return false;
            }
        }
        return true;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public void setPlaybackSpeed(float f3) {
        u0.M m8 = this.f1832z0;
        if (m8 == null || !((O3.e) m8).o(13)) {
            return;
        }
        B0.I i = (B0.I) this.f1832z0;
        i.p0();
        u0.H h8 = new u0.H(f3, i.f580w0.f828o.f17160b);
        i.p0();
        if (i.f580w0.f828o.equals(h8)) {
            return;
        }
        j0 j0VarG = i.f580w0.g(h8);
        i.f551Y++;
        i.f531B.f651x.a(4, h8).b();
        i.n0(j0VarG, 0, false, 5, -9223372036854775807L, -1, false);
    }

    /* JADX WARN: Removed duplicated region for block: B:25:0x006c  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean c(KeyEvent keyEvent) {
        int keyCode = keyEvent.getKeyCode();
        u0.M m8 = this.f1832z0;
        if (m8 == null) {
            return false;
        }
        if (keyCode != 90 && keyCode != 89 && keyCode != 85 && keyCode != 79 && keyCode != 126 && keyCode != 127 && keyCode != 87 && keyCode != 88) {
            return false;
        }
        if (keyEvent.getAction() == 0) {
            if (keyCode == 90) {
                if (((B0.I) m8).T() != 4) {
                    O3.e eVar = (O3.e) m8;
                    if (eVar.o(12)) {
                        B0.I i = (B0.I) eVar;
                        i.p0();
                        eVar.B(i.f540M, 12);
                    }
                }
            } else if (keyCode == 89) {
                O3.e eVar2 = (O3.e) m8;
                if (eVar2.o(11)) {
                    B0.I i5 = (B0.I) eVar2;
                    i5.p0();
                    eVar2.B(-i5.f539L, 11);
                } else if (keyEvent.getRepeatCount() == 0) {
                    if (keyCode == 79 || keyCode == 85) {
                        if (x0.v.U(m8, this.f1769D0)) {
                            x0.v.D(m8);
                        } else {
                            O3.e eVar3 = (O3.e) m8;
                            if (eVar3.o(1)) {
                                eVar3.w();
                            }
                        }
                    } else if (keyCode == 87) {
                        O3.e eVar4 = (O3.e) m8;
                        if (eVar4.o(9)) {
                            eVar4.A();
                        }
                    } else if (keyCode == 88) {
                        O3.e eVar5 = (O3.e) m8;
                        if (eVar5.o(7)) {
                            eVar5.C();
                        }
                    } else if (keyCode == 126) {
                        x0.v.D(m8);
                    } else if (keyCode == 127) {
                        int i8 = x0.v.f18553a;
                        O3.e eVar6 = (O3.e) m8;
                        if (eVar6.o(1)) {
                            eVar6.w();
                        }
                    }
                }
            }
        }
        return true;
    }

    public final void d(T t6, View view) {
        this.f1821u.setAdapter(t6);
        q();
        this.f1789O0 = false;
        PopupWindow popupWindow = this.f1763A;
        popupWindow.dismiss();
        this.f1789O0 = true;
        int width = getWidth() - popupWindow.getWidth();
        int i = this.f1765B;
        popupWindow.showAsDropDown(view, width - i, (-popupWindow.getHeight()) - i);
    }

    @Override // android.view.ViewGroup, android.view.View
    public final boolean dispatchKeyEvent(KeyEvent keyEvent) {
        return c(keyEvent) || super.dispatchKeyEvent(keyEvent);
    }

    public final W e(Z z8, int i) {
        AbstractC0055q.c(4, "initialCapacity");
        Object[] objArrCopyOf = new Object[4];
        C3.G g8 = z8.f17252a;
        int i5 = 0;
        for (int i8 = 0; i8 < g8.size(); i8++) {
            Y y8 = (Y) g8.get(i8);
            if (y8.f17247b.f17202c == i) {
                for (int i9 = 0; i9 < y8.f17246a; i9++) {
                    if (y8.a(i9)) {
                        C1579o c1579o = y8.f17247b.f17203d[i9];
                        if ((c1579o.f17350e & 2) == 0) {
                            C0091p c0091p = new C0091p(z8, i8, i9, this.f1831z.B(c1579o));
                            int i10 = i5 + 1;
                            int iF = C3.A.f(objArrCopyOf.length, i10);
                            if (iF > objArrCopyOf.length) {
                                objArrCopyOf = Arrays.copyOf(objArrCopyOf, iF);
                            }
                            objArrCopyOf[i5] = c0091p;
                            i5 = i10;
                        }
                    }
                }
            }
        }
        return C3.G.i(i5, objArrCopyOf);
    }

    public final void f() {
        x xVar = this.f1814q;
        int i = xVar.f1869z;
        if (i == 3 || i == 2) {
            return;
        }
        xVar.f();
        if (!xVar.f1844C) {
            xVar.i(2);
        } else if (xVar.f1869z == 1) {
            xVar.f1856m.start();
        } else {
            xVar.f1857n.start();
        }
    }

    public final boolean g() {
        x xVar = this.f1814q;
        return xVar.f1869z == 0 && xVar.f1845a.h();
    }

    public u0.M getPlayer() {
        return this.f1832z0;
    }

    public int getRepeatToggleModes() {
        return this.f1778I0;
    }

    public boolean getShowShuffleButton() {
        return this.f1814q.b(this.f1781K);
    }

    public boolean getShowSubtitleButton() {
        return this.f1814q.b(this.f1784M);
    }

    public int getShowTimeoutMs() {
        return this.f1775G0;
    }

    public boolean getShowVrButton() {
        return this.f1814q.b(this.f1782L);
    }

    public final boolean h() {
        return getVisibility() == 0;
    }

    public final void i() {
        m();
        l();
        p();
        r();
        t();
        n();
        s();
    }

    public final void j(View view, boolean z8) {
        if (view == null) {
            return;
        }
        view.setEnabled(z8);
        view.setAlpha(z8 ? this.f1811n0 : this.f1812o0);
    }

    public final void k(boolean z8) {
        if (this.f1764A0 == z8) {
            return;
        }
        this.f1764A0 = z8;
        String str = this.f1830y0;
        Drawable drawable = this.f1826w0;
        String str2 = this.f1828x0;
        Drawable drawable2 = this.f1824v0;
        ImageView imageView = this.f1786N;
        if (imageView != null) {
            if (z8) {
                imageView.setImageDrawable(drawable2);
                imageView.setContentDescription(str2);
            } else {
                imageView.setImageDrawable(drawable);
                imageView.setContentDescription(str);
            }
        }
        ImageView imageView2 = this.f1788O;
        if (imageView2 == null) {
            return;
        }
        if (z8) {
            imageView2.setImageDrawable(drawable2);
            imageView2.setContentDescription(str2);
        } else {
            imageView2.setImageDrawable(drawable);
            imageView2.setContentDescription(str);
        }
    }

    public final void l() {
        boolean zO;
        boolean zO2;
        boolean zO3;
        boolean zO4;
        boolean zO5;
        long j8;
        long j9;
        if (h() && this.f1766B0) {
            u0.M m8 = this.f1832z0;
            if (m8 != null) {
                zO2 = (this.f1768C0 && b(m8, this.f1799b0)) ? ((O3.e) m8).o(10) : ((O3.e) m8).o(5);
                O3.e eVar = (O3.e) m8;
                zO3 = eVar.o(7);
                zO4 = eVar.o(11);
                zO5 = eVar.o(12);
                zO = eVar.o(9);
            } else {
                zO = false;
                zO2 = false;
                zO3 = false;
                zO4 = false;
                zO5 = false;
            }
            Resources resources = this.f1815r;
            View view = this.f1774G;
            if (zO4) {
                u0.M m9 = this.f1832z0;
                if (m9 != null) {
                    B0.I i = (B0.I) m9;
                    i.p0();
                    j9 = i.f539L;
                } else {
                    j9 = 5000;
                }
                int i5 = (int) (j9 / 1000);
                TextView textView = this.f1777I;
                if (textView != null) {
                    textView.setText(String.valueOf(i5));
                }
                if (view != null) {
                    view.setContentDescription(resources.getQuantityString(R.plurals.exo_controls_rewind_by_amount_description, i5, Integer.valueOf(i5)));
                }
            }
            View view2 = this.f1772F;
            if (zO5) {
                u0.M m10 = this.f1832z0;
                if (m10 != null) {
                    B0.I i8 = (B0.I) m10;
                    i8.p0();
                    j8 = i8.f540M;
                } else {
                    j8 = 15000;
                }
                int i9 = (int) (j8 / 1000);
                TextView textView2 = this.H;
                if (textView2 != null) {
                    textView2.setText(String.valueOf(i9));
                }
                if (view2 != null) {
                    view2.setContentDescription(resources.getQuantityString(R.plurals.exo_controls_fastforward_by_amount_description, i9, Integer.valueOf(i9)));
                }
            }
            j(this.f1767C, zO3);
            j(view, zO4);
            j(view2, zO5);
            j(this.D, zO);
            L l8 = this.f1795U;
            if (l8 != null) {
                l8.setEnabled(zO2);
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:25:0x0056  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void m() {
        ImageView imageView;
        boolean z8;
        if (h() && this.f1766B0 && (imageView = this.f1770E) != null) {
            boolean zU = x0.v.U(this.f1832z0, this.f1769D0);
            Drawable drawable = zU ? this.f1801d0 : this.f1802e0;
            int i = zU ? R.string.exo_controls_play_description : R.string.exo_controls_pause_description;
            imageView.setImageDrawable(drawable);
            imageView.setContentDescription(this.f1815r.getString(i));
            u0.M m8 = this.f1832z0;
            if (m8 != null) {
                O3.e eVar = (O3.e) m8;
                z8 = true;
                if (!eVar.o(1) || (eVar.o(17) && ((B0.I) m8).O().p())) {
                    z8 = false;
                }
            }
            j(imageView, z8);
        }
    }

    public final void n() {
        C0086k c0086k;
        u0.M m8 = this.f1832z0;
        if (m8 == null) {
            return;
        }
        B0.I i = (B0.I) m8;
        i.p0();
        float f3 = i.f580w0.f828o.f17159a;
        float f7 = Float.MAX_VALUE;
        int i5 = 0;
        int i8 = 0;
        while (true) {
            c0086k = this.f1825w;
            float[] fArr = c0086k.f1742e;
            if (i5 >= fArr.length) {
                break;
            }
            float fAbs = Math.abs(f3 - fArr[i5]);
            if (fAbs < f7) {
                i8 = i5;
                f7 = fAbs;
            }
            i5++;
        }
        c0086k.f1743f = i8;
        String str = c0086k.f1741d[i8];
        C0089n c0089n = this.f1823v;
        c0089n.f1750e[0] = str;
        j(this.f1790P, c0089n.n(1) || c0089n.n(0));
    }

    public final void o() {
        long j8;
        long jW;
        if (h() && this.f1766B0) {
            u0.M m8 = this.f1832z0;
            long j9 = 0;
            if (m8 == null || !((O3.e) m8).o(16)) {
                j8 = 0;
            } else {
                long j10 = this.f1787N0;
                B0.I i = (B0.I) m8;
                i.p0();
                long jI = i.I(i.f580w0) + j10;
                long j11 = this.f1787N0;
                i.p0();
                if (i.f580w0.f815a.p()) {
                    jW = i.f584y0;
                } else {
                    j0 j0Var = i.f580w0;
                    if (j0Var.f824k.f3628d != j0Var.f816b.f3628d) {
                        jW = x0.v.W(j0Var.f815a.m(i.L(), (u0.Q) i.f5146q, 0L).f17195m);
                    } else {
                        long j12 = j0Var.f830q;
                        if (i.f580w0.f824k.b()) {
                            j0 j0Var2 = i.f580w0;
                            j0Var2.f815a.g(j0Var2.f824k.f3625a, i.f533E).d(i.f580w0.f824k.f3626b);
                        } else {
                            j9 = j12;
                        }
                        j0 j0Var3 = i.f580w0;
                        u0.S s8 = j0Var3.f815a;
                        Object obj = j0Var3.f824k.f3625a;
                        u0.P p3 = i.f533E;
                        s8.g(obj, p3);
                        jW = x0.v.W(j9 + p3.f17179e);
                    }
                }
                j8 = jW + j11;
                j9 = jI;
            }
            TextView textView = this.f1794T;
            if (textView != null && !this.f1773F0) {
                textView.setText(x0.v.A(this.f1796V, this.f1797W, j9));
            }
            L l8 = this.f1795U;
            if (l8 != null) {
                l8.setPosition(j9);
                this.f1795U.setBufferedPosition(j8);
            }
            removeCallbacks(this.f1800c0);
            int iT = m8 == null ? 1 : ((B0.I) m8).T();
            if (m8 == null || !((O3.e) m8).s()) {
                if (iT == 4 || iT == 1) {
                    return;
                }
                postDelayed(this.f1800c0, 1000L);
                return;
            }
            L l9 = this.f1795U;
            long jMin = Math.min(l9 != null ? l9.getPreferredUpdateDelay() : 1000L, 1000 - (j9 % 1000));
            B0.I i5 = (B0.I) m8;
            i5.p0();
            float f3 = i5.f580w0.f828o.f17159a;
            postDelayed(this.f1800c0, x0.v.j(f3 > 0.0f ? (long) (jMin / f3) : 1000L, this.f1776H0, 1000L));
        }
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void onAttachedToWindow() {
        super.onAttachedToWindow();
        x xVar = this.f1814q;
        xVar.f1845a.addOnLayoutChangeListener(xVar.f1867x);
        this.f1766B0 = true;
        if (g()) {
            xVar.g();
        }
        i();
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        x xVar = this.f1814q;
        xVar.f1845a.removeOnLayoutChangeListener(xVar.f1867x);
        this.f1766B0 = false;
        removeCallbacks(this.f1800c0);
        xVar.f();
    }

    @Override // android.widget.FrameLayout, android.view.ViewGroup, android.view.View
    public final void onLayout(boolean z8, int i, int i5, int i8, int i9) {
        super.onLayout(z8, i, i5, i8, i9);
        View view = this.f1814q.f1846b;
        if (view != null) {
            view.layout(0, 0, i8 - i, i9 - i5);
        }
    }

    public final void p() {
        ImageView imageView;
        if (h() && this.f1766B0 && (imageView = this.f1779J) != null) {
            if (this.f1778I0 == 0) {
                j(imageView, false);
                return;
            }
            u0.M m8 = this.f1832z0;
            String str = this.f1806i0;
            Drawable drawable = this.f1803f0;
            if (m8 == null || !((O3.e) m8).o(15)) {
                j(imageView, false);
                imageView.setImageDrawable(drawable);
                imageView.setContentDescription(str);
                return;
            }
            j(imageView, true);
            B0.I i = (B0.I) m8;
            i.p0();
            int i5 = i.f550W;
            if (i5 == 0) {
                imageView.setImageDrawable(drawable);
                imageView.setContentDescription(str);
            } else if (i5 == 1) {
                imageView.setImageDrawable(this.f1804g0);
                imageView.setContentDescription(this.f1807j0);
            } else {
                if (i5 != 2) {
                    return;
                }
                imageView.setImageDrawable(this.f1805h0);
                imageView.setContentDescription(this.f1808k0);
            }
        }
    }

    public final void q() {
        RecyclerView recyclerView = this.f1821u;
        recyclerView.measure(0, 0);
        int width = getWidth();
        int i = this.f1765B;
        int iMin = Math.min(recyclerView.getMeasuredWidth(), width - (i * 2));
        PopupWindow popupWindow = this.f1763A;
        popupWindow.setWidth(iMin);
        popupWindow.setHeight(Math.min(getHeight() - (i * 2), recyclerView.getMeasuredHeight()));
    }

    public final void r() {
        ImageView imageView;
        if (h() && this.f1766B0 && (imageView = this.f1781K) != null) {
            u0.M m8 = this.f1832z0;
            if (!this.f1814q.b(imageView)) {
                j(imageView, false);
                return;
            }
            String str = this.q0;
            Drawable drawable = this.f1810m0;
            if (m8 == null || !((O3.e) m8).o(14)) {
                j(imageView, false);
                imageView.setImageDrawable(drawable);
                imageView.setContentDescription(str);
                return;
            }
            j(imageView, true);
            B0.I i = (B0.I) m8;
            i.p0();
            if (i.X) {
                drawable = this.f1809l0;
            }
            imageView.setImageDrawable(drawable);
            i.p0();
            if (i.X) {
                str = this.f1813p0;
            }
            imageView.setContentDescription(str);
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:74:0x013a  */
    /* JADX WARN: Type inference failed for: r11v0 */
    /* JADX WARN: Type inference failed for: r11v1, types: [int] */
    /* JADX WARN: Type inference failed for: r11v3 */
    /* JADX WARN: Type inference failed for: r3v18, types: [u0.b] */
    /* JADX WARN: Type inference failed for: r7v2, types: [u0.P] */
    /* JADX WARN: Type inference failed for: r8v3, types: [u0.S] */
    /* JADX WARN: Type inference failed for: r8v7 */
    /* JADX WARN: Type inference failed for: r8v8 */
    /* JADX WARN: Type inference fix 'apply assigned field type' failed
    java.lang.UnsupportedOperationException: ArgType.getObject(), call class: class jadx.core.dex.instructions.args.ArgType$UnknownArg
    	at jadx.core.dex.instructions.args.ArgType.getObject(ArgType.java:593)
    	at jadx.core.dex.attributes.nodes.ClassTypeVarsAttr.getTypeVarsMapFor(ClassTypeVarsAttr.java:35)
    	at jadx.core.dex.nodes.utils.TypeUtils.replaceClassGenerics(TypeUtils.java:177)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.insertExplicitUseCast(FixTypesVisitor.java:397)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.tryFieldTypeWithNewCasts(FixTypesVisitor.java:359)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.applyFieldType(FixTypesVisitor.java:309)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.visit(FixTypesVisitor.java:94)
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void s() {
        boolean z8;
        long jL;
        int i;
        int i5;
        boolean z9;
        boolean[] zArr;
        boolean z10;
        u0.M m8 = this.f1832z0;
        if (m8 == null) {
            return;
        }
        boolean z11 = this.f1768C0;
        boolean z12 = false;
        boolean z13 = true;
        u0.Q q8 = this.f1799b0;
        this.f1771E0 = z11 && b(m8, q8);
        long j8 = 0;
        this.f1787N0 = 0L;
        O3.e eVar = (O3.e) m8;
        ?? O7 = eVar.o(17) ? ((B0.I) m8).O() : u0.S.f17199a;
        long j9 = -9223372036854775807L;
        if (O7.p()) {
            z8 = true;
            if (eVar.o(16)) {
                long j10 = eVar.j();
                jL = j10 != -9223372036854775807L ? x0.v.L(j10) : 0L;
                i = 0;
            }
        } else {
            int iL = ((B0.I) m8).L();
            boolean z14 = this.f1771E0;
            int i8 = z14 ? 0 : iL;
            int iO = z14 ? O7.o() - 1 : iL;
            i = 0;
            long j11 = 0;
            while (true) {
                if (i8 > iO) {
                    break;
                }
                long j12 = j8;
                if (i8 == iL) {
                    this.f1787N0 = x0.v.W(j11);
                }
                O7.n(i8, q8);
                if (q8.f17195m == j9) {
                    AbstractC1709a.j(this.f1771E0 ^ z13);
                    break;
                }
                int i9 = q8.f17196n;
                while (i9 <= q8.f17197o) {
                    ?? r72 = this.f1798a0;
                    O7.f(i9, r72, z12);
                    long j13 = j9;
                    C1566b c1566b = r72.f17181g;
                    c1566b.getClass();
                    long j14 = j12;
                    for (?? r11 = z12; r11 < c1566b.f17263a; r11++) {
                        r72.d(r11);
                        long j15 = r72.f17179e;
                        if (j15 >= j14) {
                            long[] jArr = this.f1780J0;
                            i5 = iL;
                            if (i == jArr.length) {
                                int length = jArr.length == 0 ? 1 : jArr.length * 2;
                                this.f1780J0 = Arrays.copyOf(jArr, length);
                                this.K0 = Arrays.copyOf(this.K0, length);
                            }
                            this.f1780J0[i] = x0.v.W(j15 + j11);
                            boolean[] zArr2 = this.K0;
                            C1565a c1565aA = r72.f17181g.a(r11);
                            int i10 = c1565aA.f17253a;
                            if (i10 == -1) {
                                zArr = zArr2;
                                z9 = true;
                                z10 = true;
                            } else {
                                int i11 = 0;
                                while (i11 < i10) {
                                    zArr = zArr2;
                                    int i12 = c1565aA.f17257e[i11];
                                    if (i12 != 0) {
                                        C1565a c1565a = c1565aA;
                                        z9 = true;
                                        if (i12 != 1) {
                                            i11++;
                                            zArr2 = zArr;
                                            c1565aA = c1565a;
                                        }
                                    } else {
                                        z9 = true;
                                    }
                                    z10 = z9;
                                    break;
                                }
                                zArr = zArr2;
                                z9 = true;
                                z10 = false;
                            }
                            zArr[i] = !z10;
                            i++;
                        } else {
                            i5 = iL;
                            z9 = true;
                        }
                        z13 = z9;
                        iL = i5;
                    }
                    i9++;
                    j9 = j13;
                    j12 = j14;
                    z12 = false;
                }
                j11 += q8.f17195m;
                i8++;
                j8 = j12;
                z12 = false;
            }
            z8 = z13;
            jL = j11;
        }
        long jW = x0.v.W(jL);
        TextView textView = this.f1793S;
        if (textView != null) {
            textView.setText(x0.v.A(this.f1796V, this.f1797W, jW));
        }
        L l8 = this.f1795U;
        if (l8 != null) {
            l8.setDuration(jW);
            long[] jArr2 = this.f1783L0;
            int length2 = jArr2.length;
            int i13 = i + length2;
            long[] jArr3 = this.f1780J0;
            if (i13 > jArr3.length) {
                this.f1780J0 = Arrays.copyOf(jArr3, i13);
                this.K0 = Arrays.copyOf(this.K0, i13);
            }
            System.arraycopy(jArr2, 0, this.f1780J0, i, length2);
            System.arraycopy(this.f1785M0, 0, this.K0, i, length2);
            long[] jArr4 = this.f1780J0;
            boolean[] zArr3 = this.K0;
            DefaultTimeBar defaultTimeBar = (DefaultTimeBar) l8;
            if (i13 != 0 && (jArr4 == null || zArr3 == null)) {
                z8 = false;
            }
            AbstractC1709a.d(z8);
            defaultTimeBar.f8913f0 = i13;
            defaultTimeBar.f8914g0 = jArr4;
            defaultTimeBar.f8915h0 = zArr3;
            defaultTimeBar.e();
        }
        o();
    }

    public void setAnimationEnabled(boolean z8) {
        this.f1814q.f1844C = z8;
    }

    @Deprecated
    public void setOnFullScreenModeChangedListener(InterfaceC0084i interfaceC0084i) {
        boolean z8 = interfaceC0084i != null;
        ImageView imageView = this.f1786N;
        if (imageView != null) {
            if (z8) {
                imageView.setVisibility(0);
            } else {
                imageView.setVisibility(8);
            }
        }
        boolean z9 = interfaceC0084i != null;
        ImageView imageView2 = this.f1788O;
        if (imageView2 == null) {
            return;
        }
        if (z9) {
            imageView2.setVisibility(0);
        } else {
            imageView2.setVisibility(8);
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:10:0x001f  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void setPlayer(u0.M m8) {
        boolean z8;
        AbstractC1709a.j(Looper.myLooper() == Looper.getMainLooper());
        if (m8 != null) {
            z8 = ((B0.I) m8).f537J == Looper.getMainLooper();
        }
        AbstractC1709a.d(z8);
        u0.M m9 = this.f1832z0;
        if (m9 == m8) {
            return;
        }
        ViewOnClickListenerC0083h viewOnClickListenerC0083h = this.f1817s;
        if (m9 != null) {
            ((B0.I) m9).c0(viewOnClickListenerC0083h);
        }
        this.f1832z0 = m8;
        if (m8 != null) {
            viewOnClickListenerC0083h.getClass();
            ((B0.I) m8).f532C.a(viewOnClickListenerC0083h);
        }
        i();
    }

    public void setRepeatToggleModes(int i) {
        this.f1778I0 = i;
        u0.M m8 = this.f1832z0;
        if (m8 != null && ((O3.e) m8).o(15)) {
            B0.I i5 = (B0.I) this.f1832z0;
            i5.p0();
            int i8 = i5.f550W;
            if (i == 0 && i8 != 0) {
                ((B0.I) this.f1832z0).h0(0);
            } else if (i == 1 && i8 == 2) {
                ((B0.I) this.f1832z0).h0(1);
            } else if (i == 2 && i8 == 1) {
                ((B0.I) this.f1832z0).h0(2);
            }
        }
        this.f1814q.h(this.f1779J, i != 0);
        p();
    }

    public void setShowFastForwardButton(boolean z8) {
        this.f1814q.h(this.f1772F, z8);
        l();
    }

    @Deprecated
    public void setShowMultiWindowTimeBar(boolean z8) {
        this.f1768C0 = z8;
        s();
    }

    public void setShowNextButton(boolean z8) {
        this.f1814q.h(this.D, z8);
        l();
    }

    public void setShowPlayButtonIfPlaybackIsSuppressed(boolean z8) {
        this.f1769D0 = z8;
        m();
    }

    public void setShowPreviousButton(boolean z8) {
        this.f1814q.h(this.f1767C, z8);
        l();
    }

    public void setShowRewindButton(boolean z8) {
        this.f1814q.h(this.f1774G, z8);
        l();
    }

    public void setShowShuffleButton(boolean z8) {
        this.f1814q.h(this.f1781K, z8);
        r();
    }

    public void setShowSubtitleButton(boolean z8) {
        this.f1814q.h(this.f1784M, z8);
    }

    public void setShowTimeoutMs(int i) {
        this.f1775G0 = i;
        if (g()) {
            this.f1814q.g();
        }
    }

    public void setShowVrButton(boolean z8) {
        this.f1814q.h(this.f1782L, z8);
    }

    public void setTimeBarMinUpdateInterval(int i) {
        this.f1776H0 = x0.v.i(i, 16, 1000);
    }

    public void setVrButtonListener(View.OnClickListener onClickListener) {
        ImageView imageView = this.f1782L;
        if (imageView != null) {
            imageView.setOnClickListener(onClickListener);
            j(imageView, onClickListener != null);
        }
    }

    public final void t() {
        C0082g c0082g = this.f1827x;
        c0082g.getClass();
        List list = Collections.EMPTY_LIST;
        c0082g.f1734d = list;
        C0082g c0082g2 = this.f1829y;
        c0082g2.getClass();
        c0082g2.f1734d = list;
        u0.M m8 = this.f1832z0;
        ImageView imageView = this.f1784M;
        if (m8 != null && ((O3.e) m8).o(30) && ((O3.e) this.f1832z0).o(29)) {
            Z zP = ((B0.I) this.f1832z0).P();
            W wE = e(zP, 1);
            c0082g2.f1734d = wE;
            C0093s c0093s = c0082g2.f1737g;
            u0.M m9 = c0093s.f1832z0;
            m9.getClass();
            O0.k kVarV = ((B0.I) m9).V();
            boolean zIsEmpty = wE.isEmpty();
            C0089n c0089n = c0093s.f1823v;
            if (!zIsEmpty) {
                if (c0082g2.n(kVarV)) {
                    int i = 0;
                    while (true) {
                        if (i >= wE.f1227t) {
                            break;
                        }
                        C0091p c0091p = (C0091p) wE.get(i);
                        if (c0091p.f1755a.f17250e[c0091p.f1756b]) {
                            c0089n.f1750e[1] = c0091p.f1757c;
                            break;
                        }
                        i++;
                    }
                } else {
                    c0089n.f1750e[1] = c0093s.getResources().getString(R.string.exo_track_selection_auto);
                }
            } else {
                c0089n.f1750e[1] = c0093s.getResources().getString(R.string.exo_track_selection_none);
            }
            if (this.f1814q.b(imageView)) {
                c0082g.o(e(zP, 3));
            } else {
                c0082g.o(W.f1225u);
            }
        }
        j(imageView, c0082g.a() > 0);
        C0089n c0089n2 = this.f1823v;
        j(this.f1790P, c0089n2.n(1) || c0089n2.n(0));
    }

    public void setProgressUpdateListener(InterfaceC0087l interfaceC0087l) {
    }
}
