detect-audio-video
Advanced tools
Comparing version 0.31.0 to 0.32.0
@@ -478,16 +478,16 @@ const AAC_CONTENT_TYPE = 'audio/mp4; codecs="mp4a.40.2"'; | ||
} | ||
function isWideGamutSupported() { | ||
return isSrgbSupported() || isRec2020Supported(); | ||
function isWideGamutSupported(win = window) { | ||
return isSrgbSupported(win) || isRec2020Supported(win); | ||
} | ||
function isSrgbSupported() { | ||
return checkColorSpace('srgb'); | ||
function isSrgbSupported(win = window) { | ||
return checkColorSpace('srgb', win); | ||
} | ||
function isP3Supported() { | ||
return checkColorSpace('p3'); | ||
function isP3Supported(win = window) { | ||
return checkColorSpace('p3', win); | ||
} | ||
function isRec2020Supported() { | ||
return checkColorSpace('rec2020'); | ||
function isRec2020Supported(win = window) { | ||
return checkColorSpace('rec2020', win); | ||
} | ||
function checkColorSpace(type) { | ||
return window.matchMedia && window.matchMedia(`(color-gamut: ${type})`).matches; | ||
function checkColorSpace(type, win = window) { | ||
return win.matchMedia && win.matchMedia(`(color-gamut: ${type})`).matches; | ||
} | ||
@@ -494,0 +494,0 @@ |
@@ -25,5 +25,5 @@ declare global { | ||
export declare function getResolutionMode(height?: number): string; | ||
export declare function isWideGamutSupported(): boolean; | ||
export declare function isSrgbSupported(): boolean; | ||
export declare function isP3Supported(): boolean; | ||
export declare function isRec2020Supported(): boolean; | ||
export declare function isWideGamutSupported(win?: Window & typeof globalThis): boolean; | ||
export declare function isSrgbSupported(win?: Window & typeof globalThis): boolean; | ||
export declare function isP3Supported(win?: Window & typeof globalThis): boolean; | ||
export declare function isRec2020Supported(win?: Window & typeof globalThis): boolean; |
{ | ||
"name": "detect-audio-video", | ||
"version": "0.31.0", | ||
"version": "0.32.0", | ||
"description": "Detect audio video features", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45759