From 19a0893da2fab92a3258152c2248cc915e5f6f6a Mon Sep 17 00:00:00 2001 From: wlerin Date: Mon, 10 Jun 2019 14:52:44 -0700 Subject: [PATCH 1/2] Basic Streamable embedding --- src/Linkification/Embedding.coffee | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Linkification/Embedding.coffee b/src/Linkification/Embedding.coffee index 98084a655..1324d2093 100644 --- a/src/Linkification/Embedding.coffee +++ b/src/Linkification/Embedding.coffee @@ -381,6 +381,20 @@ Embedding = el: (a) -> $.el 'iframe', src: "https://www.strawpoll.me/embed_1/#{a.dataset.uid}" + , + key: 'Streamable' + regExp: /^\w+:\/\/(?:www\.)?streamable\.com\/([\w\d]+)/ + el: (a) -> + api = "https://api.streamable.com/oembed?url=https://streamable.com/#{a.dataset.uid}" + el = $.el 'iframe', + src: "https://streamable.com/o/#{a.dataset.uid}" + width: api.width + height: api.height + el.setAttribute "allowfullscreen", "true" + el + title: + api: (uid) -> "https://api.streamable.com/oembed?url=https://streamable.com/#{uid}" + text: (_) -> _.title , key: 'TwitchTV' regExp: /^\w+:\/\/(?:www\.|secure\.)?twitch\.tv\/(\w[^#\&\?]*)/ From 87b7734d81c4d734fca1e16d0da76766eab7540c Mon Sep 17 00:00:00 2001 From: wlerin Date: Mon, 10 Jun 2019 15:50:36 -0700 Subject: [PATCH 2/2] Remove misguided code --- src/Linkification/Embedding.coffee | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Linkification/Embedding.coffee b/src/Linkification/Embedding.coffee index 1324d2093..9dcc57851 100644 --- a/src/Linkification/Embedding.coffee +++ b/src/Linkification/Embedding.coffee @@ -384,14 +384,9 @@ Embedding = , key: 'Streamable' regExp: /^\w+:\/\/(?:www\.)?streamable\.com\/([\w\d]+)/ - el: (a) -> - api = "https://api.streamable.com/oembed?url=https://streamable.com/#{a.dataset.uid}" - el = $.el 'iframe', + el: (a) -> + $.el 'iframe', src: "https://streamable.com/o/#{a.dataset.uid}" - width: api.width - height: api.height - el.setAttribute "allowfullscreen", "true" - el title: api: (uid) -> "https://api.streamable.com/oembed?url=https://streamable.com/#{uid}" text: (_) -> _.title