0

Hi I develope one website using codeigniter and bootstrap i upload the youtube url in my admin page and get that url in my view page using iframe and load that url. But the youtube video is not showing When I Inspect the website the error is showing like

Refused to display 'https://www.youtube.com/watch?v=7Ct59FQIbAU' in a frame because it set 'X-Frame-Options' to 'sameorigin'. advertisement:522 GET https://www.youtube.com/watch?v=7Ct59FQIbAU net::ERR_BLOCKED_BY_RESPONSE

When i inspect this website the url is showing but the video is not showing.. This is that website url www.clicx.in/pixelerror

In my local server its working

The view code is

<div class="container">
<div class="row">
<?php foreach($advertisement as $ad) { ?>
<!-- 4:3 aspect ratio -->
<div class="embed-responsive embed-responsive-4by3">
  <iframe class="embed-responsive-item" src="<?php echo $ad->url?>"></iframe>
</div> 
<?php }?>
    </div>  
</div>
Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85
pixel
  • 65
  • 2
  • 8

1 Answers1

5

When you're embedding video you shouldn't COPY and PASTE the video URL on tab.

You should do something like this

<iframe width="560" height="315" src="https://www.youtube.com/embed/7Ct59FQIbAU" frameborder="0" allowfullscreen></iframe>

enter image description here


When I saw your code there was something like this

enter image description here

I was wonder how it's worked on your localhost ?? :/

Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85
  • This is a cms website i add the video url in my admin page and just call that url in my view area... If I use normal coding its working fine... – pixel May 04 '17 at 12:34