detect-audio-video
Detect audio and video features in browser.
Install
npm i --save-dev detect-audio-video
Features
- Size
- Device pixel ratio
- HDR support
- Wide gamut
- Color spaces
- Aspect ratio
import {
isWideGamutSupported,
isSrgbSupported,
isP3Supported,
isRec2020Supported,
getDevicePixelRatio,
getScreenWidth,
getScreenHeight,
getResolutionBadge,
isHighDynamicRangeSupported,
isHighVideoDynamicRangeSupported,
} from 'detect-audio-video';
console.log('isWideGamutSupported: ', isWideGamutSupported());
console.log('isSrgbSupported: ', isSrgbSupported());
console.log('isP3Supported: ', isP3Supported());
console.log('isRec2020Supported: ', isRec2020Supported());
console.log('getDevicePixelRatio: ', getDevicePixelRatio());
console.log('getScreenWidth: ', getScreenWidth());
console.log('getScreenHeight: ', getScreenHeight());
console.log('getResolutionBadge: ', getResolutionBadge());
console.log('isHighDynamicRangeSupported: ', isHighDynamicRangeSupported());
console.log('isHighVideoDynamicRangeSupported: ', isHighVideoDynamicRangeSupported());
import {
getGpuVendor,
getGpuRenderer,
hasHardwareAcceleration,
isAppleSilicon,
} from 'detect-audio-video';
console.log('getGpuVendor: ', getGpuVendor());
console.log('getGpuRenderer: ', getGpuRenderer());
console.log('hasHardwareAcceleration: ', hasHardwareAcceleration());
console.log('isAppleSilicon: ', isAppleSilicon());
- Microsoft PlayReady SL150, SL2000, SL3000
- Google Widevine Modular L1, L3
- Apple FairPlay
- Adobe Primetime
- HDCP
🏊 Native streaming support
import {
isNativeHlsSupported,
isNativeMpdSupported,
isNativeMssSupported,
} from 'detect-audio-video';
console.log('isNativeMssSupported: ', isNativeMssSupported());
console.log('isNativeHlsSupported: ', isNativeHlsSupported());
console.log('isNativeMpdSupported: ', isNativeMpdSupported());
- Media Source Extensions
- Media Source Extensions in Workers
- Encrypted Media Extensions
- Managed Media Source
- Managed Media Source in Workers
- Picture-in-picture
- Cast to AirPlay
- Remote Playback API
- H.264
- H.265 (HEVC)
- H.266 (VVC)
- Dolby Vision
- EVC
- VP8
- VP9
- AV1
- AAC
- Opus
- Vorbis
- FLAC
- ALAC
- AC-3 (Dolby Digital)
- EC-3 (Dolby Digital+)
- Dolby Atmos
- GIF
- PNG
- APNG
- JPEG
- JPEG XL
- HEIF/HEIC
- AVIF
- WEBP
- SVG
- ICO
- BMP
- TIFF
- Support
- Audio and video codecs
Links
MIT