blob: c7c11383e692f6de93ae793350adc6b642ef2195 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
/* global require, PluginHost */
require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) {
function unpreload(vid) {
vid.setAttribute("preload", "none");
}
function unpreload_all(row) {
[...row.querySelectorAll("video")].forEach((vid) => unpreload(vid));
}
ready(function () {
PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED_CDM, function (row) {
unpreload_all(row);
return true;
});
PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED, function (row) {
unpreload_all(row);
return true;
});
});
});
|