Install transport patches and start recording CMCD reports.
If the recorder is already attached, this call does nothing. The
recorder keeps the previous options and silently ignores the new
options argument. To re-attach with different options, call
detach() first.
Discard all recorded reports. Does not affect the attached state.
Remove transport patches and stop recording. Rejects any pending
wait promises with Error('Recorder detached while waiting').
Return a copy of all recorded reports.
Wait until at least count event-mode reports are recorded.
Resolves with all matching reports. Rejects with a diagnostic error
on timeout. count defaults to 1. timeout defaults to the
recorder's waitTimeout option (default 15000 ms).
Wait until at least count manifest reports are recorded.
Resolves with all matching reports. Rejects with a diagnostic error
on timeout. count defaults to 1. timeout defaults to the
recorder's waitTimeout option (default 15000 ms).
Wait until at least count reports of any type are recorded.
Resolves with all matching reports. Rejects with a diagnostic error
on timeout. count defaults to 1. timeout defaults to the
recorder's waitTimeout option (default 15000 ms).
Wait until at least count segment reports are recorded.
Resolves with all matching reports. Rejects with a diagnostic error
on timeout. count defaults to 1. timeout defaults to the
recorder's waitTimeout option (default 15000 ms).
Test helper that records CMCD reports from the XHR and fetch transports for assertions in e2e tests. The recorder normalizes each captured request to HttpRequest, so tests are identical regardless of which transport the player uses.
Example