sylvainjule / kirby-embed Goto Github PK
View Code? Open in Web Editor NEWEmbed field for Kirby 3 and 4.
Embed field for Kirby 3 and 4.
I am trying to use the field from the frontend, but I have the feeling this will not work? it appears that even if i set the input
varibale somehow (right now i am doing it by hand before i update my forms) the plugin wont work unless media: [ ]
is also populated? which would mean to code the plugin again for the frontend, if i understand correctly?
is there a way aorund this? could I save the URL via frontend form and then with some hook make the plugin retrieve all the info that it needs?
Issue:
Video previews are quite small, at least for Youtube, because they use the iframe in 'code' which is only 200 pixels wide. Sometimes a bigger preview is more practical to check easily if the correct video is added.
Suggestion:
A "cover" option could force a bigger preview size, while keeping the correct aspect ratio for any video.
My workaround:
For my needs I was able to achieve this in panel.css, as I only needed a single aspect-ratio:
.k-field-name-video_presentation .preview-content {
padding: 0;
}
.k-field-name-video_presentation .preview-content iframe {
width: 100%;
aspect-ratio: 16 / 9;
height: auto;
}
Result with my panel.css:
videos:
type: structure
fields:
name:
type: text
video:
type: embed
When using the arrows to navigating through a structure field in the panel, the video preview does not update to show the correct video despite the URL in the field changing.
Just raising a hand that there is interest in a Bandcamp-implementation. oscarotero/Embed supports Bandcamp.
Hello,
I’m relatively new to kirby and php, so excuse my perhaps simple question/problem
I'm trying to use the plugin, but I get a sync failed error when pasting a link into the panel. When I open the dev tools it says GET http://localhost:8000/api/kirby-embed/get-data?url=https://www.youtube.com/watch?v=BHvtkTeMia8 400 (Bad Request) which suggests that there may be an issue with the YouTube API key being used by the plugin. Also, I get the following error message {status: ‘error’, error: ‘Creation of dynamic property Embed\Adapters\Youtube::$url is deprecated’}
So far I only installed the plugin, included it in the blueprint
fields:
embed:
label: Video & Audio
type: embed
width: 1/2
this is in the php, but I believe that's not where things go wrong, since even if delete that part I still get an error message in the backend
<?php
if($embed = $item->embed()->toEmbed()) {
echo $embed->code();
} ?>
<p><?= $item->embed()->titel() ?></p>
thank you for helping!
Hey 👋
When I try to synchronize videos (Youtube & Vimeo) when using php 8.2 the synchronization fails.
Any idea what I can do to make it work ?
I am getting a sync failed red message on the field when trying to fetch from the url I provide to it.
Any particular reason this may be happening ?
Thank you
It would be awesome if you could provide a method to have it print a privacy enhanced URL for YouTube videos, i. e. “youtube-nocookie.com” (and whatever other provider has similar options).
hello,
i have tested all services and all of them work fine, but instagram is just not working.
the console somehow throws no errors.
I have tried removing some parts of the URL as well but no success.
https://www.instagram.com/p/Cca_3DKLZwz/?utm_source=ig_web_copy_link
(desktop link)
https://www.instagram.com/p/Cca_3DKLZwz
(removed the variables)
https://www.instagram.com/p/Cca_3DKLZwz/?igshid=YmMyMTA2M2Y=
(insta app link)
I am using kirby 3.8.1 (security update) and php 8.0.18 on the live server. on my MAMP twitter didnt work either, but on the live server it does, so not really worth mentioning it.
any help is appreciated! instagram would be an important one for our project :)
When I call $myvideo->aspectRatio()
, the result is always exactly 56.5 for Youtube videos, and 56.338 for Vimeo, whatever the real aspect ratio is.
Typical result should be something like 1.333 or 1.78.
I tested with Kirby 3.6 and 3.8, with Embed's latest version.
Workaround:
For now I use $myvideo->width()->value() / $myvideo->height()->value()
to calculate a proper aspect ratio.
When entering a video URL in the panel – instead of actual video data – the plugin stores Youtube's privacy consent information as media content:
----
Youtube:
input: >
https://www.youtube.com/watch?v=ev-00si0KhM
media:
title: Bevor Sie zu YouTube weitergehen
description: null
url: 'https://consent.youtube.com/ml?continue=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dev-00si0KhM&gl=DE&hl=de&pc=yt&uxe=23983172&src=1'
type: link
tags: [ ]
image: null
imageWidth: null
imageHeight: null
images: [ ]
code: null
feeds: [ ]
width: null
height: null
aspectRatio: null
authorName: null
authorUrl: null
providerIcon: https://www.google.com/favicon.ico
providerIcons:
-
url: https://www.google.com/favicon.ico
width: 32
height: 32
size: 1024
mime: image/x-icon
providerName: youtube
providerUrl: https://youtube.com
publishedTime: null
license: null
----
It seems to be this page that's being parsed which is currently shown when visiting Youtube for the first time from Germany (not sure about other parts of the world):
The panel displays a sync failed message:
Hello Sylvain,
i am not sure if this is really a classic issue, but i didn't know how else i could get in touch.
When i enter an url in an embed field and save it, and then delete the url again, the field is not completely empty. There remains an emtpy input and media info.
With this, i cannot check if the field is "->isNotEmpty()", because for kirby there is always a value in there.
Is there a way around this?
Greetings and thanks for the wonderful plugin,
Matthias
the plugin is not loading when kirby-cms-path and kirby-plugin-path are set in composer json, consider using the load helper: https://getkirby.com/docs/guide/plugins/plugin-setup-autoloader
Missing composer.json version
working locally but as soon as puched to staging or production on apache server, it's not working.
error: sync failed in the admin panel;
K4.2.0
PHP8.3.6
Dear Sylvain,
i have used your very helpful plugin for a website that is hosted on Strato (https://www.strato.de) and for reasons i cannot comprehend, it stopped working. I can paste a vimeo Url into the field, but nothing happens and if save the page then, the embed-field disappears after reloading the panel page.
Since this came to light while updating the kirby version from 3.9.8.1 to 4.1.1 i was wondering if that would be the issue, but i have not being able to make the plugin work with older kirby versions.
I tested the setup (kirby starterkit with the embed plugin) on my own server (Hetzner) and it worked fine with kirby 3.9 and 4.1.1. So the reason seems to be located in a difference between the 2 hoster.
The only real difference and infos that i have are these:
php versions: Hetzner (working): 8.2.16 / Strato (not working) 8.2.15
If i use on Strato kirby v4.1.1 there is no error message when i paste a vimeo URL (for example: https://vimeo.com/224201603) and nothing changes. If i save the page then and reload, the Embed field is gone.
If i use kirby 3.9.8.1 i get an error while pasting the Url: this.isValidUrl is not a function
Other than that, i am pretty unsure what causes the problem... Have you heard anything about this?
I would be happy to use the plugin on the website :)
Greetings,
Matthias
I ran into an issue with my own Vimeo panel-implementation and learnt about your plugin. It looks really great but it seems to have the same issue as mine in regards to private Vimeo videos:
When trying to embed a private video from Vimeo (hidden from Vimeo but safelisted for a specific domain) the plugin throws a sync error. The video is however embeddable on the front-end as expected, the domains are the same. I therefor assume that the panel gets in the way, somehow blocking the necessary referrer.
Do you have any idea what might be the cause and how to circumvent it?
Not so much an issue but more of a feature request: would it be possible/feasible to display the video title instead of the plain URL in the structure preview?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.