What the browser can play, from Media Capabilities and canPlayType.
A configuration is a map of the keys of MediaDecodingConfiguration, e.g.
{:type :file :audio {:content-type "audio/mpeg" :bitrate 128000}}
On its own, Media Capabilities refuses some of the commonest files:
So where it says no or rejects a configuration, the answer also has canPlayType's, and playable? accepts either.
What the browser can play, from Media Capabilities and canPlayType.
A configuration is a map of the keys of MediaDecodingConfiguration, e.g.
{:type :file :audio {:content-type "audio/mpeg" :bitrate 128000}}
On its own, Media Capabilities refuses some of the commonest files:
- WebKit says it can't play MP3, and Firefox rejects the configuration.
- Every engine refuses audio/mp4 without codecs, which is how most
podcast feeds give AAC.
- Every engine rejects a video without its width, height, bitrate and
frame rate.
So where it says no or rejects a configuration, the answer also has
canPlayType's, and playable? accepts either.(can-play-type content-type)The answer of canPlayType for the content-type: :probably, :maybe, or
nil for no. Outside a browser, it's nil too.
The answer of canPlayType for the `content-type`: :probably, :maybe, or nil for no. Outside a browser, it's nil too.
(decoding-info! configuration)A promise of the browser's answer to whether it can play the
configuration. The promise never rejects.
The answer has :supported, :smooth and :power-efficient from Media Capabilities. Unless it supports the configuration, the answer also has :can-play-type, from canPlayType, e.g.
{:supported false :smooth false :power-efficient false
:can-play-type :maybe}
For a configuration of both audio and video, :can-play-type is the weaker of the two answers.
A promise of the browser's answer to whether it can play the
`configuration`. The promise never rejects.
The answer has :supported, :smooth and :power-efficient from Media
Capabilities. Unless it supports the configuration, the answer also has
:can-play-type, from canPlayType, e.g.
{:supported false :smooth false :power-efficient false
:can-play-type :maybe}
For a configuration of both audio and video, :can-play-type is the
weaker of the two answers.(decoding-infos! configurations)A promise of a map from each of the configurations to its answer from
decoding-info!.
A promise of a map from each of the `configurations` to its answer from decoding-info!.
(playable? {:keys [supported can-play-type] :as info})Whether info, an answer from decoding-info!, says the browser can play
the configuration, i.e. Media Capabilities supports it, or canPlayType
says :probably or :maybe.
Whether `info`, an answer from decoding-info!, says the browser can play the configuration, i.e. Media Capabilities supports it, or canPlayType says :probably or :maybe.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |