Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix type error
Browse files Browse the repository at this point in the history
joeyparrish committed Nov 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b453cc7 commit 5e1a382
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/polyfill/media_capabilities.js
Original file line number Diff line number Diff line change
@@ -334,13 +334,16 @@ shaka.polyfill.MediaCapabilities = class {
displayType += `; framerate=${videoConfig.framerate}`;
}

// Don't trust Closure types here. Although transferFunction is string or
// undefined, we don't want to count on the input type. A switch statement
// will, however, differentiate between null and undefined. So we default
// to a blank string.
const transferFunction = videoConfig.transferFunction || '';

// Based on internal sources. Googlers, see go/cast-hdr-queries for source.
switch (videoConfig.transferFunction) {
// These empty cases fall through to SDR.
case undefined:
case null:
switch (transferFunction) {
// The empty case falls through to SDR.
case '':

// These are the only 3 values defined by MCap as of November 2024.
case 'srgb':
// https://en.wikipedia.org/wiki/Standard-dynamic-range_video

0 comments on commit 5e1a382

Please sign in to comment.