Skip to content

Commit 8d4c45f

Browse files
author
Kowshickkarthick Subramanian
committed
Android 6.1.1 Release
* commit 'b609da9ffeee2c185b75c2c0c1b7f5fe3f0419c4': fixed typo 6.1.1 Release changes MS-4079 Fix OMID GeometryChange Add Public API for SDK Version
2 parents deccf74 + b609da9 commit 8d4c45f

File tree

6 files changed

+47
-10
lines changed

6 files changed

+47
-10
lines changed

RELEASE-NOTES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 6.1.1
2+
### New Features
3+
+ MS-4019: Added new API to get SDK Version in SDKSettings.
4+
5+
### Improvements/Bug Fixes
6+
+ MS-4079: Fixed incorrect percentageInView when OMID geometryChange event is called.
7+
18
## 6.1
29
### New Features
310
+ MS-4019: Added new API to Pause/Resume(https://wiki.xandr.com/display/sdk/Show+An+Instream+Video+Ad+on+Android) VideoAd

instreamvideo/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Project Properties
2-
version = "1.13" // Instream SDK version
2+
version = "1.14" // Instream SDK version
33

44
apply plugin: 'com.android.library'
55

@@ -10,7 +10,7 @@ android {
1010
defaultConfig {
1111
minSdkVersion 9
1212
targetSdkVersion 28
13-
versionCode 11 // An integer value that represents the version of the code, relative to other versions. Increase for each release.
13+
versionCode 12 // An integer value that represents the version of the code, relative to other versions. Increase for each release.
1414
versionName version
1515
consumerProguardFiles 'proguard-project.txt'
1616
}

instreamvideo/src/main/java/com/appnexus/opensdk/instreamvideo/VideoWebView.java

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ class VideoWebView extends WebView {
6969
private boolean adIsPlaying = false;
7070
private boolean failed = false;
7171
private VideoRequestManager manager;
72+
private static final int TOTAL_RETRY_TIMES = 10;
73+
private static final int WAIT_INTERVAL_MILLES = 300;
7274

7375
private int adDuration = 0;
7476
private String creativeId = "";
@@ -79,7 +81,6 @@ class VideoWebView extends WebView {
7981
private ANOmidAdSession omidAdSession;
8082

8183
// Using handler posts the playAd() call to the end of queue and fixes initial rendering black issue on Lollipop and below simulators.
82-
// And during resume Ad, this handler is used to retry until the parent window comes in focus else fail gracefully. Its observed parent window gets focus approx 200ms after the resume of activity.
8384
private Handler playAdHandler;
8485

8586
public VideoWebView(Context context, VideoAd owner, VideoRequestManager manager) {
@@ -461,8 +462,30 @@ public void onReceiveValue(String s) {
461462

462463

463464
protected void playAd() {
464-
adIsPlaying = true;
465-
injectJavaScript("javascript:window.playAd()");
465+
playAdHandler = new Handler();
466+
467+
Runnable runnableCode = new Runnable() {
468+
int retryTimes = 0;
469+
470+
@Override
471+
public void run() {
472+
// Play the Ad if WindowFocus is true else retry after 300ms
473+
if (hasWindowFocus()) {
474+
adIsPlaying = true;
475+
injectJavaScript("javascript:window.playAd()");
476+
} else if (retryTimes < TOTAL_RETRY_TIMES) {
477+
Clog.i(Clog.videoLogTag, "Has no focus Retrying::" + retryTimes);
478+
retryTimes++;
479+
playAdHandler.postDelayed(this, WAIT_INTERVAL_MILLES);
480+
} else {
481+
Clog.e(Clog.videoLogTag, "Failed to play Video-Ad giving up");
482+
owner.getAdDispatcher().onPlaybackError();
483+
}
484+
}
485+
};
486+
487+
// There is no delay for first playAd() call
488+
playAdHandler.post(runnableCode);
466489
}
467490

468491

@@ -473,8 +496,7 @@ protected void pauseAd(){
473496
protected void resumeAd() {
474497
// This is for resuming the playback after pause.
475498
if (adIsPlaying) {
476-
// Just need to call playAd() again for resuming the ad, there is no seperate resumeAd() function in MobileVastPlayer
477-
playAd();
499+
injectJavaScript("javascript:window.playAd()");
478500
}
479501
}
480502

sdk/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Project properties
2-
version = "6.1"
2+
version = "6.1.1"
33
group='com.appnexus.opensdk'
44

55
// Android build
@@ -9,7 +9,7 @@ android {
99
compileSdkVersion 28
1010
buildToolsVersion '29.0.0'
1111
defaultConfig {
12-
versionCode 61 // An integer value that represents the version of the code, relative to other versions. Increase for each release.
12+
versionCode 62 // An integer value that represents the version of the code, relative to other versions. Increase for each release.
1313
versionName version
1414
consumerProguardFiles 'proguard-project.txt'
1515
minSdkVersion 9

sdk/src/com/appnexus/opensdk/SDKSettings.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,12 @@ public static boolean isLocationEnabledForCreative(){
216216
return Settings.getSettings().locationEnabledForCreative;
217217
}
218218

219+
220+
/**
221+
* Returns AppNexus SDK Version
222+
*/
223+
public static String getSDKVersion(){
224+
return Settings.getSettings().sdkVersion;
225+
}
226+
219227
}

sdk/src/com/appnexus/opensdk/utils/Settings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class Settings {
4545
public boolean debug_mode = false; // This should always be false here.
4646
public String ua = null;
4747

48-
public final String sdkVersion = "6.1";
48+
public final String sdkVersion = "6.1.1";
4949

5050
public String mcc;
5151
public String mnc;

0 commit comments

Comments
 (0)