Skip to content

Conversation

@nickolas-dimitrakas
Copy link
Contributor

@nickolas-dimitrakas nickolas-dimitrakas commented Dec 10, 2025

Background

  • Added support for excluding ad breaks from content time tracking in media sessions. This allows developers to accurately track content playback time separately from ad playback time.

What Has Changed

  • Added excludeAdBreaksFromContentTime boolean parameter to MediaSession.build() (defaults to false for backward compatibility)
  • Implemented playback state management with three states: playing, pausedByUser, and pausedByAdBreak
  • Updated logAdBreakStart() and logAdBreakEnd() to pause/resume content time tracking when the flag is enabled
  • Added playbackState tracking to distinguish between user-initiated pauses and system-initiated pauses during ad breaks
  • Added three new test cases to verify the feature works correctly in different scenarios

Screenshots

image

Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have tested this locally.

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

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.

LGTM and has the changes I expected from the last version

Copy link
Collaborator

@jamesnrokt jamesnrokt left a comment

Choose a reason for hiding this comment

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

Really good cleanup. I don't have a Roku device to run it and validate but the logic looks correct. Few minor comments

Copy link
Collaborator

@jamesnrokt jamesnrokt left a comment

Choose a reason for hiding this comment

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

Approved but also applied the 'wait to merge' label as I believe we can't merge until 12th without further approval. Please correct that if I'm wrong

@jamesnrokt jamesnrokt mentioned this pull request Jan 5, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants