2016-08-10 07:01:05 +00:00
|
|
|
require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) {
|
|
|
|
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();
|
|
|
|
}
|
2015-07-31 10:42:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-10 07:01:05 +00:00
|
|
|
return true;
|
|
|
|
});
|
2015-07-31 10:42:22 +00:00
|
|
|
|
2016-08-10 07:01:05 +00:00
|
|
|
PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED, function (row) {
|
|
|
|
if (row) {
|
|
|
|
var videos = row.getElementsByTagName("video");
|
2015-07-31 10:42:22 +00:00
|
|
|
|
2016-08-10 07:01:05 +00:00
|
|
|
for (i = 0; i < videos.length; i++) {
|
|
|
|
videos[i].removeAttribute("autoplay");
|
|
|
|
videos[i].pause();
|
|
|
|
videos[i].onclick = function () {
|
|
|
|
this.paused ? this.play() : this.pause();
|
|
|
|
}
|
2015-07-31 10:42:22 +00:00
|
|
|
}
|
2016-08-10 07:01:05 +00:00
|
|
|
|
2015-07-31 10:42:22 +00:00
|
|
|
}
|
|
|
|
|
2016-08-10 07:01:05 +00:00
|
|
|
return true;
|
|
|
|
});
|
2015-07-31 10:42:22 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|