Forum

Thread tagged as: Question, Problem

Youtube iframe not showing, only link is output

Hello,

I am trying to add a youtube video to a blog post. I have set my youtube api key in the config file, and I have added a content field to my post.html:

<perch:blog id="video" type="youtube" width="743" height="387" label="YouTube URL" output="embed" showinfo="0" autoplay="1" modestbranding="1" />

The only thing that is outputting now is the youtube link, no iframe embed.

What am I doing wrong?

Mike

Mike Hendriks

Mike Hendriks 0 points

  • 2 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Try output="html"

That also outputs only the youtube link, but I would like to have the iframe embedded video.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Whose YouTube field type are you using?

Sorry, I don't know what you mean by 'whose type'. I am trying to replicate this: https://docs.grabaperch.com/addons/field-types/youtube/

Drew McLellan

Drew McLellan 2638 points
Perch Support

So the answer is you're using mine!

Have you tried with other videos? Does this one allow embedding? Do you see the embedded preview on the edit page?

Yes, I have tried multiple videos, and the video allows embedding. On the edit page I don't see an embedded preview.

Does anyone have a solution for this problem for me?

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello Mike,

The only thing that is outputting now is the youtube link, no iframe embed.

It sounds like the field is being used a text field type which is the fallback if you specify a field type that isn't installed. Have you downloaded the field type and added it to perch/addons/fieldtypes? If not, you can download it from here

Have you tried creating an iframe content html then just allow the embedded ie <iframe width="560" height="315" src="https://www.youtube.com/embed/MfTbHITdhEI" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe> Allowing MFTbHITdHEI as a text in the content html

Are you able to add using URL?best water purifier