ttrss/plugins/af_zz_vidmute/init.js

20 lines
462 B
JavaScript
Raw Normal View History

2021-03-10 15:23:34 +00:00
/* global require, PluginHost */
2017-02-13 16:21:38 +00:00
require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) {
2021-03-10 15:23:34 +00:00
function mute(row) {
[...row.querySelectorAll("video")].forEach((vid) => { vid.muted = true; });
}
2017-02-13 16:21:38 +00:00
ready(function () {
PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED_CDM, function (row) {
2021-03-10 15:23:34 +00:00
mute(row);
2017-02-13 16:21:38 +00:00
return true;
});
PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED, function (row) {
2021-03-10 15:23:34 +00:00
mute(row);
2017-02-13 16:21:38 +00:00
return true;
});
});
});