Files
shaka-player/lib/cast
Joey Parrish 4e75ec64be fix(cast): Reduce size of Cast update messages (#4644)
Our Cast API sends update messages from receiver to sender, and we have
observed before that there is a hidden limit on the size of those
messages. A test was written long ago to catch unexpected increases in
message sizes, and it has recently started failing.

Our original limit on individual messages was set to 6kB, but later
raised to 7kB to silence test failures. Our original goal was to keep
messages well under 8kB. We also had a limit on the average message size
of 3kB (over 50 messages).

This change greatly reduces the sizes of individual messages by
splitting out updates to certain getters into their own messages. These
are the getters that produce the most data: getConfiguration(),
getStats(), getVariantTracks(), and getTextTracks(). In testing,
getConfiguration() alone is nearly 4kB with defaults, so this is a
signficant chunk of the test limit of 7kB.

With this change, the max message size seen in tests was reduced from
~7kB to ~4kB, and the average message size was reduced from ~2kB to
~1kB. With this, we are lowering the thresholds in tests back to 6kB
(max) and 2kB (average).

This also adds new versions of these message size tests for clear
content. Although DRM content will generate larger messages, I had to do
some of the work on this change while my internet connection was out,
and I found it very useful to be able to run a version of these tests
that did not require an internet connection (for a DRM license).
2022-11-02 08:44:53 -07:00
..