Skip to content

Conversation

@mmustafa-tse
Copy link
Contributor

Summary

  • The Media SDKs on all other platforms (Web, iOS and Android) have the capabilities of having media session attributes that get forwarded with every event within the media session and this PR is to add that capability to the Roku SDK as well.

Testing Plan

  • Was this tested locally? If not, explain why.
  • E2E tested
  • Can be added as a parameter when initiating a mediaSession:
  • mediaSession = mpConstants.MediaSession.build("ABC123", "Space Pilot 3000", mparticleConstants().MEDIA_CONTENT_TYPE.VIDEO, mparticleConstants().MEDIA_STREAM_TYPE.LIVE_STREAM, 1800000, {"testMediaSeshAttr": "testValMedia"})
  • Screenshot 2025-05-19 at 2 02 24 PM
  • Screenshot 2025-05-19 at 2 03 04 PM
  • Screenshot 2025-05-19 at 2 03 24 PM
  • Screenshot 2025-05-19 at 2 03 45 PM
  • Screenshot 2025-05-19 at 2 04 04 PM
  • Can also be added after initiating a mediaSession:
  • mediaSession = mpConstants.MediaSession.build("ABC123", "Space Pilot 3000", mparticleConstants().MEDIA_CONTENT_TYPE.VIDEO, mparticleConstants().MEDIA_STREAM_TYPE.LIVE_STREAM, 1800000)
  • mediaSession.mediaSessionAttributes = {"testMediaAttr2": "testVal2"}
  • Screenshot 2025-05-19 at 2 05 41 PM
  • Screenshot 2025-05-19 at 2 06 10 PM
  • Screenshot 2025-05-19 at 2 06 27 PM
  • Screenshot 2025-05-19 at 2 06 44 PM
  • Screenshot 2025-05-19 at 2 07 04 PM

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

@BrandonStalnaker BrandonStalnaker self-requested a review May 20, 2025 13:13
Copy link
Contributor

@BrandonStalnaker BrandonStalnaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks right I just want the session custom attributes logic to also handle basic number types

for each attributeKey in attributeKeys
if (mputils.isString(mediaSessionAttributes[attributeKey])) then
eventAttributes[attributeKey] = mediaSessionAttributes[attributeKey]
end if
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we have an elseif here for if the value is an integer? Then you could use ToStr() like on line 1835 to convert it to a string.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BrandonStalnaker thanks for the catch, just added handling non-string attributes logic

Copy link
Member

@rmi22186 rmi22186 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree with brandon's comment. otherwise lgtm

@rmi22186
Copy link
Member

There seems to be a formatting issue, although it doesn't say what it is https://github.com/mParticle/mparticle-roku-sdk/actions/runs/15123567891/job/42511174341?pr=41#step:5:1

Can you run locally and see if you can fix it? maybe cursor can help.

@mmustafa-tse
Copy link
Contributor Author

@rmi22186 - the only issue is I tried running that command and I'm getting "zsh: command not found: bsfmt", I probably have to install it from somewhere

@rmi22186 rmi22186 merged commit 8649be4 into mParticle:master May 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants