Add Dailymotion embedding.

This commit is contained in:
ccd0 2016-02-12 21:19:02 -08:00
parent a7ff93d53f
commit 60711a54e1
3 changed files with 12 additions and 1 deletions

View File

@ -133,7 +133,7 @@ Config =
]
'Link Title': [
true
'Replace the link of a supported site with its actual title. Currently supported: YouTube, Vimeo, SoundCloud, and Github gists.'
'Replace the link of a supported site with its actual title. Currently supported: YouTube, Vimeo, Dailymotion, SoundCloud, and Github gists.'
1
]
'Embedding': [

View File

@ -173,6 +173,17 @@ Embedding =
controls: true
preload: 'auto'
src: a.dataset.href
,
key: 'Dailymotion'
regExp: /^\w+:\/\/(?:(?:www\.)?dailymotion\.com\/(?:embed\/)?video|dai\.ly)\/([A-Za-z0-9]+).*((?:\?.*)?)/
style: 'border: none; width: 640px; height: 360px;'
el: (a) ->
options = if (start = a.dataset.options.match /[?&](start=\d+)/) then "?#{start[1]}" else ''
$.el 'iframe',
src: "//www.dailymotion.com/embed/video/#{a.dataset.uid}#{options}"
title:
api: (uid) -> "https://api.dailymotion.com/video/#{uid}"
text: (_) -> _.title
,
key: 'Gist'
regExp: /^\w+:\/\/gist\.github\.com\/(?:[\w\-]+\/)?(\w+)/

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B