dimensions of multiple items are not calculated correctly #16

Closed
opened 2021-08-28 16:51:04 +02:00 by chris · 4 comments
Owner

We need a common mechanism to handle rendering and on window resizing of all iframes present on a page.

We need a common mechanism to handle rendering and on window resizing of all iframes present on a page.
Author
Owner

Items of different types on the same page cause dimension problems.

The idea might be to inject w/h into the iframe before it is rendered.

Items of different types on the same page cause dimension problems. The idea might be to inject w/h into the iframe before it is rendered.
Owner

could it be to hold the iframe at 100% width of the upper container?

then it would be held inside the main area that adapts to different screen sizes?

could it be to hold the iframe at 100% width of the upper container? then it would be held inside the main area that adapts to different screen sizes?
Author
Owner

When using oembed with Vimeo and Sketchfab, "width" and "height" are included in the returned iframe attributes in pixels. But we want width to be 100% (or some other percentage defined by our users). So we need a way to calulated that.

My proposal is to, before rendering, calulate the ratio using the dimensions returned by the oembed API and then, change the width to 100% (or what ever) and remove the height. Then, on the client, use jQuery to get the width in pixels of the iframe and use the ratio to calulate and insert the height

I have included this in both the Vimeo and Sketchfab modules. It works.

When using oembed with Vimeo and Sketchfab, "width" and "height" are included in the returned iframe attributes in pixels. But we want width to be 100% (or some other percentage defined by our users). So we need a way to calulated that. My proposal is to, before rendering, calulate the ratio using the dimensions returned by the oembed API and then, change the width to 100% (or what ever) and remove the height. Then, on the client, use jQuery to get the width in pixels of the iframe and use the ratio to calulate and insert the height I have included this in both the Vimeo and Sketchfab modules. It works.
Author
Owner

This new module correctly handles the dimensions of embeded media

https://git.hangar.org/arcHIVE-tech/oEmbed-omeka-module

Compatible media types:

  • Vimeo
  • Youtube
  • Sketchfab
This new module correctly handles the dimensions of embeded media https://git.hangar.org/arcHIVE-tech/oEmbed-omeka-module Compatible media types: * Vimeo * Youtube * Sketchfab
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: arcHIVE-tech/fixes#16
No description provided.