facebookarchive / instant-articles-builder

Instant Articles Rules Editor
https://facebook.github.io/instant-articles-builder
Other
125 stars 67 forks source link

Embedded YouTube Video Conversion #100

Closed brendanwenzel closed 6 years ago

brendanwenzel commented 6 years ago

I'm starting off with this:

`

      </div>`

Here's what I have in the rules document:

{"class":"InteractiveRule","selector":"div.video-container","properties":{"interactive.iframe":{"selector":"*","type":"element"},"interactive.url":{"attribute":"src","selector":"iframe","type":"string"}}}

Here's the result:

screen shot 2018-06-10 at 4 46 23 pm

I've tried everything I know how to get rid of the div tags and only leave one instance of the iframe.

What am I doing wrong here?

diegoquinteiro commented 6 years ago

If you just leave the interactive.iframe empty, you should have the intended result. The url and iframe properties should be used in a mutually exclusive manner.

In the Builder, you can achieve this by leaving the "Embed Contents" field of the Embed element empty (it defaults to *, just erase that).

Does that work?

brendanwenzel commented 6 years ago

Doing that gets rid of the entire thing. I'm left with no iframes and no figure for the embed. It's just blank space.

mburak commented 6 years ago

Using just the src should work. Did you try this:

    {
        "class":"InteractiveRule",
        "selector":".video-container",
        "properties":{
            "interactive.url":{
                "attribute":"src",
                "selector":"iframe",
                "type":"string"
            }
        }
    }
pestevez commented 6 years ago

Hi @BrendanWenzel, are you still facing this issue? Did the solution proposed by mburak work?

pestevez commented 6 years ago

Closing due to inactivity. Please feel free to reopen if you need additional information.