正如其他人所说,您应该使用可嵌入的 iframe 而不是您当前的尝试。Vimeo 为您拥有或能够(被允许)嵌入的每个视频提供此代码。
获得正确嵌入代码的另一种方法是使用他们的oEmbed端点。例如,为您的视频检索此 json:
http://vimeo.com/api/oembed.json?url=http%3A//vimeo.com/20802032
如果您不想点击它,以下是该网址提供的内容:
{
"type":"video",
"version":"1.0",
"provider_name":"Vimeo",
"provider_url":"https:\/\/vimeo.com\/",
"title":"Motion Graphics Reel 2011",
"author_name":"timurfrost",
"author_url":"http:\/\/vimeo.com\/timurfrost",
"is_plus":"1",
"html":"<iframe src=\"\/\/player.vimeo.com\/video\/20802032\" width=\"1280\" height=\"720\" frameborder=\"0\" title=\"Motion Graphics Reel 2011\" webkitallowfullscreen mozallowfullscreen allowfullscreen><\/iframe>",
"width":1280,
"height":720,
"duration":78,
"description":"Motion Graphics Reel by Timur Frost",
"thumbnail_url":"http:\/\/b.vimeocdn.com\/ts\/161\/363\/161363406_1280.jpg",
"thumbnail_width":1280,
"thumbnail_height":720,
"video_id":20802032
}
如您所见,没有理由猜测嵌入视频的正确方法。仅使用视频 url 和此数据服务的知识,您可以提交 http 请求并检索官方认可的 embed html,以及许多其他有用的信息。