From: Andrew Dolgov Date: Mon, 13 Feb 2017 16:21:38 +0000 (+0300) Subject: add af_zz_vidmute X-Git-Tag: 17.4~33 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=61570c474b432fde7f092326ef867364c0939ecd;p=tt-rss.git add af_zz_vidmute --- diff --git a/plugins/af_zz_vidmute/init.js b/plugins/af_zz_vidmute/init.js new file mode 100644 index 00000000..8968792a --- /dev/null +++ b/plugins/af_zz_vidmute/init.js @@ -0,0 +1,25 @@ +require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) { + ready(function () { + PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED_CDM, function (row) { + if (row) { + + row.select("video").each(function (v) { + v.setAttribute("muted", true); + }); + } + + return true; + }); + + PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED, function (row) { + if (row) { + + row.select("video").each(function (v) { + v.setAttribute("muted", true); + }); + } + + return true; + }); + }); +}); \ No newline at end of file diff --git a/plugins/af_zz_vidmute/init.php b/plugins/af_zz_vidmute/init.php new file mode 100644 index 00000000..e1da850d --- /dev/null +++ b/plugins/af_zz_vidmute/init.php @@ -0,0 +1,24 @@ +host = $host; + } + + function get_js() { + return file_get_contents(__DIR__ . "/init.js"); + } + + function api_version() { + return 2; + } + +} +?>