Detect audio and video features in browser.
npm i --save-dev detect-audio-video
import {
isWideGamutSupported,
isSrgbSupported,
isP3Supported,
isRec2020Supported,
getDevicePixelRatio,
getScreenWidth,
getScreenHeight,
getResolutionBadge,
isHighDynamicRangeSupported,
isHighVideoDynamicRangeSupported,
} from 'detect-audio-video';
console.log('isWideGamutSupported: ', isWideGamutSupported()); // boolean
console.log('isSrgbSupported: ', isSrgbSupported()); // boolean
console.log('isP3Supported: ', isP3Supported()); // boolean
console.log('isRec2020Supported: ', isRec2020Supported()); // boolean
console.log('getDevicePixelRatio: ', getDevicePixelRatio()); // number
// Get screen width with device pixel ratio
console.log('getScreenWidth: ', getScreenWidth()); // number
// Get screen height with device pixel ratio
console.log('getScreenHeight: ', getScreenHeight()); // number
console.log('getResolutionBadge: ', getResolutionBadge()); // string, example: "4K"
console.log('isHighDynamicRangeSupported: ', isHighDynamicRangeSupported()); // boolean
console.log('isHighVideoDynamicRangeSupported: ', isHighVideoDynamicRangeSupported()); // boolean
import {
getGpuVendor,
getGpuRenderer,
hasHardwareAcceleration,
isAppleSilicon,
getGpuProblems,
isVirtualMachine,
} from 'detect-audio-video';
const gpuVendor = getGpuVendor();
console.log('gpuVendor: ', gpuVendor); // string, example: "Apple"
const gpuRenderer = getGpuRenderer();
console.log('gpuRenderer: ', gpuRenderer); // string, example: "Apple M1, or similar"
console.log('hasHardwareAcceleration: ', hasHardwareAcceleration()); // boolean
console.log('isAppleSilicon: ', isAppleSilicon()); // boolean
console.log('gpuProblems: ', getGpuProblems()); // null or ['no driver', ...]
console.log('isVirtualMachine: ', isVirtualMachine(gpuRenderer, gpuVendor)); // boolean
import {
isNativeHlsSupported,
isNativeMpdSupported,
isNativeMssSupported,
} from 'detect-audio-video';
console.log('isNativeMssSupported: ', isNativeMssSupported()); // boolean
console.log('isNativeHlsSupported: ', isNativeHlsSupported()); // boolean
console.log('isNativeMpdSupported: ', isNativeMpdSupported()); // boolean
MIT