Banshee
the secure PHP framework

Forum

Cannot embed Youtube video

samiux
4 february 2018, 22:54
Version : 6.1 on Ubuntu 16.04.3

When I embed Youtube video in Banshee, it cannot display. I use Hiawatha as well.

Any idea?
Hugo Leisink
5 february 2018, 10:31
No. Perhaps you did the embedding wrong?
samiux
5 february 2018, 10:55
I copied from the Youtube site. The area is blanked and no video can be displayed.
samiux
5 february 2018, 15:22
I tried to embed Vimeo video and it is failed to display the video too.

Joe Schmoe
5 february 2018, 16:28
This seems familiar. Does it have anything to do with the security headers in libraries/core/view.php?
Hugo Leisink
5 february 2018, 17:18
Good point Joe, that might be it. Samiux, uncomment the header() instruction for the Content-Security-Policy header. It's somewhere around line 611.
samiux
5 february 2018, 17:53
Hugo and Joe,
Thanks.
chapchap70
4 march 2018, 20:55
Thanks for this; just commented out line 611 in the referenced file in order to see the Open Street Map iframe in my Directions and Map page.

I guess the CustomHeader = X-Frame-Options: sameorigin setting in Hiawatha takes care of the security concern somewhat of having frames originating from other sites?
Hugo Leisink
6 march 2018, 20:44
Yes, that header should prevent browser from loading your website in a frame.
geverwills
2 march 2021, 08:04
You cannot display a lot of websites inside an iFrame. Reason being that they send an "X-Frame-Options: SAMEORIGIN" response header. This option prevents the browser from displaying iFrames that are not hosted on the same domain as the parent page.

I faced the same error when displaying youtube links. For example: https://www.youtube.com/watch?v=8WkuChVeL0s

I replaced watch?v= with embed/ so the valid link will be: https://www.youtube.com/embed/8WkuChVeL0s

It works well.

Try to apply the same rule on your case.

SAMEORIGIN

The page can only be displayed in a frame on the same origin as the page itself. The spec leaves it up to browser vendors to decide whether this option applies to the top level, the parent, or the whole chain, although it is argued that the option is not very useful unless all ancestors are also in the same origin.

http://net-informations.com/q/mis/youtube.html
Message preview

The following BB-codes are available in a message:

  • [b]Bold text[/b]
  • [center]Center text or imagen[/center]
  • [color=color name or #RGB code]Colored text[/color]
  • [i]Italic text[/i]
  • [img]Link to image[/img]
  • [right]Align text or image right[/right]
  • [s]Strike-through text[/s]
  • [size=pixelsize]Big or small text[/size]
  • [u]Underlined text[/u]
  • [url]Link to website[/url]
  • [url=link to website]Link text[/url]