]>
Commit | Line | Data |
---|---|---|
1dbc8d60 AD |
1 | dojo.addOnLoad(function() { |
2 | PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED_CDM, function(row) { | |
3 | if (row) { | |
4 | console.log("af_zz_noautoplay!"); | |
5 | console.log(row); | |
6 | ||
7 | var videos = row.getElementsByTagName("video"); | |
8 | console.log(row.innerHTML); | |
9 | ||
10 | for (i = 0; i < videos.length; i++) { | |
11 | ||
12 | videos[i].removeAttribute("autoplay"); | |
13 | videos[i].pause(); | |
14 | videos[i].onclick = function() { | |
15 | this.paused ? this.play() : this.pause(); | |
16 | } | |
17 | } | |
18 | } | |
19 | ||
20 | return true; | |
21 | }); | |
22 | ||
23 | PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED, function(row) { | |
24 | if (row) { | |
25 | var videos = row.getElementsByTagName("video"); | |
26 | ||
27 | for (i = 0; i < videos.length; i++) { | |
28 | videos[i].removeAttribute("autoplay"); | |
29 | videos[i].pause(); | |
30 | videos[i].onclick = function() { | |
31 | this.paused ? this.play() : this.pause(); | |
32 | } | |
33 | } | |
34 | ||
35 | } | |
36 | ||
37 | return true; | |
38 | }); | |
39 | ||
40 | }); |