Skip to content

Commit

Permalink
Merge pull request #59 from ringpublishing/bugfix/audio-event-fra
Browse files Browse the repository at this point in the history
[NATIVEPLAY-776] FRA field type changed from Boolean to Integer
  • Loading branch information
danielcalka authored Nov 5, 2024
2 parents 20f12b5 + 1cb1460 commit d2d94d2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Changelogs/1.6.4
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
1.6.4 Release notes (2024-11-05)
================================

### Changes

* FRA (IS_CONTENT_FRAGMENT) event field type has changed from Boolean to Integer
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ internal class AudioEventsFactory(private val gson: Gson) {
this[AudioEventParam.IS_MAIN_AUDIO.text] = MAIN_AUDIO
this[AudioEventParam.AUDIO_CONTENT_CATEGORY.text] = audioMetadata.audioContentCategory.text
this[AudioEventParam.CONTEXT.text] = createContextParam(audioState.visibilityState, audioState.audioOutput)
this[AudioEventParam.IS_CONTENT_FRAGMENT.text] = audioMetadata.isContentFragment
this[AudioEventParam.IS_CONTENT_FRAGMENT.text] = if (audioMetadata.isContentFragment) 1 else 0

audioMetadata.audioDuration?.let {
this[AudioEventParam.DURATION.text] = it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class AudioEventsFactoryTest {
val sampleData = "audio:${sampleAudioMetadata.contentId},${sampleAudioMetadata.contentId},${sampleAudioMetadata.audioStreamFormat.text},360"
val sampleContextJson = "{\"context\":{\"visible\":\"background\",\"audio\":{\"output\":\"bluetooth\"}}}"
val sampleContextJsonEncoded = Base64.encodeToString(sampleContextJson.toByteArray(), Base64.NO_WRAP)
val isContentFragment = if (sampleAudioMetadata.isContentFragment) 1 else 0

Assert.assertEquals(event.parameters[AudioEventParam.SELECTED_ELEMENT_NAME.text], audioEvent.text)
Assert.assertEquals(event.parameters[AudioEventParam.EVENT_TYPE.text], EventType.VIDEO.text)
Expand All @@ -142,7 +143,7 @@ class AudioEventsFactoryTest {
Assert.assertEquals(event.parameters[AudioEventParam.FORMAT.text], sampleAudioMetadata.audioStreamFormat.text)
Assert.assertEquals(event.parameters[AudioEventParam.START_MODE.text], "normal")
Assert.assertEquals(event.parameters[AudioEventParam.AUDIO_PLAYER_VERSION.text], sampleAudioMetadata.audioPlayerVersion)
Assert.assertEquals(event.parameters[AudioEventParam.IS_CONTENT_FRAGMENT.text], sampleAudioMetadata.isContentFragment)
Assert.assertEquals(event.parameters[AudioEventParam.IS_CONTENT_FRAGMENT.text], isContentFragment)
Assert.assertEquals(event.parameters[AudioEventParam.PLAYER_TYPE.text], "player")
Assert.assertEquals(event.parameters[AudioEventParam.IS_MAIN_AUDIO.text], "mainAudio")
Assert.assertEquals(event.parameters[AudioEventParam.AUDIO_CONTENT_CATEGORY.text], sampleAudioMetadata.audioContentCategory.text)
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ android.useAndroidX=true
android.enableJetifier=true

#Library version name
sdk_version_name=1.6.3
sdk_version_name=1.6.4
#Library version code
sdk_version_code=22
sdk_version_code=23

0 comments on commit d2d94d2

Please sign in to comment.