WebPlayerView$TwitchClipVideoTask.smali

.class Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;
.super Landroid/os/AsyncTask;
.source "WebPlayerView.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lim/tpelyyftgw/ui/components/WebPlayerView;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "TwitchClipVideoTask"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/os/AsyncTask<",
        "Ljava/lang/Void;",
        "Ljava/lang/Void;",
        "Ljava/lang/String;",
        ">;"
    }
.end annotation


# instance fields
.field private canRetry:Z

.field private currentUrl:Ljava/lang/String;

.field private results:[Ljava/lang/String;

.field final synthetic this$0:Lim/tpelyyftgw/ui/components/WebPlayerView;

.field private videoId:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .registers 1

    return-void
.end method

.method public constructor <init>(Lim/tpelyyftgw/ui/components/WebPlayerView;Ljava/lang/String;Ljava/lang/String;)V
    .registers 4
    .param p2, "url"    # Ljava/lang/String;
    .param p3, "vid"    # Ljava/lang/String;

    .line 965
    iput-object p1, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->this$0:Lim/tpelyyftgw/ui/components/WebPlayerView;

    invoke-direct {p0}, Landroid/os/AsyncTask;-><init>()V

    .line 962
    const/4 p1, 0x1

    iput-boolean p1, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->canRetry:Z

    .line 963
    const/4 p1, 0x2

    new-array p1, p1, [Ljava/lang/String;

    iput-object p1, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->results:[Ljava/lang/String;

    .line 966
    iput-object p3, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->videoId:Ljava/lang/String;

    .line 967
    iput-object p2, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->currentUrl:Ljava/lang/String;

    .line 968
    return-void
.end method


# virtual methods
.method protected bridge synthetic doInBackground([Ljava/lang/Object;)Ljava/lang/Object;
    .registers 2

    .line 958
    check-cast p1, [Ljava/lang/Void;

    invoke-virtual {p0, p1}, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->doInBackground([Ljava/lang/Void;)Ljava/lang/String;

    move-result-object p1

    return-object p1
.end method

.method protected varargs doInBackground([Ljava/lang/Void;)Ljava/lang/String;
    .registers 13
    .param p1, "voids"    # [Ljava/lang/Void;

    .line 971
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->this$0:Lim/tpelyyftgw/ui/components/WebPlayerView;

    iget-object v1, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->currentUrl:Ljava/lang/String;

    const/4 v2, 0x0

    const/4 v3, 0x0

    invoke-virtual {v0, p0, v1, v2, v3}, Lim/tpelyyftgw/ui/components/WebPlayerView;->downloadUrlContent(Landroid/os/AsyncTask;Ljava/lang/String;Ljava/util/HashMap;Z)Ljava/lang/String;

    move-result-object v0

    .line 972
    .local v0, "playerCode":Ljava/lang/String;
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->isCancelled()Z

    move-result v1

    if-eqz v1, :cond_11

    .line 973
    return-object v2

    .line 976
    :cond_11
    :try_start_11
    invoke-static {}, Lim/tpelyyftgw/ui/components/WebPlayerView;->access$2300()Ljava/util/regex/Pattern;

    move-result-object v1

    invoke-virtual {v1, v0}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;

    move-result-object v1

    .line 977
    .local v1, "filelist":Ljava/util/regex/Matcher;
    invoke-virtual {v1}, Ljava/util/regex/Matcher;->find()Z

    move-result v4

    if-eqz v4, :cond_43

    .line 978
    const/4 v4, 0x1

    invoke-virtual {v1, v4}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;

    move-result-object v5

    .line 979
    .local v5, "jsonCode":Ljava/lang/String;
    new-instance v6, Lorg/json/JSONObject;

    invoke-direct {v6, v5}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 980
    .local v6, "json":Lorg/json/JSONObject;
    const-string v7, "quality_options"

    invoke-virtual {v6, v7}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v7

    .line 981
    .local v7, "array":Lorg/json/JSONArray;
    invoke-virtual {v7, v3}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v8

    .line 982
    .local v8, "obj":Lorg/json/JSONObject;
    iget-object v9, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->results:[Ljava/lang/String;

    const-string v10, "source"

    invoke-virtual {v8, v10}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    aput-object v10, v9, v3

    .line 983
    iget-object v9, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->results:[Ljava/lang/String;

    const-string v10, "other"

    aput-object v10, v9, v4
    :try_end_43
    .catch Ljava/lang/Exception; {:try_start_11 .. :try_end_43} :catch_44

    .line 987
    .end local v1    # "filelist":Ljava/util/regex/Matcher;
    .end local v5    # "jsonCode":Ljava/lang/String;
    .end local v6    # "json":Lorg/json/JSONObject;
    .end local v7    # "array":Lorg/json/JSONArray;
    .end local v8    # "obj":Lorg/json/JSONObject;
    :cond_43
    goto :goto_48

    .line 985
    :catch_44
    move-exception v1

    .line 986
    .local v1, "e":Ljava/lang/Exception;
    invoke-static {v1}, Lim/tpelyyftgw/messenger/FileLog;->e(Ljava/lang/Throwable;)V

    .line 988
    .end local v1    # "e":Ljava/lang/Exception;
    :goto_48
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->isCancelled()Z

    move-result v1

    if-eqz v1, :cond_4f

    goto :goto_53

    :cond_4f
    iget-object v1, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->results:[Ljava/lang/String;

    aget-object v2, v1, v3

    :goto_53
    return-object v2
.end method

.method protected bridge synthetic onPostExecute(Ljava/lang/Object;)V
    .registers 2

    .line 958
    check-cast p1, Ljava/lang/String;

    invoke-virtual {p0, p1}, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->onPostExecute(Ljava/lang/String;)V

    return-void
.end method

.method protected onPostExecute(Ljava/lang/String;)V
    .registers 5
    .param p1, "result"    # Ljava/lang/String;

    .line 993
    if-eqz p1, :cond_33

    .line 994
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->this$0:Lim/tpelyyftgw/ui/components/WebPlayerView;

    const/4 v1, 0x1

    invoke-static {v0, v1}, Lim/tpelyyftgw/ui/components/WebPlayerView;->access$1302(Lim/tpelyyftgw/ui/components/WebPlayerView;Z)Z

    .line 995
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->this$0:Lim/tpelyyftgw/ui/components/WebPlayerView;

    invoke-static {v0, p1}, Lim/tpelyyftgw/ui/components/WebPlayerView;->access$1402(Lim/tpelyyftgw/ui/components/WebPlayerView;Ljava/lang/String;)Ljava/lang/String;

    .line 996
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->this$0:Lim/tpelyyftgw/ui/components/WebPlayerView;

    iget-object v2, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->results:[Ljava/lang/String;

    aget-object v2, v2, v1

    invoke-static {v0, v2}, Lim/tpelyyftgw/ui/components/WebPlayerView;->access$1502(Lim/tpelyyftgw/ui/components/WebPlayerView;Ljava/lang/String;)Ljava/lang/String;

    .line 997
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->this$0:Lim/tpelyyftgw/ui/components/WebPlayerView;

    invoke-static {v0}, Lim/tpelyyftgw/ui/components/WebPlayerView;->access$1700(Lim/tpelyyftgw/ui/components/WebPlayerView;)Z

    move-result v0

    if-eqz v0, :cond_23

    .line 998
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->this$0:Lim/tpelyyftgw/ui/components/WebPlayerView;

    invoke-static {v0}, Lim/tpelyyftgw/ui/components/WebPlayerView;->access$1800(Lim/tpelyyftgw/ui/components/WebPlayerView;)V

    .line 1000
    :cond_23
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->this$0:Lim/tpelyyftgw/ui/components/WebPlayerView;

    const/4 v2, 0x0

    invoke-static {v0, v2, v1}, Lim/tpelyyftgw/ui/components/WebPlayerView;->access$1900(Lim/tpelyyftgw/ui/components/WebPlayerView;ZZ)V

    .line 1001
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->this$0:Lim/tpelyyftgw/ui/components/WebPlayerView;

    invoke-static {v0}, Lim/tpelyyftgw/ui/components/WebPlayerView;->access$100(Lim/tpelyyftgw/ui/components/WebPlayerView;)Lim/tpelyyftgw/ui/components/WebPlayerView$ControlsView;

    move-result-object v0

    invoke-virtual {v0, v1, v1}, Lim/tpelyyftgw/ui/components/WebPlayerView$ControlsView;->show(ZZ)V

    goto :goto_3e

    .line 1002
    :cond_33
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->isCancelled()Z

    move-result v0

    if-nez v0, :cond_3e

    .line 1003
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/WebPlayerView$TwitchClipVideoTask;->this$0:Lim/tpelyyftgw/ui/components/WebPlayerView;

    invoke-static {v0}, Lim/tpelyyftgw/ui/components/WebPlayerView;->access$2000(Lim/tpelyyftgw/ui/components/WebPlayerView;)V

    .line 1005
    :cond_3e
    :goto_3e
    return-void
.end method