Skip to content

Commit

Permalink
Release 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mobile-ads-github committed Mar 28, 2022
1 parent 67a24f4 commit 0993dc7
Show file tree
Hide file tree
Showing 15 changed files with 111 additions and 45 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For the integration of YandexMobileAds SDK need:
##### 1. compile YandexMobileAds SDK:

```sh
implementation 'com.yandex.android:mobileads:5.0.0-beta.1'
implementation 'com.yandex.android:mobileads:5.0.0'
```

##### 2. compile AppMetrica SDK:
Expand Down
11 changes: 8 additions & 3 deletions SDK/adapter/admob-mobileads/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
# Change Log
All notable changes to Yandex Adapter for AdMob Mediation will be documented in this file.

## Version 5.0.0.0
## Version 5.0.0.1

#### Added
* Added support for Yandex Mobile Ads SDK version 5.0.0
* Updated minimum supported Yandex Mobile Ads SDK version to 5.0.0

## Version 5.0.0.0

#### Added
* Added support for Yandex Mobile Ads SDK version 5.0.0-alpha.2
* Updated minimum supported Yandex Mobile Ads SDK version to 5.0.0-alpha.2
* Added support for AdMob SDK version 20.5.0
* Updated minimum supported AdMob SDK version 20.5.0

## Version 4.4.1.0

#### Added
* Added support for Yandex Mobile Ads SDK version 4.41
* Updated minimum supported Yandex Mobile Ads SDK version to 4.4.1
* Added support for Yandex Mobile Ads SDK version 4.4.1
* Added support for AdMob SDK version 20.4.0
* Updated minimum supported AdMob SDK version 20.4.0

Expand Down
Binary file not shown.
Binary file not shown.
13 changes: 10 additions & 3 deletions SDK/mobileads/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log
All notable changes to Yandex Mobile Ads SDK will be documented in this file.

## Version 5.0.0

### Added
* Added performance improvements in In-Stream
* Added callback for ad buffering in In-Stream
* Improvements and optimizations

## Version 5.0.0-beta.1

### Added
Expand All @@ -19,7 +26,7 @@ All notable changes to Yandex Mobile Ads SDK will be documented in this file.

### Added
* Added Kotlin dependency
* Added AdsLoader API for simplification of InStream integration
* Added AdsLoader API for simplification of In-Stream integration
* Added automatic SDK initialization
* Added precaching for video ads
* Improved ads loading time
Expand All @@ -43,7 +50,7 @@ All notable changes to Yandex Mobile Ads SDK will be documented in this file.

### Added
* Added improvements for fullscreen designs
* Added support for initial ad player volume configuration based on video player volume in InStream
* Added support for initial ad player volume configuration based on video player volume in In-Stream
* Improvements and optimizations

### Updated
Expand All @@ -52,7 +59,7 @@ All notable changes to Yandex Mobile Ads SDK will be documented in this file.
## Version 4.4.0

### Added
* Added support for playing multiple video ads sequentially in InStream
* Added support for playing multiple video ads sequentially in In-Stream
* Added improvements for fullscreen designs
* Improvements and optimizations

