- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
220 lines
6.9 KiB
Java
220 lines
6.9 KiB
Java
package com.fyber.inneractive.sdk.player.controller;
|
|
|
|
import android.content.Context;
|
|
import android.graphics.Bitmap;
|
|
import android.view.Surface;
|
|
import com.fyber.inneractive.sdk.util.IAlog;
|
|
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class a extends i {
|
|
public com.fyber.inneractive.sdk.player.mediaplayer.a p;
|
|
public int q;
|
|
public final int r;
|
|
public int s;
|
|
public boolean t;
|
|
|
|
public a(Context context) {
|
|
super(context);
|
|
this.q = 0;
|
|
this.r = 2;
|
|
this.s = 0;
|
|
this.t = false;
|
|
IAlog.a("Creating IAAndroidMediaPlayerController", new Object[0]);
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final boolean a() {
|
|
return false;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final void d(boolean z) {
|
|
c(false);
|
|
if (i() || !this.n) {
|
|
this.n = z;
|
|
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
|
|
if (aVar != null) {
|
|
IAlog.a("%s unmute", aVar.c());
|
|
aVar.d = false;
|
|
if (aVar.b()) {
|
|
aVar.a(new com.fyber.inneractive.sdk.player.mediaplayer.d(aVar));
|
|
} else {
|
|
IAlog.a("%s unmute called when player is not ready!", aVar.c());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final Bitmap e() {
|
|
return null;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final String f() {
|
|
return "media";
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final void a(Surface surface) {
|
|
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
|
|
if (aVar != null) {
|
|
aVar.setSurface(surface);
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final void b() {
|
|
ScheduledThreadPoolExecutor scheduledThreadPoolExecutor;
|
|
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
|
|
if (aVar != null) {
|
|
aVar.reset();
|
|
this.p.release();
|
|
this.p = null;
|
|
}
|
|
IAlog.a("%sdestroy started", IAlog.a(this));
|
|
com.fyber.inneractive.sdk.player.d dVar = this.h;
|
|
if (dVar != null && (scheduledThreadPoolExecutor = dVar.b) != null) {
|
|
scheduledThreadPoolExecutor.shutdownNow();
|
|
dVar.b = null;
|
|
}
|
|
this.h = null;
|
|
this.i.removeCallbacksAndMessages(null);
|
|
this.b.clear();
|
|
this.f = null;
|
|
this.g = true;
|
|
IAlog.a("%sdestroy finished", IAlog.a(this));
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final int c() {
|
|
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
|
|
if (aVar != null) {
|
|
return aVar.getCurrentPosition();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final int g() {
|
|
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
|
|
if (aVar != null) {
|
|
return aVar.t;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final int h() {
|
|
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
|
|
if (aVar != null) {
|
|
return aVar.s;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final boolean i() {
|
|
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
|
|
if (aVar != null) {
|
|
return aVar.d;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final void k() {
|
|
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
|
|
if (aVar != null) {
|
|
aVar.pause();
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final void l() {
|
|
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
|
|
if (aVar != null) {
|
|
aVar.start();
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final void a(boolean z) {
|
|
if (this.p == null) {
|
|
IAlog.a("MediaPlayerController: creating media player", new Object[0]);
|
|
this.p = new com.fyber.inneractive.sdk.player.mediaplayer.a(this.a, this, this.i);
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final void a(String str, int i) {
|
|
this.p.a(str);
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final void a(int i) {
|
|
super.a(i);
|
|
if (i >= d()) {
|
|
a(com.fyber.inneractive.sdk.player.enums.b.Completed);
|
|
} else if (i == this.q) {
|
|
IAlog.a("%sVideo is stuck! Progress doesn't change", IAlog.a(this));
|
|
int i2 = this.s + 1;
|
|
this.s = i2;
|
|
if (i2 == this.r) {
|
|
a(com.fyber.inneractive.sdk.player.enums.b.Buffering);
|
|
this.t = true;
|
|
}
|
|
} else if (this.t) {
|
|
IAlog.a("%sVideo progress was stuck! but now it goes forward. Remove buffering state", IAlog.a(this));
|
|
a(com.fyber.inneractive.sdk.player.enums.b.Playing);
|
|
this.s = 0;
|
|
this.t = false;
|
|
}
|
|
this.q = i;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final int d() {
|
|
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
|
|
if (aVar != null) {
|
|
return aVar.r;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final void b(boolean z) {
|
|
c(true);
|
|
if (i() && this.n) {
|
|
return;
|
|
}
|
|
this.n = z;
|
|
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
|
|
if (aVar != null) {
|
|
aVar.e();
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.controller.i
|
|
public final void b(int i) {
|
|
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
|
|
if (aVar != null) {
|
|
IAlog.a("%s seek to called with = %d mPlayAfterSeek = %s", aVar.c(), Integer.valueOf(i), Boolean.TRUE);
|
|
if (!aVar.b()) {
|
|
IAlog.a("%s seek called when player is not ready!", aVar.c());
|
|
return;
|
|
}
|
|
com.fyber.inneractive.sdk.player.enums.b bVar = aVar.b;
|
|
com.fyber.inneractive.sdk.player.enums.b bVar2 = com.fyber.inneractive.sdk.player.enums.b.Seeking;
|
|
if (bVar == bVar2) {
|
|
IAlog.a("%s seek called when player is already seeking!", aVar.c());
|
|
return;
|
|
}
|
|
aVar.a(bVar2);
|
|
aVar.c = true;
|
|
aVar.a(new com.fyber.inneractive.sdk.player.mediaplayer.c(aVar, i));
|
|
}
|
|
}
|
|
}
|