You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
855 B
JavaScript
40 lines
855 B
JavaScript
9 years ago
|
dojo.addOnLoad(function() {
|
||
|
PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED_CDM, function(row) {
|
||
|
if (row) {
|
||
|
console.log("af_zz_noautoplay!");
|
||
|
console.log(row);
|
||
|
|
||
|
var videos = row.getElementsByTagName("video");
|
||
|
console.log(row.innerHTML);
|
||
|
|
||
|
for (i = 0; i < videos.length; i++) {
|
||
|
|
||
|
videos[i].removeAttribute("autoplay");
|
||
|
videos[i].pause();
|
||
|
videos[i].onclick = function() {
|
||
|
this.paused ? this.play() : this.pause();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
});
|
||
|
|
||
|
PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED, function(row) {
|
||
|
if (row) {
|
||
|
var videos = row.getElementsByTagName("video");
|
||
|
|
||
|
for (i = 0; i < videos.length; i++) {
|
||
|
videos[i].removeAttribute("autoplay");
|
||
|
videos[i].pause();
|
||
|
videos[i].onclick = function() {
|
||
|
this.paused ? this.play() : this.pause();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
});
|
||
|
|
||
|
});
|