Skip to content

Commit

Permalink
v2.5.0 (#147)
Browse files Browse the repository at this point in the history
### Improvements
 - Releasing process involving artifactory (#141)
 - MuxCore pulled from Maven instead of in bundled jar (#143)
 - Support for overriding the beacon domain (#138)
 - Javadoc coverage for public API (#142)
 - For API version 30+ use context.getDisplay instead of WindowManager. (#145)

### Fixes
 - Removed VideoComponent listener and now capturing firstFrameRendered … (#144)
 - Added conversion from physical px to dpx on setScreen size. (#146)
 -  MuxCore:
     - Fix customer data null pointer exception
     - Fixed key name in setMuxEmbed function
     - Handle case where player size is larger than physical screen, treat as full-screen


Co-authored-by: Tomislav Kordic <32546640+tomkordic@users.noreply.github.com>
Co-authored-by: nbirkenshaw-mux <86244091+nbirkenshaw-mux@users.noreply.github.com>
Co-authored-by: Scott Kidder <skidder@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 24, 2021
1 parent 29c9940 commit 6bcdd61
Show file tree
Hide file tree
Showing 32 changed files with 1,006 additions and 91 deletions.
15 changes: 15 additions & 0 deletions .buildkite/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This script is called by the buildkite pipeline
#
# Accessing the secret containing env vars in here prevents buildkite from capturing them

docker run -it -v --rm \
-v $(pwd):/data \
-e BUILDKITE_BRANCH="$BUILDKITE_BRANCH" \
-e ORG_GRADLE_PROJECT_signingKeyId="$ORG_GRADLE_PROJECT_signingKeyId" \
-e ORG_GRADLE_PROJECT_signingPassword="$ORG_GRADLE_PROJECT_signingPassword" \
-e ORG_GRADLE_PROJECT_signingKey="$ORG_GRADLE_PROJECT_signingKey" \
-e ORG_GRADLE_PROJECT_artifactory_user=$ORG_GRADLE_PROJECT_artifactory_user \
-e ORG_GRADLE_PROJECT_artifactory_password=$ORG_GRADLE_PROJECT_artifactory_password \
-w /data \
muxinc/mux-exoplayer:20201215 \
bash -c "./gradlew --info muxReleaseDeploy"
12 changes: 10 additions & 2 deletions .buildkite/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ env:
SAUCECTL_LABEL: "$BUILDKITE_BUILD_NUMBER $BUILDKITE_PIPELINE_SLUG $BUILDKITE_BRANCH $BUILDKITE_COMMIT"
steps:
- agents: [dind=true,queue=beta]
command: docker run -it --rm -v $(pwd):/data -w="/data" muxinc/mux-exoplayer:20201215 bash -c "./gradlew --info MuxExoPlayer:clean MuxExoPlayer:build assemble automatedtests:assembleAndroidTest"
command: ./.buildkite/publish.sh
label: Build AARs and APKs
plugins:
- artifacts#v1.3.0:
Expand Down Expand Up @@ -91,4 +91,12 @@ steps:
download:
- "automatedtests/buildout/outputs/apk/r2_14_1/debug/automatedtests-r2_14_1-debug.apk"
- "automatedtests/buildout/outputs/apk/androidTest/r2_14_1/debug/automatedtests-r2_14_1-debug-androidTest.apk"

- wait
- block: ":rocket: Deploy and release!"
blocked_state: failed
branches: "master"
- wait
- agents: [ dind=true,queue=beta ]
command: ./.buildkite/deploy.sh
label: Deploy artifacts to release maven if it all worked
branches: "master"
27 changes: 27 additions & 0 deletions .buildkite/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This script is called by the buildkite pipeline
#
# Accessing the secret containing env vars in here prevents buildkite from capturing them

docker run -it -v --rm \
-v $(pwd):/data \
-e BUILDKITE_BRANCH="$BUILDKITE_BRANCH" \
-e ORG_GRADLE_PROJECT_signingKeyId="$ORG_GRADLE_PROJECT_signingKeyId" \
-e ORG_GRADLE_PROJECT_signingPassword="$ORG_GRADLE_PROJECT_signingPassword" \
-e ORG_GRADLE_PROJECT_signingKey="$ORG_GRADLE_PROJECT_signingKey" \
-e ORG_GRADLE_PROJECT_artifactory_user=$ORG_GRADLE_PROJECT_artifactory_user \
-e ORG_GRADLE_PROJECT_artifactory_password=$ORG_GRADLE_PROJECT_artifactory_password \
-w /data \
muxinc/mux-exoplayer:20201215 \
bash -c "./gradlew --info MuxExoPlayer:clean MuxExoPlayer:build assemble automatedtests:assembleAndroidTest"

docker run -it -v --rm \
-v $(pwd):/data \
-e BUILDKITE_BRANCH="$BUILDKITE_BRANCH" \
-e ORG_GRADLE_PROJECT_signingKeyId="$ORG_GRADLE_PROJECT_signingKeyId" \
-e ORG_GRADLE_PROJECT_signingPassword="$ORG_GRADLE_PROJECT_signingPassword" \
-e ORG_GRADLE_PROJECT_signingKey="$ORG_GRADLE_PROJECT_signingKey" \
-e ORG_GRADLE_PROJECT_artifactory_user=$ORG_GRADLE_PROJECT_artifactory_user \
-e ORG_GRADLE_PROJECT_artifactory_password=$ORG_GRADLE_PROJECT_artifactory_password \
-w /data \
muxinc/mux-exoplayer:20201215 \
bash -c "./gradlew --info publish artifactoryPublish"
8 changes: 5 additions & 3 deletions MuxExoPlayer/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'checkstyle'
apply plugin: 'maven-publish'
apply plugin: 'signing'

checkstyle {
configFile = file("${rootDir}/.checkstyle/checkstyle.xml")
Expand Down Expand Up @@ -27,8 +29,8 @@ android {
defaultConfig {
minSdkVersion project.ext.minSdkVersion
targetSdkVersion project.ext.targetSdkVersion
versionCode 26
versionName "2.4.15"
versionCode 27
versionName project.ext.versionName
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down Expand Up @@ -189,5 +191,5 @@ dependencies {
compileOnly 'com.google.ads.interactivemedia.v3:interactivemedia:3.9.0'
compileOnly 'com.google.android.gms:play-services-ads:15.0.1'
compileOnly 'com.google.android.gms:play-services-ads-identifier:15.0.1'
api files('libs/MuxCore.jar')
api 'com.mux:stats.muxcore:7.0.0'
}
Binary file removed MuxExoPlayer/libs/MuxCore.jar
Binary file not shown.
1 change: 0 additions & 1 deletion MuxExoPlayer/libs/version-v6.6.0

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,36 @@
import com.mux.stats.sdk.core.events.playback.PlaybackEvent;
import com.mux.stats.sdk.core.model.ViewData;

/**
* Ima SDK wrapper, listen to ad events and dispatch the appropriate AdPlayback events accordingly.
*/
public class AdsImaSDKListener implements AdErrorEvent.AdErrorListener, AdEvent.AdEventListener {

/** Associated ExoPlayer wrapper that generates the ad events. */
private final MuxBaseExoPlayer exoPlayerListener;
/** This value is used to detect if the user pressed the pause button when an ad was playing */
private boolean sendPlayOnStarted = false;
/**
* This value is used in the special case of pre roll ads playing. This value will be set to
* true when a pre roll is detected, and will be reverted back to false after dispatching the
* AdBreakStart event.
*/
private boolean missingAdBreakStartEvent = false;

/**
* Simple constructor, no special logic.
*
* @param listener, associated ExoPlayer wrapper that generate the ad events.
*/
public AdsImaSDKListener(MuxBaseExoPlayer listener) {
exoPlayerListener = listener;
}

/**
* Handles the Ad error.
*
* @param adErrorEvent, Error to be handled.
*/
@Override
public void onAdError(AdErrorEvent adErrorEvent) {
if (exoPlayerListener != null && exoPlayerListener.player != null
Expand All @@ -35,6 +55,12 @@ public void onAdError(AdErrorEvent adErrorEvent) {
}
}

/**
* Update the adId and creativeAdId on given playback event.
*
* @param event, event to be updated.
* @param ad, current ad event that is being processed.
*/
private void setupAdViewData(PlaybackEvent event, Ad ad) {
ViewData viewData = new ViewData();
if (exoPlayerListener.getCurrentPosition() == 0) {
Expand All @@ -46,6 +72,13 @@ private void setupAdViewData(PlaybackEvent event, Ad ad) {
event.setViewData(viewData);
}

/**
* This is the main boilerplate, all processing logic is contained here. Depending on the phase
* the ad is in (a single ad can have multiple phases from loading to the ending) each of them
* is handled here and an appropriate AdPlayback event is dispatched to the backend.
*
* @param adEvent
*/
@Override
public void onAdEvent(AdEvent adEvent) {
if (exoPlayerListener != null && exoPlayerListener.player != null
Expand Down Expand Up @@ -136,6 +169,12 @@ public void onAdEvent(AdEvent adEvent) {
}
}

/**
* Prepare and dispatch the given playback event to the backend using @link exoPlayerListener.
*
* @param event, to be dispatched.
* @param ad, ad being processed.
*/
private void dispatchAdPlaybackEvent(PlaybackEvent event, Ad ad) {
setupAdViewData(event, ad);
exoPlayerListener.dispatch(event);
Expand Down
Loading

0 comments on commit 6bcdd61

Please sign in to comment.