正在查看: Biko v2.0.23 应用的 PlayerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Biko v2.0.23 应用的 PlayerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package app.callpe.ui.misc;
import android.app.Activity;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import app.callpe.common.utils.extensions.ActivityExtKt;
import app.callpe.databinding.ActivityPlayerBinding;
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.YouTubePlayer;
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.listeners.AbstractYouTubePlayerListener;
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.options.IFramePlayerOptions;
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
@Metadata(d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0012\u0010\r\u001a\u00020\u000e2\b\u0010\u000f\u001a\u0004\u0018\u00010\u0010H\u0014J\b\u0010\u0011\u001a\u00020\u000eH\u0014R\u001a\u0010\u0003\u001a\u00020\u0004X\u0086.¢\u0006\u000e\n\u0000\u001a\u0004\b\u0005\u0010\u0006\"\u0004\b\u0007\u0010\bR\u0010\u0010\t\u001a\u0004\u0018\u00010\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u000b\u001a\u0004\u0018\u00010\fX\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u0012"}, d2 = {"Lapp/callpe/ui/misc/PlayerActivity;", "Landroidx/appcompat/app/AppCompatActivity;", "()V", "binding", "Lapp/callpe/databinding/ActivityPlayerBinding;", "getBinding", "()Lapp/callpe/databinding/ActivityPlayerBinding;", "setBinding", "(Lapp/callpe/databinding/ActivityPlayerBinding;)V", "videoId", "", "youtubePlayer", "Lcom/pierfrancescosoffritti/androidyoutubeplayer/core/player/views/YouTubePlayerView;", "onCreate", "", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "app_bikoRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
public final class PlayerActivity extends AppCompatActivity {
public ActivityPlayerBinding binding;
private String videoId;
private YouTubePlayerView youtubePlayer;
public final ActivityPlayerBinding getBinding() {
ActivityPlayerBinding activityPlayerBinding = this.binding;
if (activityPlayerBinding != null) {
return activityPlayerBinding;
}
Intrinsics.throwUninitializedPropertyAccessException("binding");
return null;
}
public final void setBinding(ActivityPlayerBinding activityPlayerBinding) {
Intrinsics.checkNotNullParameter(activityPlayerBinding, "<set-?>");
this.binding = activityPlayerBinding;
}
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityPlayerBinding inflate = ActivityPlayerBinding.inflate(getLayoutInflater());
Intrinsics.checkNotNullExpressionValue(inflate, "inflate(layoutInflater)");
setBinding(inflate);
setContentView(getBinding().getRoot());
String stringExtra = getIntent().getStringExtra("videoId");
this.videoId = stringExtra;
String str = stringExtra;
if (str == null || str.length() == 0) {
finish();
}
this.youtubePlayer = getBinding().youtubePlayerView;
try {
IFramePlayerOptions build = new IFramePlayerOptions.Builder().controls(1).build();
YouTubePlayerView youTubePlayerView = this.youtubePlayer;
if (youTubePlayerView != null) {
youTubePlayerView.setEnableAutomaticInitialization(false);
}
YouTubePlayerView youTubePlayerView2 = this.youtubePlayer;
if (youTubePlayerView2 != null) {
youTubePlayerView2.initialize(new AbstractYouTubePlayerListener() {
public void onReady(YouTubePlayer youTubePlayer) {
String str2;
Intrinsics.checkNotNullParameter(youTubePlayer, "youTubePlayer");
str2 = PlayerActivity.this.videoId;
if (str2 != null) {
youTubePlayer.loadVideo(str2, 0.0f);
}
}
}, true, build);
}
} catch (Exception e) {
Activity activity = (Activity) this;
String message = e.getMessage();
if (message == null) {
message = "";
}
ActivityExtKt.toast(activity, message);
finish();
}
}
protected void onDestroy() {
super.onDestroy();
YouTubePlayerView youTubePlayerView = this.youtubePlayer;
if (youTubePlayerView != null) {
youTubePlayerView.release();
}
}
}