# אפשרות להצגת סרטוני PeerTube ב-onebox דרך הגדרת iframes מורשים

**URL:** https://meta.discourse.org/t/allowing-peertube-video-oneboxes-via-the-allowed-iframes-setting/171486
**Category:** Support
**Created:** [27 בנובמבר,‏ 2020,‏ 11:53am UTC](https://meta.discourse.org/t/allowing-peertube-video-oneboxes-via-the-allowed-iframes-setting/171486 "2020-11-27T11:53:22Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [27 בנובמבר,‏ 2020,‏ 11:53am UTC](https://meta.discourse.org/t/allowing-peertube-video-oneboxes-via-the-allowed-iframes-setting/171486/1 "2020-11-27T11:53:22Z")

</div>

Continuing the discussion from [Peertube embedding?](https://meta.discourse.org/t/peertube-embedding/102687):

Trying to add a PeerTube instance to the `allowed_onebox_iframes` I get the following error: invalid choice. Hmm, what? How to solve this?

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/1/51b7d6d7386038ba8c1cef790711962600109abd.png)

## Tip / Caveat for embedding Peertube videos

Use `https://peertube.instance.example/videos` in the `allowed_iframes` site setting to support both cases of `/videos/watch/<uuid>` and `/videos/embed/<uuid>`, the latter being used by the peertube onebox when you paste the former!

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [27 בנובמבר,‏ 2020,‏ 12:07pm UTC](https://meta.discourse.org/t/allowing-peertube-video-oneboxes-via-the-allowed-iframes-setting/171486/2 "2020-11-27T12:07:04Z")

</div>

In the “allowed onebox iframes” list, you can only pick from pre-defined domains which are provided by the onebox gem.

If you want to allow iframes from other domains, use the “allowed iframes” setting

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [27 בנובמבר,‏ 2020,‏ 12:11pm UTC](https://meta.discourse.org/t/allowing-peertube-video-oneboxes-via-the-allowed-iframes-setting/171486/3 "2020-11-27T12:11:14Z")

</div>

Ack, thank you.

I was trying to onebox a video from Peertube. It used to work just by pasting the link, and I do have the correct `allowed_iframes` entry. I’m a bit lost with recent changes with CSP that seem to break on new instances but not old ones.

Like, this link `https://peertube.public.cat/videos/watch/392c393e-1fde-4356-bb25-8a92e7ce2057` used to show a video…

[https://peertube.public.cat/videos/watch/392c393e-1fde-4356-bb25-8a92e7ce2057](https://peertube.public.cat/videos/watch/392c393e-1fde-4356-bb25-8a92e7ce2057)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [27 בנובמבר,‏ 2020,‏ 12:18pm UTC](https://meta.discourse.org/t/allowing-peertube-video-oneboxes-via-the-allowed-iframes-setting/171486/4 "2020-11-27T12:18:52Z")

</div>

It works on my test site once I add it to the allowed iframes setting:

 ![Screenshot 2020-11-27 at 12.18.24](https://global.discourse-cdn.com/meta/original/3X/8/0/806cf011262c8e7036953b0328c1d45fb18615bd.jpeg)

What value are you adding to `allowed_iframes`?

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [27 בנובמבר,‏ 2020,‏ 12:25pm UTC](https://meta.discourse.org/t/allowing-peertube-video-oneboxes-via-the-allowed-iframes-setting/171486/5 "2020-11-27T12:25:16Z")

</div>

`https://peertube.public.cat/videos/watch/`

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [27 בנובמבר,‏ 2020,‏ 12:28pm UTC](https://meta.discourse.org/t/allowing-peertube-video-oneboxes-via-the-allowed-iframes-setting/171486/6 "2020-11-27T12:28:02Z")

</div>

Ah, remove the `/watch` from the end and it should work. The iframe URLs look like

```plaintext
https://peertube.public.cat/videos/embed/392c393e-1fde-4356-bb25-8a92e7ce2057

```

I added this value to my settings:

```plaintext
https://peertube.public.cat/videos

```

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [27 בנובמבר,‏ 2020,‏ 12:30pm UTC](https://meta.discourse.org/t/allowing-peertube-video-oneboxes-via-the-allowed-iframes-setting/171486/7 "2020-11-27T12:30:05Z")

</div>

You rock! I did not think about the `embed` case.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [27 בדצמבר,‏ 2020,‏ 12:30pm UTC](https://meta.discourse.org/t/allowing-peertube-video-oneboxes-via-the-allowed-iframes-setting/171486/8 "2020-12-27T12:30:07Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
