1

I'm trying to embed the IMDB movie trailer iframe into a mobile Ionic app, problem is that apparently their embed code can't go below 400px width, I've set the parameters for the iframe with the width value as provided by the site:

<iframe src="http://www.imdb.com/video/imdb/vi354465561/imdb/embed?autoplay=false&width=320" width="320" height="480" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" frameborder="no" scrolling="no"></iframe>

but all the elements inside their html structure show a fixed width of 400px. If this is a limitation of their page, what recommended alternative can I use to display the trailer correctly over a 320px width viewport? which is what I'm using as default mobile visualisation.

The only workaround I'm applying now is to move the iframe a bit over the container so the fullscreen button is available, but this doesn't look right.

Alexander Fradiani
  • 941
  • 2
  • 11
  • 29

1 Answers1

1

The only solution is to change the iframe's CSS and make it responsive to your vieweport, which might be possible. Try what's mentioned here: How to apply CSS to iframe?


Edit: If all fails, seems like the only fallback could be creating a scrollable container over your iframe so that the user can at least view it completely scrolling. You can do this with the CSS Overflow property

Community
  • 1
  • 1
sgarcia.dev
  • 4,375
  • 11
  • 33
  • 57