vimeo oEmbed 이용법

Tags
1. 해당 video의 oEmbed response를 먼저 얻고,
GET https://vimeo.com/api/oembed.json?url={video_url}
# 테스트 $ curl -XGET https://vimeo.com/api/oembed.json?url=https://vimeo.com/479517196&responsive=true&speed=true # 결과 { "type":"video", "version":"1.0", "provider_name":"Vimeo", "provider_url":"https:\/\/vimeo.com\/", "html":"<iframe src=\"https:\/\/player.vimeo.com\/video\/479517196?app_id=122963\" width=\"1280\" height=\"720\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen><\/iframe>", "width":1280, "height":720, "domain_status_code":403, "video_id":479517196, "uri":"\/videos\/479517196" }
 
 
2. 동영상 임베드하기
response의 html 필드를 추출해서 body에 담으면 됨.
<html> <head> <title>{page_title}</title> </head> <body> <iframe src="https://player.vimeo.com/video/{video_id}" width="{video_width}" height="{video_height}" frameborder="0" title="{video_title}" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> </body> </html>
notion image