diff options
author | 2017-05-18 23:50:26 +0200 | |
---|---|---|
committer | 2017-05-18 23:50:26 +0200 | |
commit | 9e65b3027631500425b808eb98825b543273db1a (patch) | |
tree | d698d675a8be24731601be00bfaf3c26f49f2bf6 /juick-www | |
parent | db1003e7a5194d2aa34a36272291923818661f8a (diff) |
embed video and audio
Diffstat (limited to 'juick-www')
-rw-r--r-- | juick-www/src/main/js/killy/index.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/juick-www/src/main/js/killy/index.js b/juick-www/src/main/js/killy/index.js index f7eb6e5a..391ce3b6 100644 --- a/juick-www/src/main/js/killy/index.js +++ b/juick-www/src/main/js/killy/index.js @@ -86,6 +86,30 @@ function getEmbedableLinkTypes() { aNode2.appendChild(imgNode); return wrapIntoTag(aNode2, 'div'); } + }, + { + name: 'Webm and mp4 video', + id: 'embed_webm_and_mp4_videos', + ctsDefault: false, + re: /\.(webm|mp4)(?:\?[\w&;\?=]*)?$/i, + makeNode: function(aNode) { + let video = document.createElement('video'); + video.src = aNode.href; + video.setAttribute('controls', ''); + return wrapIntoTag(video, 'div', 'video'); + } + }, + { + name: 'Mp3 and ogg audio', + id: 'embed_sound_files', + ctsDefault: false, + re: /\.(mp3|ogg)(?:\?[\w&;\?=]*)?$/i, + makeNode: function(aNode) { + let audio = document.createElement('audio'); + audio.src = aNode.href; + audio.setAttribute('controls', ''); + return wrapIntoTag(audio, 'div', 'audio'); + } } ] } |