Skip to content

Commit c8d45aa

Browse files
committed
Release 2.0.0-beta4
1 parent da6d2e5 commit c8d45aa

File tree

5 files changed

+25
-11
lines changed

5 files changed

+25
-11
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ android {
99
minSdkVersion 9
1010
targetSdkVersion 23
1111
versionCode = 2000
12-
versionName = "2.0.0-beta3"
12+
versionName = "2.0.0-beta4"
1313
}
1414
buildTypes {
1515
release {

lib/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ android {
1313
minSdkVersion 9
1414
targetSdkVersion 23
1515
versionCode = 2000
16-
versionName = "2.0.0-beta3"
16+
versionName = "2.0.0-beta4"
1717

1818
setProperty("archivesBaseName", "unity-ads")
1919

lib/src/main/java/com/unity3d/ads/UnityAds.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,22 @@ public final class UnityAds {
2222
private static boolean _configurationInitialized = false;
2323
private static boolean _debugMode = false;
2424

25+
/**
26+
* An enumeration for the completion state of an ad.
27+
*/
2528
public enum FinishState {
26-
ERROR, COMPLETED, SKIPPED
29+
/**
30+
* A state that indicates that the ad did not successfully display.
31+
*/
32+
ERROR,
33+
/**
34+
* A state that indicates that the user skipped the ad.
35+
*/
36+
SKIPPED,
37+
/**
38+
* A state that indicates that the ad was played entirely.
39+
*/
40+
COMPLETED
2741
}
2842

2943
/**

lib/src/main/java/com/unity3d/ads/cache/CacheThreadHandler.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import java.util.List;
2727
import java.util.Map;
2828

29-
class CacheThreadHandler extends Handler {
29+
class CacheThreadHandler extends Handler {
3030
private WebRequest _currentRequest = null;
3131
private boolean _canceled = false;
3232
private boolean _active = false;
@@ -137,12 +137,10 @@ public void onRequestProgress(String url, long bytes, long total) {
137137
private void postProcessDownload(long startTime, String source, File targetFile, long byteCount, long totalBytes, boolean canceled, int responseCode, Map<String, List<String>> responseHeaders) {
138138
long duration = SystemClock.elapsedRealtime() - startTime;
139139

140-
if (Build.VERSION.SDK_INT < 19) {
141-
// With some old Androids the MediaPlayer cannot play the file unless it's set to readable for all
142-
boolean result = targetFile.setReadable(true, false);
143-
if (!result) {
144-
DeviceLog.debug("Unity Ads cache: could not set file readable!");
145-
}
140+
// With some old Androids the MediaPlayer cannot play the file unless it's set to readable for all
141+
boolean result = targetFile.setReadable(true, false);
142+
if (!result) {
143+
DeviceLog.debug("Unity Ads cache: could not set file readable!");
146144
}
147145

148146
if (!canceled) {

lib/src/main/java/com/unity3d/ads/video/VideoPlayerView.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ private void startVideoProgressTimer () {
2828
_videoTimer.scheduleAtFixedRate(new TimerTask() {
2929
@Override
3030
public void run() {
31+
boolean isPlaying = false;
3132
try {
33+
isPlaying = isPlaying();
3234
WebViewApp.getCurrentApp().sendEvent(WebViewEventCategory.VIDEOPLAYER, VideoPlayerEvent.PROGRESS, getCurrentPosition());
3335
}
3436
catch (IllegalStateException e) {
3537
DeviceLog.exception("Exception while sending current position to webapp", e);
36-
WebViewApp.getCurrentApp().sendEvent(WebViewEventCategory.VIDEOPLAYER, VideoPlayerEvent.ILLEGAL_STATE, VideoPlayerEvent.PROGRESS, isPlaying());
38+
WebViewApp.getCurrentApp().sendEvent(WebViewEventCategory.VIDEOPLAYER, VideoPlayerEvent.ILLEGAL_STATE, VideoPlayerEvent.PROGRESS, isPlaying);
3739
}
3840
}
3941
}, _progressEventInterval, _progressEventInterval);

0 commit comments

Comments
 (0)