Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oEmbed / iFrame resizing only works for YouTube/Vimeo links #721

Open
pb-amy opened this issue Sep 2, 2020 · 1 comment
Open

oEmbed / iFrame resizing only works for YouTube/Vimeo links #721

pb-amy opened this issue Sep 2, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@pb-amy
Copy link

pb-amy commented Sep 2, 2020

Description

This was requested through this Zendesk ticket (for internal purposes). See also https://pressbooks.zendesk.com/agent/tickets/3163

This is a follow up to this GitHub ticket: #700 (comment) - We currently have a resizer script that dynamically resizes YouTube and Vimeo embeds so that they do not exceed the width of their parent containers:

let $allVideos = $( 'iframe[src*=\'//player.vimeo.com\'], iframe[src*=\'//www.youtube.com\']' );

However, as per the followup comment on the GitHub ticket above, other types of activities embedded via oEmbed (like PhetSims) or iframe do not have dynamic resizing rules which apply to them. In particular, these embedded elements exceed the width of their container when inserted inside of various textbox divs.

Screen Shot 2020-09-02 at 5 05 25 PM
Screen Shot 2020-09-02 at 5 05 41 PM

Steps to Reproduce

  1. Take a PhetSim example: https://phet.colorado.edu/sims/html/john-travoltage/latest/john-travoltage_en.html
  2. Copy into an editor inside and outside of a textbox.
  3. Preview

Expected behavior: Should size properly, and stay in the bounds of the textbox.

Actual behavior: oEmbeds in textboxes size as if they are outside of the textbox (embeds exceed the borders of the textbox.)

@SteelWagstaff SteelWagstaff changed the title oEmbed Resizing in Textboxes is not working oEmbed resizing only works for YouTube/Vimeo links Sep 3, 2020
@SteelWagstaff SteelWagstaff added the bug Something isn't working label Sep 3, 2020
@SteelWagstaff SteelWagstaff changed the title oEmbed resizing only works for YouTube/Vimeo links oEmbed / iFrame resizing only works for YouTube/Vimeo links Dec 10, 2020
@SteelWagstaff
Copy link
Member

One possible model for implementation might be https://gist.github.com/jlengstorf/ce2470df87fd9a892f68. See #592 for implementation with YouTube videos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants