Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

detect-audio-video

Package Overview
Dependencies
Maintainers
0
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detect-audio-video

Detect audio and video features in browser

  • 3.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
519
increased by18.76%
Maintainers
0
Weekly downloads
 
Created
Source

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

License

MIT

Keywords

FAQs

Package last updated on 02 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc