Skip to content

Add Lens connector - #133

Open
GillesMoris-Dolby wants to merge 20 commits into
mainfrom
feature/lens-connector
Open

GillesMoris-Dolby wants to merge 20 commits into
mainfrom
feature/lens-connector

Conversation

@GillesMoris-Dolby

@GillesMoris-Dolby GillesMoris-Dolby commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

OptiView Lens is Dolby's cross-player observability SDK: it turns a player adapter's observations into CMCD sessions and reports. It runs next to the player's own CMCD reporting, and the connector links the two where the player supports it. This PR adds its THEOplayer iOS/tvOS connector, THEOplayerConnectorLens (Code/Lens). Web (web-connectors#112) and Android (android-connector#114) ship the same connector with the same public API.

  • THEOplayerLensAdapter implements Lens's observation-only LensPlayerAdapter over THEOplayer's public API: source and fallback, play/pause/waiting/seek/ended, fatal errors, tracks and qualities, readiness, live and low latency, rate/volume, presentation mode, and a snapshot (playhead, PDT, buffered, seekable, bandwidth estimate, dropped frames, view size). Lens derives the sessions, states and CMCD keys itself.
  • try LensConnector(player: player, configuration: LensConfiguration()) joins Lens with that adapter in the registered theoplayer namespace. LensConfiguration is the Lens join options minus namespace and player, plus an optional contentId provider. It exposes handle (consent, flush) and adapter. The adapter's target is the THEOplayer itself, so an app or SDK with only the player shares the session by joining Lens with the raw player in its own namespace. Lens holds the player while a handle on it exists, so apps call destroy() and release the connector before releasing the player. Google DAI sources are named by asset key or contentSourceID/videoID; the provider overrides it.
  • SPM only (optiview-lens-sdk-swift 0.7.0..<0.8.0); no podspec, so the podspec release workflow skips it. Lens 0.7 ships LensSDK as a prebuilt dynamic framework: the connector links it without embedding it, and the app embeds it once (checked in the example app).
  • The connector keeps player.cmcd.lensSessionId equal to its handle's Lens session ID through Lens's session delegate: set after join, updated on every session change, cleared on destroy(), so THEOplayer's own CMCD data carries it as lsid (data spec#36). THEOplayer.cmcd is behind @_spi(Core), imported in LensConnector.swift and the tests. Root README lists it as supported from 11.1.0 (assumes the next release is a minor).
  • Example app (Code/Lens-Examples): shows every report, a staging switch, a destination setting, and the one-minute scenario shared with the web and Android demos; can run unattended with -runScenario YES.

THEOplayer behaviour the adapter works around: SOURCE_CHANGE is synchronous and Google DAI sets the same description twice (sources are compared by identity); duration == 0 means unknown; Quality has no identifier, so a rendition's id is its bandwidth.

Known gaps, documented in the README: no loading quality (so no br/bc), no codecs or frame rate (not public on Apple), no player-view visibility, fatal errors only, ads not reported as ads.

Blocked on THEOplayer: THEOplayer.cmcd is not released yet. Package.swift requires THEOplayerSDK 11.16.0 (assumed to be the first release with it; adjust once known), which raises the minimum for every connector in the package. Until it is published, build-and-test fails at dependency resolution; re-run CI once it is out.

Tests: XCTest target against a real player, wired into CI. Locally, against a THEOplayer simulator build of the PR 8186 branch (74f267dd8a3) and Lens 0.7.0: 29/29 pass, including the Lens session ID following the Lens session, being set when joining a session in progress, and being cleared on destroy.

Link to Devin session: https://dolby.devinenterprise.com/sessions/48440a3427b640eebe14e31ff7eb52a2
Open in Devin Desktop: https://dolby.devinenterprise.com/desktop/session/48440a3427b640eebe14e31ff7eb52a2?variant=devin
Requested by: @GillesMoris-Dolby

GillesMoris-Dolby and others added 4 commits November 6, 2026 11:08
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@GillesMoris-Dolby

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

GillesMoris-Dolby and others added 2 commits November 6, 2026 14:09
LensConnector joins Lens in the registered theoplayer namespace with the
adapter, takes the other join options plus an optional content ID provider,
exposes the handle and the adapter, and disposes with the player. Low latency
now follows a latency configuration or a HESP or Millicast source only: a
THEOlive channel can be regular HLS. A test covers a play request on a new
source while playing, which the Apple SDK reports as PLAY.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@GillesMoris-Dolby

This comment was marked as resolved.

devin-ai-integration Bot and others added 6 commits November 6, 2026 13:27
…efault

Co-Authored-By: Gilles <Gilles.Moris@dolby.com>
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The example enables the Lens development backend and sends its reports to the
staging ingest only while the switch is on. The scenario replays the same
playback as the Lens demos of the other platforms, reported with the content
ID lens-connector-scenario, and can run unattended from launch arguments.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…nario

Adds the 2 s settles after unmute, rate 1 and inline, and waits 2 s instead of
3 s after the end, as agreed for all platforms. Fullscreen stands for the
picture-in-picture or fullscreen step.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The scenario now goes into the player's in-app picture-in-picture, as the web
demo uses the in-page one, and reports the content ID
lens-connector-demo-scenario like the other platforms. The README spells out
the timing choices every platform makes. The demo gets a PiP button.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Destination... takes a URL and a format, CMCD or JSON, remembers them, and joins
Lens again with that destination. The app counts what it sent there, with the
last HTTP status, and allows plain http endpoints. This replaces the constant
in Config.swift.

Forwarded posts to staging went out with an empty body: setting the body
stream to nil after the body cleared the body. They now carry the reports.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration devin-ai-integration Bot changed the title Lens: add a connector that reports THEOplayer to the OptiView Lens SDK Add Lens connector Nov 6, 2026
GillesMoris-Dolby and others added 4 commits November 10, 2026 10:52
Lens 0.6.2 keys a session on the adapter's target. The adapter names the
THEOplayer itself, so an SDK without a reference to the adapter shares the
session by joining Lens with the raw player. Lens holds the player while a
handle on it exists, so the connector no longer ends on the player's DESTROY,
which cannot happen while it is joined: apps destroy the connector, then
release it.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… example

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The connector keeps player.cmcd.linkedSessionId equal to its handle's Lens
session ID through the session delegate Lens 0.7.0 adds: set after join,
updated on every session change, cleared on destroy. Lens 0.7.0 ships LensSDK
as a prebuilt dynamic framework, which the connector links and the app embeds
once, and decides the session when a source is set. THEOplayer gains
cmcd.linkedSessionId in 11.16.0 (theoplayer-next PR 8186), hence the new
minimum.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ire it in the example

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
GillesMoris-Dolby and others added 2 commits November 17, 2026 09:34
…sionId

THEOplayer.cmcd and the CMCD protocol moved behind @_spi(Core) in theoplayer-next PR 8186.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
GillesMoris-Dolby and others added 2 commits November 17, 2026 10:52
THEOplayer renamed CMCD.linkedSessionId to lensSessionId, after the data spec fullName; the behaviour and the lsid key are unchanged.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The connector now links that reporting to the Lens session, as the README says further up, so the two are meant to run together.

Co-Authored-By: Gilles <Gilles.Moris@dolby.com>
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.

1 participant