feat(scrcpy): add isSupported method toWebCodecDecoder

This commit is contained in:
Simon Chan 2023-05-25 23:01:02 +08:00
parent d286a40c42
commit d421502256
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD
2 changed files with 5 additions and 1 deletions

View file

@ -27,6 +27,10 @@ function toUint32Le(data: Uint8Array, offset: number) {
}
export class WebCodecsDecoder implements ScrcpyVideoDecoder {
public static isSupported() {
return typeof globalThis.VideoDecoder !== "undefined";
}
public static readonly capabilities: Record<
string,
ScrcpyVideoDecoderCapability