Experimental project

This is a sandbox project, which contains experimental code for developer use only.

This is a simple module that provides a text format filter that wraps frames (iframes by default, but can be configured to work with other types of frames like embed) around containing divs and optionally provides CSS to make the frames responsive (with the limitation of a fixed aspect ratio, also configurable per text format). Essentially this module makes frames (most commonly videos) behave like images with the width of 100%.

The technique was inspired by Creating Intrinsic Ratios for Video.

Benefits

  • Configurable per text format
  • Works without javascript
  • Works with frames from any site (no changes/code required on the providing end)
  • Performant (text format outputs are fully cached)

Limitations

  • Fixed aspect ratio for frames

Theming

It's possible to disable (per text format) the CSS provided by the module and theme the frames yourself. The module provides 2 wrappers (divs) around the frames with classes:

  • responsive_frames_container
  • responsive_frames_wrapper

Similar modules

  • FitVids
    • Relies on javascript
    • Works only with certain sites (does provide manual selectors though)
    • Magic happens on every page load in the browser, instead of being cached

Project information