Skip to content

Code 100% Width Is Confusing/Indeterminate #378

@bobdercole

Description

@bobdercole

Hi,

I noticed that all truthy height and width values are casted to integers. In some cases, this causes a width of 100% to be interpreted as 100px.

For example, SoundCloud returns a width property set to 100%. Although, I guess this is not compliant with the OEmbed specification.

Here is an example Embed\EmbedCode for a SoundCloud URL.

object(Embed\EmbedCode)#4585 (4) {
  ["html"]=>
  string(202) "<iframe width="100%" height="400" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?visual=true&url=https%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F670562855&show_artwork=true"></iframe>"
  ["width"]=>
  int(100)
  ["height"]=>
  int(400)
  ["ratio"]=>
  float(400)
}

This data is hard to use since there is no unit indication. I am assuming everything is supposed to be in pixels. It would be easier to use if the width was simply null. Would it be possible to set non-integer data to null?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions