Download the PHP package sylvainjule/embed without Composer
On this page you can find all versions of the php package sylvainjule/embed. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package embed
Kirby Embed
Embed field for Kirby 3, 4 and 5. Display embeds from various media sites (Youtube, Vimeo, Souncloud, Instagram, etc.) by only providing the url to the medium. Built on top of oscarotero/Embed.
Overview
This plugin is completely free and published under the MIT license. However, if you are using it in a commercial project and want to help me keep up with maintenance, you can consider making a donation of your choice.
- 1. Installation
- 2. Blueprint usage
- 3. Options
- 4. Front-end usage
- 5. License
- 6. Credits
1. Installation
K3: up to 1.1.0, K4: up to 1.1.2, K5: 1.2.0+
Download and copy this repository to
Alternatively, you can install it with composer:
2. Blueprint usage
The plugin provides a embed
field that you can include in any blueprint:
You have access to all providers supported by oscarotero/Embed. Please note that I won't include any provider unsupported by this library.
You can optionally limit the allowed provider to one within this list : youtube
, vimeo
, flickr
, instagram
, twitter
, soundcloud
. If any other link is pasted, the field won't request the embed.
If you are using this field in a structure field, it comes with a built-in preview. You can optionally set icons: true
(default is false
) to display some providers logos in this preview.
The field also has all the url
field's options, except those which wouldn't make much sense for such a plugin (default
for example), won't fetch anything in the backstage.
3. Options
3.1. nocookie
Use privacy-enhanced URLs whenever possible (default: false
). If set to true
:
youtube.com
domain will be replaced byyoutube-nocookie.com
in the saved embed codevimeo.com
iframes will have adnt=1
parameter added in the saved embed code
In your config.php
file:
`
4. Front-end usage
The plugin provides a ->toEmbed()
method, which is useful to get all the stored data of the embed (its html code, and a few other informations detailed below).
It also allows you to make sure your embed is successfully synced before trying to access the data:
Once you have access to the structured embed, here are the options you will have access to as if they were fields (this comes handy because depending on the provider, some informations might be empty. You can therefore check them with the usual Kirby field methods, like $embed->license()->isEmpty()
).
A global site method is available to request embed data $site->getEmbedData($url)
).
5. License
MIT
6. Credits
Built on top of oscarotero/Embed.
With the help of @tristantbg. 👨💻
Kirby 2 field by @distantnative, from which I've copy-pasted some bits of this readme. 👀
All versions of embed with dependencies
guzzlehttp/psr7 Version ^2.6
embed/embed Version ^4.4