package com.tencent.mm.plugin.story.ui.view.gallery;

import a.l;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.story.model.d.i;
import com.tencent.mm.pluginsdk.ui.h.b;
import com.tencent.mm.pluginsdk.ui.tools.e.e;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.al;
import com.tencent.mm.sdk.platformtools.bo;

@l(dWo = {1, 1, 13}, dWp = {"\u0000\u001b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\t*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J\u0018\u0010\u0004\u001a\u00020\u00032\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\u0006H\u0016J\u0018\u0010\b\u001a\u00020\u00032\u0006\u0010\t\u001a\u00020\u00062\u0006\u0010\n\u001a\u00020\u0006H\u0016J\u0018\u0010\u000b\u001a\u00020\u00062\u0006\u0010\f\u001a\u00020\u00062\u0006\u0010\r\u001a\u00020\u0006H\u0016J\b\u0010\u000e\u001a\u00020\u0003H\u0016¨\u0006\u000f"}, dWq = {"com/tencent/mm/plugin/story/ui/view/gallery/StoryVideoView$playLocalVideo$1", "Lcom/tencent/mm/pluginsdk/ui/tools/IVideoView$IVideoCallback;", "onCompletion", "", "onError", "what", "", "extra", "onGetVideoSize", "width", "height", "onPlayTime", "playTime", "videoTime", "onPrepared", "plugin-story_release"})
public final class StoryVideoView$b implements com.tencent.mm.pluginsdk.ui.tools.e.a {
    final /* synthetic */ StoryVideoView sqJ;

    @l(dWo = {1, 1, 13}, dWp = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, dWq = {"<anonymous>", "", "onTextureUpdate"})
    static final class a implements e {
        final /* synthetic */ StoryVideoView$b sqK;

        a(StoryVideoView$b storyVideoView$b) {
            this.sqK = storyVideoView$b;
        }

        public final void bQL() {
            AppMethodBeat.i(110909);
            this.sqK.sqJ.setFirstPlayWaitTime(bo.az(StoryVideoView.g(this.sqK.sqJ)));
            al.n((Runnable) new 1(this), 50);
            AppMethodBeat.o(110909);
        }
    }

    StoryVideoView$b(StoryVideoView storyVideoView) {
        this.sqJ = storyVideoView;
    }

    public final void pL() {
        AppMethodBeat.i(110910);
        String a = StoryVideoView.a(this.sqJ);
        StringBuilder append = new StringBuilder("localVideo onPrepared, isLocalVideoPause:").append(StoryVideoView.b(this.sqJ)).append(", isFakeVideo:");
        i c = StoryVideoView.c(this.sqJ);
        ab.i(a, append.append(c != null ? Boolean.valueOf(c.cze()) : null).append(", fakeStartTime:").append(StoryVideoView.d(this.sqJ)).append(", fakeEndTime:").append(StoryVideoView.e(this.sqJ)).toString());
        if (!StoryVideoView.b(this.sqJ)) {
            c = StoryVideoView.c(this.sqJ);
            if (c == null || !c.cze() || StoryVideoView.d(this.sqJ) <= 0) {
                StoryVideoView.f(this.sqJ).start();
            } else {
                StoryVideoView.f(this.sqJ).d((double) StoryVideoView.d(this.sqJ), true);
            }
            StoryVideoView.f(this.sqJ).setOneTimeVideoTextureUpdateCallback((e) new a(this));
        }
        AppMethodBeat.o(110910);
    }

    public final void EA() {
        AppMethodBeat.i(110911);
        String a = StoryVideoView.a(this.sqJ);
        StringBuilder stringBuilder = new StringBuilder("localVideo onCompleted, isFakeVideo:");
        i c = StoryVideoView.c(this.sqJ);
        ab.i(a, stringBuilder.append(c != null ? Boolean.valueOf(c.cze()) : null).append(", fakeStartTime:").append(StoryVideoView.d(this.sqJ)).toString());
        c = StoryVideoView.c(this.sqJ);
        if (c == null || !c.cze() || StoryVideoView.d(this.sqJ) <= 0) {
            StoryVideoView.f(this.sqJ).d(0.0d, true);
        } else {
            StoryVideoView.f(this.sqJ).d((double) StoryVideoView.d(this.sqJ), true);
        }
        b i = StoryVideoView.i(this.sqJ);
        if (i != null) {
            i.cq(this.sqJ.getSessionId(), StoryVideoView.j(this.sqJ));
            AppMethodBeat.o(110911);
            return;
        }
        AppMethodBeat.o(110911);
    }

    public final int dG(int i, int i2) {
        AppMethodBeat.i(110912);
        i c = StoryVideoView.c(this.sqJ);
        if (c != null && c.cze() && StoryVideoView.e(this.sqJ) > 0 && ((long) i) >= StoryVideoView.e(this.sqJ)) {
            ab.i(StoryVideoView.a(this.sqJ), "fakeVideo exceed endTime, playTime:" + i + ", fakeEndTime:" + StoryVideoView.e(this.sqJ) + ", fakeStartTime:" + StoryVideoView.d(this.sqJ));
            if (StoryVideoView.d(this.sqJ) > 0) {
                StoryVideoView.f(this.sqJ).d((double) StoryVideoView.d(this.sqJ), true);
            } else {
                StoryVideoView.f(this.sqJ).d(0.0d, true);
            }
        }
        AppMethodBeat.o(110912);
        return 0;
    }

    public final void dH(int i, int i2) {
    }

    public final void onError(int i, int i2) {
    }
}
