Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Refused to display 'http://vimeo.com/27577981' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'

I am trying to embed a video in embed tag But I am getting this error :

Refused to display 'http://vimeo.com/27577981' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

for youtube link : http://www.youtube.com/watch?v=zBEYR69o2Ao when i replace watch?v= with embed/ , it runs fine. But its is not necessary that video will be of youtube. So I want a unique solution for this.

like image 371
Rishi Avatar asked Jul 12 '13 11:07

Rishi


People also ask

How do I set X Frame options in HTML?

Double-click the HTTP Response Headers icon in the feature list in the middle. In the Actions pane on the right side, click Add. In the dialog box that appears, type X-Frame-Options in the Name field and type SAMEORIGIN in the Value field. Click OK to save your changes.

How do I embed a Vimeo video in HTML?

3 Steps To Embed a Vimeo VideoStep 1: Click on the share button that sits under the video. Step 2: Copy the Embed code. Step 3: Paste the Embed code into your website.

How do I embed a Vimeo video without iFrame?

Simply put, if you want to embed Vimeo without iFrame, you will first need to click on the share button of the video. From there, a window will pop up, and you can click on the Show options button to use the old embed code choice to proceed with the project.

How do I get an embed code from Vimeo?

Go to Vimeo and find the video you want to embed. Once you are on the page, locate the share button on or below the video. After selecting Share a new window will open. The copied Embed Code can then be pasted in the Embed URL field for the Gallery Video content type.


2 Answers

I had the similiar problem
solution:
in short (at the moment) the embed url is:

//player.vimeo.com/video/

instead of:

//vimeo.com/27577981

for instance:

<iframe src="//player.vimeo.com/video/27577981?portrait=0" class="ivid" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

but as Quentin said check the vimeo documentation: http://developer.vimeo.com/player/embedding

like image 133
Picard Avatar answered Sep 22 '22 17:09

Picard


As the error message says, you can't embed that page in a frame. Vimeo provide documentation on how to embed their player. Follow that.

<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>
like image 41
Quentin Avatar answered Sep 19 '22 17:09

Quentin