Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. MediaTrackSupportedConstraints
  4. frameRate

MediaTrackSupportedConstraints: frameRate property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨September 2017⁩.

TheMediaTrackSupportedConstraints dictionary'sframeRate property is a read-only Boolean value which ispresent (and set totrue) in the object returned byMediaDevices.getSupportedConstraints() if and only if theuser agent supports theframeRate constraint.

If the constraint isn't supported, it's not included in the list, so this value will never befalse.

TheframeRate constraint can be used to establish acceptable upper and lower bounds on the video frame rate for a new video track, or to specify an exact frame rate that must be provided for the request to succeed.Checking the value of this property lets you determine if the user agent allows constraining the video track configuration by frame rate. See theexample to see how this can be used.

Value

This property is present in the dictionary if the user agent supports theframeRate constraint.If the property isn't present, the user agent doesn't allow specifying limits on the frame rate for video tracks.

Note:If this property is present, its value is alwaystrue.

Examples

This simple example looks to see if your browser supports constraining the frame rate when requesting video tracks.

JavaScript

js
const result = document.getElementById("result");const supported = navigator.mediaDevices.getSupportedConstraints().frameRate;result.textContent = supported ? "Supported!" : "Not supported!";

HTML

html
<div></div>

CSS

css
#result {  font:    14px "Arial",    sans-serif;}

Result

The output, showing if your browser supports theframeRate constraint, is:

While this example is trivial, you can replace the simple output of "Supported" vs."Not supported" with code to provide alternative methods for presenting the audiovisual information you want to share with the user or otherwise work with.

Specifications

Specification
Media Capture and Streams
# dom-mediatrackconstraintset-framerate

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp