package com.vinfast.companion.core.utils.video.selfplayer;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes15.dex */
@kotlin.Metadata(d1 = {"\u0000>\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\b\u0018\u0000 \u001b2\b\u0012\u0004\u0012\u00020\u00020\u0001:\u0001\u001cB\u0007¢\u0006\u0004\b\u0003\u0010\u0004J\u000f\u0010\u0006\u001a\u00020\u0005H\u0002¢\u0006\u0004\b\u0006\u0010\u0004J\u000f\u0010\u0007\u001a\u00020\u0005H\u0002¢\u0006\u0004\b\u0007\u0010\u0004J\u000f\u0010\t\u001a\u00020\bH\u0016¢\u0006\u0004\b\t\u0010\nJ\u000f\u0010\f\u001a\u00020\u000bH\u0016¢\u0006\u0004\b\f\u0010\rJ!\u0010\u0012\u001a\u00020\u00052\u0006\u0010\u000f\u001a\u00020\u000e2\b\u0010\u0011\u001a\u0004\u0018\u00010\u0010H\u0016¢\u0006\u0004\b\u0012\u0010\u0013J\u000f\u0010\u0014\u001a\u00020\u0005H\u0016¢\u0006\u0004\b\u0014\u0010\u0004R\u001b\u0010\u001a\u001a\u00020\u00158BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0016\u0010\u0017\u001a\u0004\b\u0018\u0010\u0019¨\u0006\u001d"}, d2 = {"Lcom/vinfast/companion/core/utils/video/selfplayer/VideoPlayerFragment;", "Lcom/vinfast/companion/core/base/fragment/BaseFragment;", "Lcom/vinfast/companion/core/databinding/FragmentSelfVideoPlayerBinding;", "<init>", "()V", "", "a2", "Z1", "Lcom/vinfast/companion/core/base/BaseViewModel;", "U1", "()Lcom/vinfast/companion/core/base/BaseViewModel;", "Lcom/vinfast/companion/core/base/fragment/ToolbarConfiguration;", "T0", "()Lcom/vinfast/companion/core/base/fragment/ToolbarConfiguration;", "Landroid/view/View;", "view", "Landroid/os/Bundle;", "savedInstanceState", "y1", "(Landroid/view/View;Landroid/os/Bundle;)V", "onDestroy", "Lcom/vinfast/companion/core/utils/video/VideoViewModel;", "x", "Lkotlin/Lazy;", "Y1", "()Lcom/vinfast/companion/core/utils/video/VideoViewModel;", "viewModel", "y", "Companion", "core_release"}, k = 1, mv = {2, 2, 0}, xi = 48)
@kotlin.jvm.internal.SourceDebugExtension
public final class VideoPlayerFragment extends com.vinfast.companion.core.base.fragment.BaseFragment<com.vinfast.companion.core.databinding.FragmentSelfVideoPlayerBinding> {

    /* JADX INFO: renamed from: x, reason: from kotlin metadata */
    private final kotlin.Lazy viewModel;

    public VideoPlayerFragment() {
        super(new kotlin.jvm.functions.Function1() { // from class: com.vinfast.companion.core.utils.video.selfplayer.b
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.companion.core.utils.video.selfplayer.VideoPlayerFragment.X1((android.view.LayoutInflater) obj);
            }
        });
        final kotlin.jvm.functions.Function0 function0 = null;
        this.viewModel = androidx.fragment.app.FragmentViewModelLazyKt.c(this, kotlin.jvm.internal.Reflection.b(com.vinfast.companion.core.utils.video.VideoViewModel.class), new kotlin.jvm.functions.Function0<androidx.lifecycle.ViewModelStore>() { // from class: com.vinfast.companion.core.utils.video.selfplayer.VideoPlayerFragment$special$$inlined$activityViewModels$default$1
            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            {
                super(0);
            }

            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final androidx.lifecycle.ViewModelStore invoke() {
                return this.requireActivity().getViewModelStore();
            }
        }, new kotlin.jvm.functions.Function0<androidx.lifecycle.viewmodel.CreationExtras>() { // from class: com.vinfast.companion.core.utils.video.selfplayer.VideoPlayerFragment$special$$inlined$activityViewModels$default$2
            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            {
                super(0);
            }

            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final androidx.lifecycle.viewmodel.CreationExtras invoke() {
                androidx.lifecycle.viewmodel.CreationExtras creationExtras;
                kotlin.jvm.functions.Function0 function1 = function0;
                return (function1 == null || (creationExtras = (androidx.lifecycle.viewmodel.CreationExtras) function1.invoke()) == null) ? this.requireActivity().getDefaultViewModelCreationExtras() : creationExtras;
            }
        }, new kotlin.jvm.functions.Function0<androidx.lifecycle.ViewModelProvider.Factory>() { // from class: com.vinfast.companion.core.utils.video.selfplayer.VideoPlayerFragment$special$$inlined$activityViewModels$default$3
            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            {
                super(0);
            }

            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final androidx.lifecycle.ViewModelProvider.Factory invoke() {
                return this.requireActivity().getDefaultViewModelProviderFactory();
            }
        });
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final com.vinfast.companion.core.databinding.FragmentSelfVideoPlayerBinding X1(android.view.LayoutInflater layoutInflater) {
        kotlin.jvm.internal.Intrinsics.l(layoutInflater, "it");
        com.vinfast.companion.core.databinding.FragmentSelfVideoPlayerBinding fragmentSelfVideoPlayerBindingC = com.vinfast.companion.core.databinding.FragmentSelfVideoPlayerBinding.c(layoutInflater);
        kotlin.jvm.internal.Intrinsics.k(fragmentSelfVideoPlayerBindingC, "inflate(...)");
        return fragmentSelfVideoPlayerBindingC;
    }

    private final com.vinfast.companion.core.utils.video.VideoViewModel Y1() {
        return (com.vinfast.companion.core.utils.video.VideoViewModel) this.viewModel.getValue();
    }

    private final void Z1() {
        com.vinfast.companion.core.base.ui.widget.CommonToolbar commonToolbarS0;
        android.os.Bundle extras = requireActivity().getIntent().getExtras();
        java.lang.String string = extras != null ? extras.getString("video_url") : null;
        android.os.Bundle extras2 = requireActivity().getIntent().getExtras();
        java.lang.String string2 = extras2 != null ? extras2.getString("title_value") : null;
        if (string == null || string.length() == 0) {
            requireActivity().finish();
        } else {
            com.vinfast.companion.core.utils.video.VideoViewModel.h0(Y1(), kotlin.collections.CollectionsKt.h(new com.vinfast.companion.core.utils.video.model.Video[]{new com.vinfast.companion.core.utils.video.model.Video(string)}), false, 2, null);
        }
        if (string2 == null || (commonToolbarS0 = com.vinfast.companion.core.base.fragment.BaseFragment.S0(this, null, 1, null)) == null) {
            return;
        }
        commonToolbarS0.setTitleText(string2);
    }

    private final void a2() {
        com.vinfast.companion.core.utils.video.ViewVideoPlayer viewVideoPlayer = ((com.vinfast.companion.core.databinding.FragmentSelfVideoPlayerBinding) T1()).b;
        kotlin.jvm.internal.Intrinsics.k(viewVideoPlayer, "viewPlayer");
        com.vinfast.companion.core.utils.video.ViewVideoPlayer.setLifeCycle$default(viewVideoPlayer, this, Y1(), 0, new kotlin.jvm.functions.Function0() { // from class: com.vinfast.companion.core.utils.video.selfplayer.c
            public final java.lang.Object invoke() {
                return com.vinfast.companion.core.utils.video.selfplayer.VideoPlayerFragment.b2(this.a);
            }
        }, 4, null);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit b2(com.vinfast.companion.core.utils.video.selfplayer.VideoPlayerFragment videoPlayerFragment) {
        androidx.navigation.fragment.FragmentKt.a(videoPlayerFragment).L(com.vinfast.companion.core.R.id.videoFullScreenFragment);
        return kotlin.Unit.a;
    }

    @Override // com.vinfast.companion.core.base.fragment.BaseFragment
    public com.vinfast.companion.core.base.fragment.ToolbarConfiguration T0() {
        return new com.vinfast.companion.core.base.fragment.ToolbarConfiguration.Builder().r(true).t(false).a();
    }

    @Override // com.vinfast.companion.core.base.fragment.BaseFragment
    public com.vinfast.companion.core.base.BaseViewModel U1() {
        return Y1();
    }

    @Override // com.vinfast.companion.core.base.fragment.HiltFragment
    public void onDestroy() {
        java.lang.Boolean bool = (java.lang.Boolean) Y1().getIsChangeModePlayer().f();
        if (!(bool != null ? bool.booleanValue() : false)) {
            Y1().Q(requireActivity().getRequestedOrientation());
        }
        super.onDestroy();
    }

    @Override // com.vinfast.companion.core.base.fragment.BaseFragment
    public void y1(android.view.View view, android.os.Bundle savedInstanceState) {
        kotlin.jvm.internal.Intrinsics.l(view, "view");
        a2();
        Z1();
    }
}
