# Embed v3 – easily embed your media sources!

**URL:** <https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036>\
**Category:** Plugins\
**Created:** [March 22, 2017, 2:18pm UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036 "2017-03-22T14:18:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [March 22, 2017, 2:18pm UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/1 "2017-03-22T14:18:02Z")

</div>

![](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/c/c18565fe4a65cd0a0f9f80f42e24229d50f2269f.png)

Embed (formerly known as the oEmbed plugin) has arrived in version 3. Besides the rename, most changes happened under the hood in the library ([oscarotero/Embed](https://github.com/oscarotero/Embed)) that the plugin is based on.

# Embed your media!

After installing the plugin, you can easily turn any field with a media url into embed code by just applying the field method to it:

```php
<?= $page->tweet()->embed(); ?>

```

Or you use the Kirbytext tag:

```ini
(embed: https://vimeo.com/43444347)

```

 ![](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/6/6ad99b049fd0ae6e0a2adf94a99e1475794cc48f.png)

Embed also comes with its own **panel field** which offers instant preview of the embedded media. A quick sneak peak:

[![](http://nhoffmann.com/remote/github/embed/field.gif) ](http://nhoffmann.com/remote/github/embed/field.gif)

Due to my current job, I cannot invest a lot of time into my plugins, but I try to keep them updated steadily. I hope you enjoy it - suggestions always welcome!

### Documentation & Download

> **[distantnative/embed](https://github.com/distantnative/embed)**
>
> Media embed plugin for Kirby 2 CMS. Contribute to distantnative/embed development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![CallumND](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@CallumND](https://forum.getkirby.com/u/CallumND)\
**Post date:** [July 11, 2017, 2:31pm UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/2 "2017-07-11T14:31:25Z")

</div>

How could I implement a way to do multiple vimeo embeds through the panel?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [July 11, 2017, 2:33pm UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/3 "2017-07-11T14:33:45Z")

</div>

You can either use multiple embed tags in a textarea field, or use a structure field (or multi-select field), depending on use case.

---

<div class="post-metadata">

**Author:** ![CallumND](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@CallumND](https://forum.getkirby.com/u/CallumND)\
**Post date:** [July 11, 2017, 2:47pm UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/4 "2017-07-11T14:47:13Z")

</div>

Structure field is most appropriate for this case. Say if I have a blueprint like this:

```
vimeolinks:
    label: Vimeo Links
    type: structure
    entry: >
      {{vimeovid}}<br />
    fields:
      vimeovid:
        label: Vimeo
        type: text

```

How do I use the `->embed()` tag with it?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [July 11, 2017, 2:59pm UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/5 "2017-07-11T14:59:35Z")

</div>

Should be like in the readme, only within a loop:

```auto
<?php
$entries = $page->vimeolinks()->structure();
foreach($entries as $entry) 
{
  echo $entry->vimeovid()->embed();
}
?>

```

(not tested)

---

<div class="post-metadata">

**Author:** ![daybugging](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@daybugging](https://forum.getkirby.com/u/daybugging)\
**Post date:** [November 27, 2017, 10:02am UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/6 "2017-11-27T10:02:17Z")

</div>

Sadly, it doesn’t work in production for me at all - I checked the requirements, which are all met (cURL, PHP version, …) - at first I thought this only affects Soundcloud, but YouTube and others, too - any idea on how to debug this?

 ![embed](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/c/cc49bab822934b080408ec2672fda5c9dcac0fa2.png)

Greatly appreciated!

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 27, 2017, 11:37am UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/7 "2017-11-27T11:37:13Z")

</div>

Anything in your console?

---

<div class="post-metadata">

**Author:** ![daybugging](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@daybugging](https://forum.getkirby.com/u/daybugging)\
**Post date:** [November 27, 2017, 7:14pm UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/8 "2017-11-27T19:14:24Z")

</div>

Nothing, and nothing in Apache and PHP error logs either …

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 27, 2017, 7:16pm UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/9 "2017-11-27T19:16:45Z")

</div>

So, what I see in the screenshot is what you get in your website? Meaning: the kirbytag is not rendered at all?

---

<div class="post-metadata">

**Author:** ![daybugging](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@daybugging](https://forum.getkirby.com/u/daybugging)\
**Post date:** [November 27, 2017, 7:21pm UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/10 "2017-11-27T19:21:04Z")

</div>

That’s true, nothing to see here. I mean, I could try to use the template tag, but for my client that would be a nightmare …

// Edit:  
There’s also a github issue stating that it doesn’t work for them in production, but no answer by @distantnative so far - which I can totally understand, given his many contributions to the open source world AND means to earn money 😉

I’ll try older versions and check if they lead somewhere.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 27, 2017, 7:23pm UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/11 "2017-11-27T19:23:01Z")

</div>

But if it does not get rendered, I’d assume that the plugin is missing. Otherwise, you would see some results, even if there are no videos.

---

<div class="post-metadata">

**Author:** ![daybugging](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@daybugging](https://forum.getkirby.com/u/daybugging)\
**Post date:** [November 27, 2017, 7:38pm UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/12 "2017-11-27T19:38:24Z")

</div>

Alright, after long time playing with it, here goes: there was no cache directory present. Eventually when using other template methods to invoke the plugin, Whoops complained.

Solved…

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 27, 2017, 7:40pm UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/13 "2017-11-27T19:40:50Z")

</div>

Ah, yes, is that issue mentioned in the plugin docs?

---

<div class="post-metadata">

**Author:** ![daybugging](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@daybugging](https://forum.getkirby.com/u/daybugging)\
**Post date:** [November 27, 2017, 7:44pm UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/14 "2017-11-27T19:44:40Z")

</div>

Searching for ‘cache’ returns only a commit title - so no …

---

<div class="post-metadata">

**Author:** ![daybugging](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@daybugging](https://forum.getkirby.com/u/daybugging)\
**Post date:** [November 27, 2017, 8:47pm UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/15 "2017-11-27T20:47:29Z")

</div>

So now stuff gets rendered, but clicking the play button (`<img>`) doesn’t work - will this never end!

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 27, 2017, 8:58pm UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/16 "2017-11-27T20:58:44Z")

</div>

With a nick like yours, it’s probably your fate to spend your day debugging…so no.

---

<div class="post-metadata">

**Author:** ![S1SYPHOS](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/s1syphos/32/3671_2.png) [@S1SYPHOS](https://forum.getkirby.com/u/S1SYPHOS)\
**Post date:** [November 28, 2017, 11:12am UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/17 "2017-11-28T11:12:14Z")

</div>

First of all, I like this plugin, thank you very much!  
Second, I don’t get it to run, just like @daybugging everything works (including backend preview), but hitting ‘PLAY’ doesn’t do anything.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 28, 2017, 11:31am UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/18 "2017-11-28T11:31:47Z")

</div>

Is the cache folder writable?

---

<div class="post-metadata">

**Author:** ![S1SYPHOS](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/s1syphos/32/3671_2.png) [@S1SYPHOS](https://forum.getkirby.com/u/S1SYPHOS)\
**Post date:** [November 28, 2017, 11:34am UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/19 "2017-11-28T11:34:15Z")

</div>

Found out what it was, eventually - since lazyload is activated by default, the `<iframe>` sets the URL as data-src - not including embed’s JS leads to not being able to play it.

But thanks for asking.

---

<div class="post-metadata">

**Author:** ![daybugging](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@daybugging](https://forum.getkirby.com/u/daybugging)\
**Post date:** [November 30, 2017, 8:13pm UTC](https://forum.getkirby.com/t/embed-v3-easily-embed-your-media-sources/7036/20 "2017-11-30T20:13:18Z")

</div>

That solved it for me, too … thx for sharing
