柬埔寨通 v6.1.5版本的 MD5 值为:9b68581ac30883219d6a25858a099d6b
以下内容为反编译后的 MainActivity.java 源代码,内容仅作参考
package net.duohuo.magappx;
import android.app.ActionBar;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import butterknife.BindView;
import butterknife.OnClick;
import com.aliyun.player.IPlayer;
import com.aliyun.player.aliyunplayer.util.AliyunScreenMode;
import com.aliyun.player.aliyunplayer.view.tipsview.TipsView;
import com.aliyun.player.aliyunplayer.widget.MagVideoView;
import com.aliyun.player.source.UrlSource;
import com.jianpuzhaitong.forum.R;
import com.uc.crashsdk.export.LogType;
import net.duohuo.core.util.IUtil;
import net.duohuo.core.util.LogUtil;
import net.duohuo.magappx.common.base.MagBaseActivity;
public class MainActivity extends MagBaseActivity {
@BindView(R.id.blank_for_statue)
View blankForStatueV;
private boolean portrait;
@BindView(R.id.videoview)
MagVideoView videoView;
@BindView(R.id.videoview_box)
ViewGroup videoviewBoxV;
private final String videoPath = "http://vfx.mtime.cn/Video/2019/03/09/mp4/190309153658147087.mp4";
private final String pic = "https://seopic.699pic.com/photo/50121/4224.jpg_wh1200.jpg";
private UrlSource urlSource = new UrlSource();
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.activity_test);
this.blankForStatueV.setBackgroundColor(-16777216);
if (Build.VERSION.SDK_INT >= 23) {
getWindow().getDecorView().setSystemUiVisibility(LogType.UNEXP_ANR);
}
setSwipeBackEnable(false);
this.videoView.setViewGroup(this.videoviewBoxV);
this.videoView.getmOrientationWatchDog().stopWatch();
ViewGroup.LayoutParams layoutParams = this.videoviewBoxV.getLayoutParams();
layoutParams.width = IUtil.getDisplayWidth();
layoutParams.height = (IUtil.getDisplayWidth() * 9) / 16;
this.videoviewBoxV.setLayoutParams(layoutParams);
init();
}
public void init() {
this.videoView.setAutoPlay(true);
this.videoView.setScaleMode(IPlayer.ScaleMode.SCALE_ASPECT_FIT);
this.videoView.setCoverUri("https://seopic.699pic.com/photo/50121/4224.jpg_wh1200.jpg");
this.urlSource.setUri("http://vfx.mtime.cn/Video/2019/03/09/mp4/190309153658147087.mp4");
this.videoView.setLocalSource(this.urlSource);
this.videoView.setShowReplay(true);
this.videoView.setOnTipClickListener(new TipsView.OnTipClickListener() {
@Override
public void onContinuePlay() {
}
@Override
public void onExit() {
}
@Override
public void onRefreshSts() {
}
@Override
public void onStopPlay() {
}
@Override
public void onWait() {
}
@Override
public void onRetryPlay(int i) {
MainActivity.this.init();
}
@Override
public void onReplay() {
MainActivity.this.videoView.rePlay();
}
});
}
@OnClick({R.id.tts_play})
public void ttsPlayClick() {
enterPictureInPictureMode();
}
@Override
public void onPictureInPictureModeChanged(boolean z, Configuration configuration) {
super.onPictureInPictureModeChanged(z, configuration);
}
@Override
public void onResume() {
super.onResume();
this.videoView.onResume();
if (isInPictureInPictureMode()) {
LogUtil.i("xsx", "进入画中画");
findViewById(R.id.tts_play).setVisibility(8);
this.blankForStatueV.setVisibility(8);
} else {
LogUtil.i("xsx", "退出画中画");
findViewById(R.id.tts_play).setVisibility(0);
}
}
@Override
public boolean onKeyDown(int i, KeyEvent keyEvent) {
MagVideoView magVideoView = this.videoView;
if (magVideoView == null || magVideoView.onKeyDown(i, keyEvent)) {
return super.onKeyDown(i, keyEvent);
}
return false;
}
@Override
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
boolean z = configuration.orientation == 1;
this.portrait = z;
this.blankForStatueV.setVisibility(z ? 0 : 8);
tryFullScreen(!this.portrait);
videoModeChange(!this.portrait);
}
private void tryFullScreen(boolean z) {
ActionBar actionBar = getActionBar();
if (actionBar != null) {
if (z) {
actionBar.hide();
} else {
actionBar.show();
}
}
setFullScreen(z);
}
private void setFullScreen(boolean z) {
WindowManager.LayoutParams attributes = getWindow().getAttributes();
if (z) {
attributes.flags |= 1024;
getWindow().setAttributes(attributes);
getWindow().addFlags(512);
} else {
attributes.flags &= -1025;
getWindow().setAttributes(attributes);
getWindow().clearFlags(512);
}
}
@Override
public void onBackPressed() {
MagVideoView magVideoView = this.videoView;
if (magVideoView != null) {
if (magVideoView.getmCurrentScreenMode() == AliyunScreenMode.Full) {
this.videoView.changedToPortrait(true);
return;
} else {
finish();
return;
}
}
finish();
}
@Override
public void onDestroy() {
super.onDestroy();
this.videoView.onDestroy();
}
}