mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 09:46:30 -05:00
Merge pull request #1282 from hedgedoc/fix-vimeo
Replace vimeo meta data api
This commit is contained in:
commit
6b95833404
1 changed files with 3 additions and 3 deletions
|
@ -294,14 +294,14 @@ export function finishView (view) {
|
|||
imgPlayiframe(this, '//player.vimeo.com/video/')
|
||||
})
|
||||
.each((key, value) => {
|
||||
const vimeoLink = `https://vimeo.com/${$(value).attr('data-videoid')}`
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: `//vimeo.com/api/v2/video/${$(value).attr('data-videoid')}.json`,
|
||||
url: `https://vimeo.com/api/oembed.json?url=${encodeURIComponent(vimeoLink)}`,
|
||||
jsonp: 'callback',
|
||||
dataType: 'jsonp',
|
||||
success (data) {
|
||||
const thumbnailSrc = data[0].thumbnail_large
|
||||
const image = `<img src="${thumbnailSrc}" />`
|
||||
const image = `<img src="${data.thumbnail_url}" />`
|
||||
$(value).prepend(image)
|
||||
if (window.viewAjaxCallback) window.viewAjaxCallback()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue