Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Video download - #26125

#26125
Merged
Hamms merged 11 commits into
stagingcode-dot-org/code-dot-org:stagingfrom
video-downloadcode-dot-org/code-dot-org:video-downloadCopy head branch name to clipboard
Nov 20, 2018
Merged

Video download#26125
Hamms merged 11 commits into
stagingcode-dot-org/code-dot-org:stagingfrom
video-downloadcode-dot-org/code-dot-org:video-downloadCopy head branch name to clipboard

Conversation

@Hamms

@Hamms Hamms commented Nov 16, 2018

Copy link
Copy Markdown
Contributor

Depends on code-dot-org/p5-replay#39

User experience when the video is either already generated, or quick to generate:

download

User experience when the video is taking absurdly long to generate:

peek 2018-11-16 18-35

Follow-up work in a future PR:

  • Add to finish dialog

@Hamms Hamms changed the title [WIP] Video download Video download Nov 19, 2018
@Hamms

Hamms commented Nov 19, 2018

Copy link
Copy Markdown
Contributor Author

Assigning all three of you for review because I'm not sure who actually has time for a review now; if you're swamped, please feel free to ignore this and let the others review.

@Hamms

Hamms commented Nov 19, 2018

Copy link
Copy Markdown
Contributor Author

FYI @poorvasingal

element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bit of code (creating a hidden element so that we can click on it to start a download I think?) feels like it could use a comment explaining itself.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing! Is there a more standard way to initiate a user download from JS?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I know of, but I think this is enough of a "trick" that many won't be familiar with it/understand why this is being done when they see it in code.

@islemaster islemaster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me!

return false;
};

checkVideo = () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for methods like this where they're not being passed to an event handler, they can be true member functions, i.e. checkVideo() { instead of arrow functions

return;
}

if (this.state.checkVideoUntilSuccessTimeout) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would guess that checkVideoUntilSuccessTimeout could be a member variable instead of a state variable, i.e. this.checkVideoUntilSuccessTimeout

@Hamms
Hamms merged commit c330d5c into staging Nov 20, 2018
@Hamms
Hamms deleted the video-download branch November 20, 2018 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.