Play videos using only the hardware decoders supported by your device. (Intercepts: canPlayType, isTypeSupported, addSourceBuffer, decodingInfo, VideoDecoder/AudioDecoder.isConfigSupported. Runs in every frame.)
Play videos using only the hardware codecs supported by your device. To do this, it runs in all frames and uses 5 capture methods:
canPlayType;
isTypeSupported;
addSourceBuffer;
decodingInfo;
VideoDecoder/AudioDecoder.isConfigSupported.
Force the use of hardware (HW) codecs only for video playback on all websites. The script prevents the use of software (SW) codecs, which put a strain on the CPU and drain the battery, especially on mobile devices. When the AllowSW=true flag is set, if a video cannot be played using a hardware (HW) codec, allow playback using a software (SW) codec after several requests for SW codecs from the player.
Key Features:
@all-frames true along with @inject-into page allows embedding into a cross-origin iframe (where technically possible).Advanced settings:
const DEBUG = false; // true = detailed logs to the console
const ClearCache = false; // true = clear the cache on the next load
const AllowSW = false; // true = Enable software if hardware is unavailable
const SW_BLOCK_THRESHOLD = 6; // Threshold for SW requests before fallback
Code to insert into the CODECS_TO_TEST array(If a new hardware codec is found that is not in the array, a message will be displayed in the console regarding this event):
vp09.00.51.08.01.01.01.01.00', // Added the detected hardware codec to speed up startup next time
Limitations (known):
@all-frames.