add af_zz_vidmute

This commit is contained in:
Andrew Dolgov 2017-02-13 19:21:38 +03:00
parent 093d463320
commit 61570c474b
2 changed files with 49 additions and 0 deletions

View File

@ -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;
});
});
});

View File

@ -0,0 +1,24 @@
<?php
class Af_Zz_VidMute extends Plugin {
private $host;
function about() {
return array(1.0,
"Mute audio in HTML5 videos",
"fox");
}
function init($host) {
$this->host = $host;
}
function get_js() {
return file_get_contents(__DIR__ . "/init.js");
}
function api_version() {
return 2;
}
}
?>