Expand Down
Binary file removed SDK/mobileads/mobileads-5.0.0-beta.1.aar
Binary file not shown.
Binary file not shown.
Binary file added SDK/mobileads/mobileads-5.0.0.aar
Binary file not shown.
5 changes: 2 additions & 3 deletions YandexMobileAdsExample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ android {
// https://repo.maven.apache.org/maven2/com/yandex/ads/mediation/mobileads-ironsource/7.1.14.1/

dependencies {
implementation 'com.yandex.android:mobileads:5.0.0-beta.1'
implementation 'com.yandex.android:mobmetricalib:4.1.1'
implementation 'com.yandex.android:mobileads:5.0.0'

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.activity:activity-ktx:1.4.0'
Expand All @@ -66,7 +65,7 @@ dependencies {

implementation 'com.yandex.ads.mediation:mobileads-admob:20.5.0.0'
implementation 'com.google.android.gms:play-services-ads:20.5.0'
implementation 'com.yandex.ads.adapter:admob-mobileads:5.0.0.0'
implementation 'com.yandex.ads.adapter:admob-mobileads:5.0.0.1'

implementation 'com.yandex.ads.mediation:mobileads-applovin:11.0.0.0'
implementation 'com.applovin:applovin-sdk:11.0.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ class SampleInstreamAdPlayer(private val exoPlayerView: PlayerView) : InstreamAd

override fun isPlaying() = adPlayer.isPlaying

override fun onPause() { pause() }
override fun onPause() {
pause()
}

override fun onResume() { resume() }
override fun onResume() {
resume()
}

override fun prepareAd(videoAd: VideoAd) {
this.videoAd = videoAd
Expand All @@ -57,9 +61,13 @@ class SampleInstreamAdPlayer(private val exoPlayerView: PlayerView) : InstreamAd
adPlayer.playWhenReady = true
}

override fun pauseAd() { pause() }
override fun pauseAd() {
pause()
}

override fun resumeAd() { resume() }
override fun resumeAd() {
resume()
}

override fun stopAd() {
adPlayer.playWhenReady = false
Expand Down Expand Up @@ -107,7 +115,10 @@ class SampleInstreamAdPlayer(private val exoPlayerView: PlayerView) : InstreamAd
}

private inner class AdPlayerEventListener : Player.Listener {

private var adStarted = false
private var adPrepared = false
private var bufferingInProgress = false

override fun onIsPlayingChanged(isPlaying: Boolean) {
if (isPlaying) {
Expand All @@ -131,32 +142,53 @@ class SampleInstreamAdPlayer(private val exoPlayerView: PlayerView) : InstreamAd
}

override fun onPlaybackStateChanged(playbackState: Int) {
when(playbackState) {
Player.STATE_READY -> onReadyState()
when (playbackState) {
Player.STATE_READY -> {
if (bufferingInProgress) {
onAdBufferingFinished()
}
if (adPrepared.not()) {
onAdPrepared()
}
}
Player.STATE_BUFFERING -> onAdBufferingStarted()
Player.STATE_ENDED -> onEndedState()
}
}

private fun onReadyState() {
private fun onAdPrepared() {
adPlayerListener?.onAdPrepared(videoAd)
}

private fun onEndedState() {
adStarted = false
adPrepared = false;
bufferingInProgress = false

adPlayerListener?.onAdCompleted(videoAd)
}

private fun onAdBufferingStarted() {
bufferingInProgress = true
adPlayerListener?.onAdBufferingStarted(videoAd)
}

private fun onAdBufferingFinished() {
bufferingInProgress = false
adPlayerListener?.onAdBufferingFinished(videoAd)
}

override fun onPlayerError(error: ExoPlaybackException) {
adStarted = false
adPrepared = false
bufferingInProgress = false

val adPlayerError = exoPlayerErrorConverter.convertExoPlayerError(error)
adPlayerListener?.onError(videoAd, adPlayerError)
}
}

private companion object {

const val USER_AGENT = "ad player"
private const val USER_AGENT = "ad player"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,36 @@
~ You may obtain a copy of the License at https://legal.yandex.com/partner_ch/
-->

<com.yandex.mobile.ads.instream.player.ad.InstreamAdView
xmlns:android="http://schemas.android.com/apk/res/android"
<com.google.android.exoplayer2.ui.AspectRatioFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/instream_ad_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:id="@+id/video_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
app:layout_constraintDimensionRatio="16:9"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:resize_mode="fit">

<com.google.android.exoplayer2.ui.AspectRatioFrameLayout
android:id="@+id/video_frame"
<com.yandex.mobile.ads.instream.player.ad.InstreamAdView
android:id="@+id/instream_ad_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintDimensionRatio="16:9"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:resize_mode="fit">
android:background="@android:color/black">

<com.google.android.exoplayer2.ui.PlayerView
android:id="@+id/exo_player_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</com.google.android.exoplayer2.ui.AspectRatioFrameLayout>
</com.yandex.mobile.ads.instream.player.ad.InstreamAdView>
</com.yandex.mobile.ads.instream.player.ad.InstreamAdView>

</com.google.android.exoplayer2.ui.AspectRatioFrameLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin">

<Button
android:id="@+id/load_ad_button"
Expand Down Expand Up @@ -53,27 +57,31 @@
app:layout_constraintStart_toEndOf="@id/pause_inroll_button"
app:layout_constraintTop_toBottomOf="@id/load_ad_button" />

<com.yandex.mobile.ads.instream.player.ad.InstreamAdView
android:id="@+id/instream_ad_view"
android:layout_width="0dp"
<com.google.android.exoplayer2.ui.AspectRatioFrameLayout
android:id="@+id/video_frame"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="16:9"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/pause_inroll_button">
app:layout_constraintTop_toBottomOf="@id/pause_inroll_button"
app:resize_mode="fit">

<com.google.android.exoplayer2.ui.AspectRatioFrameLayout
android:id="@+id/video_frame"
<com.yandex.mobile.ads.instream.player.ad.InstreamAdView
android:id="@+id/instream_ad_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:resize_mode="fixed_width">
android:background="@android:color/black">

<com.google.android.exoplayer2.ui.PlayerView
android:id="@+id/exo_player_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center" />

</com.google.android.exoplayer2.ui.AspectRatioFrameLayout>
</com.yandex.mobile.ads.instream.player.ad.InstreamAdView>
</com.yandex.mobile.ads.instream.player.ad.InstreamAdView>

</com.google.android.exoplayer2.ui.AspectRatioFrameLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
android:id="@+id/player_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center" />
android:layout_gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin" />

</FrameLayout>

Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
tools:text="@string/native_ad_sponsored_text"
tools:visibility="visible" />

<ImageView
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/feedback"
android:layout_width="@dimen/native_favicon_width"
android:layout_height="@dimen/native_favicon_height"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">127.0.0.1</domain>
</domain-config>

<debug-overrides>
<trust-anchors>
<certificates src="system" />
<certificates src="user" />
</trust-anchors>
</debug-overrides>
</network-security-config>

0 comments on commit 0993dc7

Please sign in to comment.