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

HTML5App preview broken on develop #1050

Closed
ivanistheone opened this issue Oct 23, 2018 · 6 comments
Closed

HTML5App preview broken on develop #1050

ivanistheone opened this issue Oct 23, 2018 · 6 comments
Assignees
Labels

Comments

@ivanistheone
Copy link
Contributor

ivanistheone commented Oct 23, 2018

So on current production preview loads the HTML content correctly:
https://studio.learningequality.org/channels/faf284a5469d54b8b06881491196888e/edit/38f9ecd/0312595 (Go to Preview tab of modal)

On develop it doesn't:
https://develop.studio.learningequality.org/channels/faf284a5469d54b8b06881491196888e/edit/38f9ecd/0312595 (Go to Preview tab of modal)

The HTML that loads the iframe for HTML5App preview on prod is:

<iframe src="/zipcontent/43a7016005a9aaec4855d3dfc509d307.zip" data-src="/zipcontent/43a7016005a9aaec4855d3dfc509d307.zip" class="html_preview" sandbox="allow-scripts"></iframe>

in develop it says:

<iframe src="about:blank" data-src="/zipcontent/43a7016005a9aaec4855d3dfc509d307.zip" class="html_preview" sandbox="allow-scripts"></iframe>

SUSPECTED CAUSE: For some reason this doesn't run:
https://github.com/learningequality/studio/blob/develop/contentcuration/contentcuration/static/js/edit_channel/preview/views.js#L92-L94

@kollivier
Copy link
Contributor

Strange, I'm not seeing this when I click the develop link, it has src defined properly for me. I wonder if this code is sensitive to async loading issues?

@kollivier
Copy link
Contributor

It does give an error loading one of the scripts in the zip, though. Not sure if that's related or expected.

@ivanistheone
Copy link
Contributor Author

@kollivier can you confirm you see the preview iframe loading on develop without selecting the HTML5 Zip option from the dropdown. (It works for me too if I choose HTML5 Zip)

Note on PROD the preview content loads automatically (without having to choose HTML5 Zip).

@kollivier
Copy link
Contributor

kollivier commented Oct 24, 2018

@ivanistheone Sorry, I do see the same behavior. I clicked on the HTML5 Zip item instinctively the first time around! When you checked the code, is the code in this area the same for master and develop?

@jamalex
Copy link
Member

jamalex commented Oct 29, 2018

I think I saw a commit title saying the deferred loading via data-src was to keep the iframe from loading before the preview tab was loaded. But I think we now already delay rendering the tab content entirely until it's clicked? (it used to start playing videos in the background when you opened the metadata modal)

So this sounds like it can (and definitely should) be simplified now, just directly using src="/zipcontent/...
and then removing that deferred loading JS?

@jayoshih jayoshih self-assigned this Feb 6, 2019
@jayoshih
Copy link
Contributor

jayoshih commented Feb 6, 2019

Looking into a fix today!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants