Greasy Fork is available in English.

AV1 Codec Blocker

Force websites to use alternative video codecs by blocking AV1.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name                AV1 Codec Blocker
// @icon                https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @author              ElectroKnight22
// @namespace           electroknight22_av1_codec_blocker_namespace
// @version             1.0.0
// @description         Force websites to use alternative video codecs by blocking AV1.
// @match               *://*/*
// @run-at              document-start
// @grant               none
// @inject-into         page
// @license             MIT
// ==/UserScript==

/*jshint esversion: 11 */

(function () {
    'use strict';

    // Modern Logic
    if (window.MediaSource) {
        const originalIsTypeSupported = window.MediaSource.isTypeSupported;
        window.MediaSource.isTypeSupported = function (mime) {
            if (typeof mime === 'string' && (mime.includes('av01') || mime.includes('av1'))) return false;
            return originalIsTypeSupported.call(this, mime);
        };
    }

    // Legacy Fallback Logic
    const originalCanPlayType = window.HTMLMediaElement.prototype.canPlayType;
    window.HTMLMediaElement.prototype.canPlayType = function (mime) {
        if (typeof mime === 'string' && (mime.includes('av01') || mime.includes('av1'))) return '';
        return originalCanPlayType.call(this, mime);
    };

})();