Skip to content

Commit 98540af

Browse files
committed
Handle some video playback error edge cases a bit better
1 parent 658c93e commit 98540af

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

android/sources/src/com/unity3d/ads/android/video/UnityAdsVideoPlayView.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -585,16 +585,18 @@ private class VideoStateChecker extends TimerTask {
585585

586586
@Override
587587
public void run () {
588-
if (_videoView == null || _timeLeftInSecondsText == null)
589-
this.cancel();
590-
588+
if (_videoView == null || _timeLeftInSecondsText == null) {
589+
purgeVideoPausedTimer();
590+
return;
591+
}
592+
591593
PowerManager pm = (PowerManager)getContext().getSystemService(Context.POWER_SERVICE);
592594
if (!pm.isScreenOn()) {
593595
pauseVideo();
594596
}
595-
597+
596598
_oldPos = _curPos;
597-
599+
598600
try {
599601
_curPos = Float.valueOf(_videoView.getCurrentPosition());
600602
}

0 commit comments

Comments
 (0)