Skip to content

Conviva: do not report Paused state after the session has ended - #138

Merged
therama merged 1 commit into
mainfrom
bugfix/conviva-pause-after-ended
Nov 19, 2026
Merged

therama merged 1 commit into
mainfrom
bugfix/conviva-pause-after-ended

Conversation

@ceyhun-o

Copy link
Copy Markdown
Contributor

Summary

On iOS, THEOplayer dispatches PAUSE about 1 ms after ENDED, when AVPlayer drops its rate to 0 at the end of the stream. By then PlayerHandler.ended has already reported CONVIVA_STOPPED and maybeReportPlaybackEnded() has called reportPlaybackEnded() and cleanup(). PlayerHandler.pause then reported CONVIVA_PAUSED on the ended, cleaned-up session.

func pause(event: PauseEvent) {
    self.playerState = .CONVIVA_PAUSED
    guard self.currentConvivaSession.started else { return }   // new
    self.reportPlayerState()
}

playerState is still updated, so a new session that starts later sees the correct state. The Web connector behaves the same way: it drops its Conviva object at session end, so a late pause isn't reported.

Verification was on an iPhone 17 simulator (iOS 26.5, Xcode 26.6):

  • The PAUSE after ENDED also happens on a natural stream end without a seek, and on a plain player without the connector.
  • With this fix applied on top of the Conviva test suite in Conviva: add a test suite for the connector #137, all 29 tests pass, including SessionLifecycleTests.testEndedReportsStoppedAndEndsSession, which fails without it.

What Conviva does with a state report after cleanup() was not observed, because the Conviva gateway was unreachable from the test VM.

Link to Devin session: https://dolby.devinenterprise.com/sessions/50c8aced921146a9b29941f29ac495cd
Open in Devin Desktop: https://dolby.devinenterprise.com/desktop/session/50c8aced921146a9b29941f29ac495cd?variant=devin
Requested by: @ceyhun-o

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

THEOplayer on iOS dispatches PAUSE right after ENDED. By then the connector
has already called reportPlaybackEnded() and cleanup() on the Conviva video
analytics, so the Paused state was reported on an ended session.

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Ceyhun Ozgoc <ceyhun.ozgoc@dolby.com>
@devin-ai-integration
devin-ai-integration Bot force-pushed the bugfix/conviva-pause-after-ended branch from dec7477 to 6c70b21 Compare November 19, 2026 09:32
@ceyhun-o ceyhun-o added the bug Something isn't working label Nov 19, 2026
@ceyhun-o
ceyhun-o requested a review from therama November 19, 2026 09:33
@therama
therama merged commit c51b87e into main Nov 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants