Add support for ted.com

This commit is contained in:
Brad Dougherty
2018-04-17 18:50:35 -04:00
parent 8fb4ea3023
commit 4f3eae5522
2 changed files with 22 additions and 0 deletions

View File

@@ -92,6 +92,8 @@
<string>*.stream.cz</string>
<string>streamable.com</string>
<string>*.streamable.com</string>
<string>ted.com</string>
<string>*.ted.com</string>
<string>theonion.com</string>
<string>*.theonion.com</string>
<string>twitch.tv</string>

View File

@@ -703,6 +703,26 @@ const resources = {
},
},
'ted': {
buttonClassName: 'z-i:0 pos:r bottom:0 hover/bg:white.7 b-r:.1 p:1 cur:p',
buttonElementType: 'div',
buttonInsertBefore: function(/** Element */ parent) {
return parent.lastChild;
},
buttonParent: function() {
const playButton = document.querySelector('[aria-controls="video1"]');
return playButton.parentElement.parentElement;
},
buttonDidAppear: function() {
const img = button.querySelector('img');
img.classList.add('w:2');
img.classList.add('h:2');
},
videoElement: function() {
return document.querySelector('video[id^="ted-player-"]');
}
},
'theonion': {
buttonClassName: 'jw-icon jw-icon-inline jw-button-color jw-reset jw-icon-logo',
buttonElementType: 'div',