Skip to content

Commit

Permalink
Allow people to disable sending anything to Sentry (#17)
Browse files Browse the repository at this point in the history
* allow for disabling Sentry reporting

* make sure all can disable sentry

* clean up demo app

* clean gradle in CI build before building
  • Loading branch information
jsanford8 authored Sep 19, 2019
1 parent bd28681 commit 72d3fd2
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- agents:
dind: true
command: docker run -it --rm -v "$PWD":/data -w /data muxinc/mux-exoplayer:20190830
command: docker run -it --rm -v "$PWD":/data -w /data muxinc/mux-exoplayer:20190919
label: Build AARs
artifact_paths:
- "MuxExoPlayer/buildout/outputs/artifacts/*.aar"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ RUN echo "sdk.dir=$ANDROID_HOME" > local.properties
RUN ./gradlew --info androidDependencies

# Run build task by default
CMD ./gradlew --info build
CMD ./gradlew --info clean build
4 changes: 2 additions & 2 deletions MuxExoPlayer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
versionCode 2
versionName "0.5.0"
versionCode 3
versionName "0.5.1"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand Down
Binary file modified MuxExoPlayer/libs/MuxCore.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ public enum PlayerState {
protected PlayerState state;
protected MuxStats muxStats;

MuxBaseExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData) {
MuxBaseExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData, boolean sentryEnabled) {
super();
this.player = new WeakReference<>(player);
state = PlayerState.INIT;
MuxStats.setHostDevice(new MuxDevice(ctx));
MuxStats.setHostNetworkApi(new MuxNetworkRequests());
muxStats = new MuxStats(this, playerName, customerPlayerData, customerVideoData);
muxStats = new MuxStats(this, playerName, customerPlayerData, customerVideoData, sentryEnabled);
addListener(muxStats);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ public class MuxStatsExoPlayer extends MuxBaseExoPlayer implements ExoPlayer.Eve
private WeakReference<MetadataRenderer.Output> metaDataListener;

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData) {
super(ctx, player, playerName, customerPlayerData, customerVideoData);
this(ctx, player, playerName, customerPlayerData, customerVideoData, true);
}

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData, boolean sentryEnabled) {
super(ctx, player, playerName, customerPlayerData, customerVideoData, sentryEnabled);
player.addListener(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ public class MuxStatsExoPlayer extends MuxBaseExoPlayer implements ExoPlayer.Eve
private WeakReference<MetadataRenderer.Output> metaDataListener;

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData) {
super(ctx, player, playerName, customerPlayerData, customerVideoData);
this(ctx, player, playerName, customerPlayerData, customerVideoData, true);
}

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData, boolean sentryEnabled) {
super(ctx, player, playerName, customerPlayerData, customerVideoData, sentryEnabled);
player.addListener(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ public class MuxStatsExoPlayer extends MuxBaseExoPlayer implements ExoPlayer.Eve
private WeakReference<MetadataRenderer.Output> metaDataListener;

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData) {
super(ctx, player, playerName, customerPlayerData, customerVideoData);
this(ctx, player, playerName, customerPlayerData, customerVideoData, true);
}

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData, boolean sentryEnabled) {
super(ctx, player, playerName, customerPlayerData, customerVideoData, sentryEnabled);
player.addListener(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ public class MuxStatsExoPlayer extends MuxBaseExoPlayer implements ExoPlayer.Eve
private WeakReference<MetadataRenderer.Output> metaDataListener;

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData) {
super(ctx, player, playerName, customerPlayerData, customerVideoData);
this(ctx, player, playerName, customerPlayerData, customerVideoData, true);
}

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData, boolean sentryEnabled) {
super(ctx, player, playerName, customerPlayerData, customerVideoData, sentryEnabled);
player.addListener(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ public class MuxStatsExoPlayer extends MuxBaseExoPlayer implements ExoPlayer.Eve
private WeakReference<MetadataRenderer.Output> metaDataListener;

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData) {
super(ctx, player, playerName, customerPlayerData, customerVideoData);
this(ctx, player, playerName, customerPlayerData, customerVideoData, true);
}

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData, boolean sentryEnabled) {
super(ctx, player, playerName, customerPlayerData, customerVideoData, sentryEnabled);
player.addListener(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ public class MuxStatsExoPlayer extends MuxBaseExoPlayer implements ExoPlayer.Eve
private WeakReference<MetadataRenderer.Output> metaDataListener;

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData) {
super(ctx, player, playerName, customerPlayerData, customerVideoData);
this(ctx, player, playerName, customerPlayerData, customerVideoData, true);
}

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData, boolean sentryEnabled) {
super(ctx, player, playerName, customerPlayerData, customerVideoData, sentryEnabled);
player.addListener(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ public class MuxStatsExoPlayer extends MuxBaseExoPlayer implements Player.EventL
private WeakReference<MetadataOutput> metaDataListener;

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData) {
super(ctx, player, playerName, customerPlayerData, customerVideoData);
this(ctx, player, playerName, customerPlayerData, customerVideoData, true);
}

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData, boolean sentryEnabled) {
super(ctx, player, playerName, customerPlayerData, customerVideoData, sentryEnabled);
player.addListener(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ public class MuxStatsExoPlayer extends MuxBaseExoPlayer implements Player.EventL
private WeakReference<MetadataOutput> metaDataListener;

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData) {
super(ctx, player, playerName, customerPlayerData, customerVideoData);
this(ctx, player, playerName, customerPlayerData, customerVideoData, true);
}

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData, boolean sentryEnabled) {
super(ctx, player, playerName, customerPlayerData, customerVideoData, sentryEnabled);
player.addListener(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
public class MuxStatsExoPlayer extends MuxBaseExoPlayer implements AnalyticsListener, Player.EventListener{

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData) {
super(ctx, player, playerName, customerPlayerData, customerVideoData);
this(ctx, player, playerName, customerPlayerData, customerVideoData, true);
}

public MuxStatsExoPlayer(Context ctx, ExoPlayer player, String playerName, CustomerPlayerData customerPlayerData, CustomerVideoData customerVideoData, boolean sentryEnabled) {
super(ctx, player, playerName, customerPlayerData, customerVideoData, sentryEnabled);

if (player instanceof SimpleExoPlayer) {
((SimpleExoPlayer) player).addAnalyticsListener(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ private void initializePlayer() {
customerPlayerData.setEnvironmentKey("YOUR_ENVIRONMENT_KEY");
CustomerVideoData customerVideoData = new CustomerVideoData();
customerVideoData.setVideoTitle(intent.getStringExtra(VIDEO_TITLE_EXTRA));
muxStats = new MuxStatsExoPlayer(this, player, "demo-player", customerPlayerData, customerVideoData);
muxStats = new MuxStatsExoPlayer(this, player, "demo-player", customerPlayerData, customerVideoData, false);
Point size = new Point();
getWindowManager().getDefaultDisplay().getSize(size);
muxStats.setScreenSize(size.x, size.y);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,8 @@
import com.google.android.exoplayer2.util.Util;
import com.mux.stats.sdk.core.model.CustomerPlayerData;
import com.mux.stats.sdk.core.model.CustomerVideoData;
import com.mux.stats.sdk.muxstats.AdsImaSDKListener;
import com.mux.stats.sdk.muxstats.MuxStatsExoPlayer;

import java.lang.reflect.Constructor;
import java.net.CookieHandler;
import java.net.CookieManager;
import java.net.CookiePolicy;
Expand Down Expand Up @@ -174,7 +172,6 @@ public class PlayerActivity extends Activity
private AdsLoader adsLoader;
private AdsManager adsManager;
private ImaSdkFactory sdkFactory;
private AdsImaSDKListener imaListener;
// Activity lifecycle

@Override
Expand Down Expand Up @@ -619,17 +616,13 @@ private void setupAdsMediaSource(final String adTagUri) {
adsLoader = sdkFactory.createAdsLoader(this);
ImaSdkSettings settings = adsLoader.getSettings();
//settings.setAutoPlayAdBreaks(false);
//imaListener = muxStats.getIMASdkListener();
muxStats.monitorImaAdsLoader(adsLoader);
adsLoader.addAdsLoadedListener(new AdsLoader.AdsLoadedListener() {
@Override
public void onAdsManagerLoaded(AdsManagerLoadedEvent adsManagerLoadedEvent) {
// Ads were successfully loaded, so get the AdsManager instance. AdsManager has
// events for ad playback and errors.
adsManager = adsManagerLoadedEvent.getAdsManager();
// Attach mux event and error event listeners.
//adsManager.addAdErrorListener(imaListener);
//adsManager.addAdEventListener(imaListener);

// Attach local event and error event listeners for player/ima control.
AdsListener listener = new AdsListener();
Expand Down

0 comments on commit 72d3fd2

Please sign in to comment.