4.1.0 • Published 7 months ago

detect-audio-video v4.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

detect-audio-video

NPM version NPM downloads

Detect audio and video features in browser.

Demo

Install

npm i --save-dev detect-audio-video

Features

🖥️ Screen

  • 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()); // 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

⚙️ GPU

  • Vendor
  • Renderer
import {
    getGpuVendor,
    getGpuRenderer,
    hasHardwareAcceleration,
    isAppleSilicon,
} from 'detect-audio-video';

console.log('getGpuVendor: ', getGpuVendor()); // string, example: "Apple"
console.log('getGpuRenderer: ', getGpuRenderer()); // string, example: "Apple M1, or similar"
console.log('hasHardwareAcceleration: ', hasHardwareAcceleration()); // boolean
console.log('isAppleSilicon: ', isAppleSilicon()); // boolean

🔒 DRM

  • Microsoft PlayReady SL150, SL2000, SL3000
  • Google Widevine Modular L1, L3
  • Apple FairPlay
  • Adobe Primetime
  • HDCP

🏊 Native streaming support

  • DASH
  • HLS
  • MSS
import {
    isNativeHlsSupported,
    isNativeMpdSupported,
    isNativeMssSupported,
} from 'detect-audio-video';

console.log('isNativeMssSupported: ', isNativeMssSupported()); // boolean
console.log('isNativeHlsSupported: ', isNativeHlsSupported()); // boolean
console.log('isNativeMpdSupported: ', isNativeMpdSupported()); // boolean

HTMLVideoElement features

  • 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

📹 Video codecs

  • H.264
  • H.265 (HEVC)
  • H.266 (VVC)
  • Dolby Vision
  • EVC
  • VP8
  • VP9
  • AV1

🔊 Audio codecs

  • AAC
  • Opus
  • Vorbis
  • FLAC
  • ALAC
  • AC-3 (Dolby Digital)
  • EC-3 (Dolby Digital+)
  • Dolby Atmos

🖼️ Image formats

  • GIF
  • PNG
  • APNG
  • JPEG
  • JPEG XL
  • HEIF/HEIC
  • AVIF
  • WEBP
  • SVG
  • ICO
  • BMP
  • TIFF

🕍 Platform

  • Standalone

WebRTC

  • Support
  • Audio and video codecs

🎮 Gamepad

  • Parser for gamepad name

Links

License

MIT

4.1.0

7 months ago

4.0.0

8 months ago

3.2.1

8 months ago

3.2.0

9 months ago

3.1.0

9 months ago

3.0.0

9 months ago

2.8.0

9 months ago

2.9.1

9 months ago

2.9.0

9 months ago

2.7.0

9 months ago

2.7.2

9 months ago

2.6.1

10 months ago

2.6.0

10 months ago

2.4.1

10 months ago

2.4.0

10 months ago

2.4.2

10 months ago

2.3.1

11 months ago

2.2.1

12 months ago

2.2.0

1 year ago

2.2.2

12 months ago

2.3.0

11 months ago

2.0.1

1 year ago

2.0.0

1 year ago

2.1.0

1 year ago

1.3.0

1 year ago

1.2.0

1 year ago

1.2.1

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago

0.41.0

1 year ago

0.38.0

1 year ago

0.40.0

1 year ago

0.39.0

1 year ago

0.37.0

1 year ago

0.36.0

1 year ago

0.35.0

1 year ago

0.34.0

1 year ago

0.33.0

1 year ago

0.32.0

1 year ago

0.31.0

1 year ago

0.30.0

1 year ago

0.29.0

1 year ago

0.28.0

1 year ago

0.27.0

1 year ago

0.26.0

1 year ago

0.25.0

1 year ago

0.21.0

2 years ago

0.20.0

2 years ago

0.23.0

2 years ago

0.22.0

2 years ago

0.19.0

2 years ago

0.18.0

2 years ago

0.14.0

2 years ago

0.15.0

2 years ago

0.16.0

2 years ago

0.17.0

2 years ago

0.13.0

2 years ago

0.10.0

2 years ago

0.11.0

2 years ago

0.12.0

2 years ago

0.11.1

2 years ago

0.12.1

2 years ago

0.11.2

2 years ago

0.9.0

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago