getEncodableAudioCodecs()
非常实验性的功能——随时可能出现漏洞和重大更改。
在 GitHub 上跟踪进度 并在 Discord 的 #web-renderer 通道中讨论。
属于 @remotion/web-renderer 包的一部分.
🌐 Part of the @remotion/web-renderer package.
返回当前浏览器可以为指定容器格式编码的音频编解码器。
🌐 Returns the audio codecs that the current browser can encode for a given container format.
使用此功能动态显示用户其浏览器中可用的音频编解码器。
🌐 Use this function to dynamically show users which audio codecs are available in their browser.
Example usageimport {getEncodableAudioCodecs } from '@remotion/web-renderer'; constcodecs = awaitgetEncodableAudioCodecs ('mp4');console .log (codecs ); // e.g. ['aac', 'opus'] or ['opus'] on Firefox
参数
🌐 Arguments
container
string WebRendererContainer - 必填
🌐 string WebRendererContainer - required
容器格式:"mp4" 或 "webm"。
🌐 The container format: "mp4" or "webm".
options?
对象 GetEncodableAudioCodecsOptions
🌐 object GetEncodableAudioCodecsOptions
可选的配置对象。
🌐 Optional configuration object.
audioBitrate?
数字 | 字符串 WebRendererQuality
🌐 number | string WebRendererQuality
一个数字(比特每秒)或质量预设("very-low"、"low"、"medium"、"high"、"very-high")。
🌐 A number (bits per second) or quality preset ("very-low", "low", "medium", "high", "very-high").
返回值
🌐 Return value
返回一个 Promise<WebRendererAudioCodec[]>——浏览器可以编码的音频编解码器标识符数组。
🌐 Returns a Promise<WebRendererAudioCodec[]> - an array of audio codec identifiers that the browser can encode.
可能的值:"aac"、"opus"
🌐 Possible values: "aac", "opus"
Firefox 不支持 AAC 编码。在 Firefox 上,对于这两种容器都只会返回 ["opus"]。
另请参阅
🌐 See also