Skip to content

Conversation

fabrizio-rar
Copy link
Contributor

@fabrizio-rar fabrizio-rar commented Oct 1, 2025

This PR adds a new field called playback_mode which accepts an assocarray

This field is handled in the playbackModeHandler , this method does the following:

  • Checks if the property mode is set, if not, it warns the user and returns
  • Checks if the property player_playback_mode_data is set, if not, it warns the user and returns
  • Checks if the property player_playback_mode_data is parse-able JSON, if not, it warns the user and returns
  • Sends the event playbackmodechange containing mode, player_playback_mode_data, m._cumulativePlayingTime and m._totalAdWatchTime

To check if a string is parse-able JSON, the ParseJson utility function was used, to check out how it works, here's the documentation

Copy link
Contributor

@daytime-em daytime-em left a comment

Choose a reason for hiding this comment

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

Just one change. Hopefully simple.

Thank you!

Copy link
Collaborator

@jsanford8 jsanford8 left a comment

Choose a reason for hiding this comment

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

overall - does this even work? If so, how, what am I missing about how Roku works?

second, I'm okay with just telling Roku customers to set playbackMode = { mode: 'string', data: JSONstring } rather than having to make them use player_playback_mode_data

end if
props.player_playback_mode = playbackMode.mode

if playbackMode.player_playback_mode_data = Invalid
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this what we want to specify as the field name, @daytime-em ? It feels a little bit verbose, and I'm not really against it, but if we have playbackMode.mode and playbackMode.data wouldn't that work for us?

Copy link
Contributor

@daytime-em daytime-em left a comment

Choose a reason for hiding this comment

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

LGTM.

Thanks for taking the changes!

I responded to the player_playabck_mode_data thing on Slack. I'm good with it, but if we change to data, it's still a ✅ from me

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