Embedding Youtube code: possible?
Dear Wackowiki insiders
Is it possible to embed a Youtube video with the code given by Youtube like this:
<iframe width="560" height="315" src="https://www.youtube.com/embed/dROLGWhCcWY" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
Thanks for any help.
Morgy
Comments
Log in or create an account to post a comment.
1. Embedding Youtube code via embed action
{{embed url="https://www.youtube.com/embed/dROLGWhCcWY" width="560" height="315"}}
2. Embedding Youtube HTML5 Video as Inline HTML
<#<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/dROLGWhCcWY" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>#>
Ensure you allowed the formatter to process Inline HTML and the CSP (Content Security Policy) to load from the media source.
['allow_rawhtml']
)config['csp']
to 2 (custom)Ответ: Embedding Youtube code: possible?
https://www.youtube.com/watch?v=sgjIQWP_8nE
https://www.youtube.com/shorts/ZB1d_3xJboY
on https://wackowiki.org/doc/Sandbox they are not playing
Re: Embedding Youtube code: possible?
embed
action example.Just use it and replace the URL with yours.
For more details please read the embed section under Actions.
Ответ: Embedding Youtube code: possible?
Links are different - the working example has
youtube-nocookie.com/embed
In my non-working -
youtube.com/watch?v=
youtube.com/shorts/
I suspect
youtu.be/
won't work eitherAny idea for make Copy-Paste links works?
Re: Embedding Youtube code: possible?
Or simply use
https://www.youtube.com/embed/HASH
https://www.youtube-nocookie.com/embed/HASH
Otherwise YouTube wont service your request.
It is possible to write an action that parses all these link combinations, takes the hash and uses finally the
embed/
link. I'm not aware of a PHP libary that will do this for a large variety of streaming providers.Ответ: Embedding Youtube code: possible?
Thank you.
Re: Embedding Youtube code: possible?
So it is possible to implement that, add a oEmbed library and action similar to the feed action.
Another option is to match all external links against the oEmbed library API in the
link()
function.Conceivable as an available extension, but would not add it to the core.