Skip to content

Commit

Permalink
Merge pull request #36 from azerion/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
florisdh authored Oct 18, 2019
2 parents 27fdaa4 + 0a29e10 commit a91f395
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 15 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.3.1] - 2019-10-18
### Fixed
- [GameDistribution Ads] Content paused is now only fired when an ad is actually beeing displayed
16 changes: 13 additions & 3 deletions build/phaser-ads.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/phaser-ads.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/phaser-ads.min.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion example/gamedistribution.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
game.ads.setAdProvider(new PhaserAds.AdProvider.GameDistributionAds(
game,
'2d77cfd4b1e5487d998465c29de195b3', //Your game id goes here
'ABD36C6C-E74B-4BA7-BE87-0AB01F98D30D-s1'//Your user id goes here
));

}
Expand Down
7 changes: 2 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@azerion/phaser-ads",
"author": "Azerion",
"version": "2.3.0",
"version": "2.3.1",
"description": "A Phaser plugin for providing nice ads integration in your phaser.io game",
"contributors": [
{
Expand Down
11 changes: 10 additions & 1 deletion ts/Providers/GameDistributionAds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ module PhaserAds {
gameId: gameId,
advertisementSettings: {
autoplay: false
},
onEvent: (event: any): void => {
switch (event.name as string) {
case 'SDK_GAME_PAUSE':
// pause game logic / mute audio
this.adManager.onContentPaused.dispatch();
break;
default:
break;
}
}
};

Expand Down Expand Up @@ -64,7 +74,6 @@ module PhaserAds {
return;
}

this.adManager.onContentPaused.dispatch();
gdsdk.showAd((adType === PhaserAds.AdType.rewarded) ? GameDistributionAdType.rewarded : GameDistributionAdType.interstitial).then(() => {
if (adType === PhaserAds.AdType.rewarded && this.hasRewarded === true) {
this.adManager.onAdRewardGranted.dispatch();
Expand Down

0 comments on commit a91f395

Please sign in to comment.