Skip to content

Commit

Permalink
fix: reinstate play ad logic android
Browse files Browse the repository at this point in the history
  • Loading branch information
aleccolville committed Apr 19, 2022
1 parent 42b3137 commit 981caba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ public void setVolume(float volume) {
this.brightcoveVideoView.getEventEmitter().emit(EventType.SET_VOLUME, details);
}

/**/
public void setBitRate(int bitRate) {
this.bitRate = bitRate;
this.updateBitRate();
Expand Down Expand Up @@ -312,20 +311,20 @@ public void pause() {
if (this.brightcoveVideoView != null) {
if (this.adsPlaying && this.googleIMAComponent != null) {
this.googleIMAComponent.getVideoAdPlayer().pauseAd();
} else {
this.brightcoveVideoView.pause();
}
this.brightcoveVideoView.pause();
}
}

public void play() {
if (this.brightcoveVideoView != null) {
// if (this.adsPlaying && this.googleIMAComponent != null) {
// this.googleIMAComponent.getVideoAdPlayer().resumeAd();
// this.playerVideoView.pause();
// } else {
// this.playerVideoView.start();
// }
this.brightcoveVideoView.start();
if (this.adsPlaying && this.googleIMAComponent != null) {
//this.brightcoveVideoView.pause();
this.googleIMAComponent.getVideoAdPlayer().resumeAd();
} else {
this.brightcoveVideoView.start();
}
}
}

Expand Down Expand Up @@ -397,7 +396,6 @@ private void fixVideoLayout() {
to the Brightcove Seek Bar.
*/
private void setupAdMarkers(BaseVideoView videoView) {
// final BrightcoveMediaController mediaController = new BrightcoveMediaController(this.playerVideoView);
final BrightcoveMediaController mediaController = this.brightcoveVideoView.getBrightcoveMediaController();

// Add "Ad Markers" where the Ads Manager says ads will appear.
Expand Down Expand Up @@ -473,14 +471,6 @@ private void setupGoogleIMA() {
.build();
}


private void printKeys(Map<String, Object> map) {
Log.d("debug", "-----------");
for (Map.Entry<String, Object> entry : map.entrySet()) {
Log.d("debug", entry.getKey());
}
}

@Override
public void onHostResume() {
if (this.adsPlaying && this.googleIMAComponent != null && googleIMAComponent.getVideoAdPlayer() != null) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-brightcove-ima-player",
"version": "2.2.1",
"version": "2.2.2",
"description": "React Native implementation of Brightcove Player native SDK",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down

0 comments on commit 981caba

Please sign in to comment.