mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-26 11:43:59 -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/')
|
imgPlayiframe(this, '//player.vimeo.com/video/')
|
||||||
})
|
})
|
||||||
.each((key, value) => {
|
.each((key, value) => {
|
||||||
|
const vimeoLink = `https://vimeo.com/${$(value).attr('data-videoid')}`
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
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',
|
jsonp: 'callback',
|
||||||
dataType: 'jsonp',
|
dataType: 'jsonp',
|
||||||
success (data) {
|
success (data) {
|
||||||
const thumbnailSrc = data[0].thumbnail_large
|
const image = `<img src="${data.thumbnail_url}" />`
|
||||||
const image = `<img src="${thumbnailSrc}" />`
|
|
||||||
$(value).prepend(image)
|
$(value).prepend(image)
|
||||||
if (window.viewAjaxCallback) window.viewAjaxCallback()
|
if (window.viewAjaxCallback) window.viewAjaxCallback()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue