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

Add remote option #6

Merged
merged 6 commits into from
Nov 23, 2019
Merged

Add remote option #6

merged 6 commits into from
Nov 23, 2019

Conversation

spencerpogo
Copy link
Contributor

Adds a --remote option which sends the video with a data:video/mp4;base64, URL instead of a relative path. This is useful for when you are working on a remote machine like Google Colab and don't have access to the filesystem. The data: URL sends the entire base64 encoded file in the src of the video HTML if the --remote option is passed to the cell magic.
I have tested this on Google Colab and it works like a charm. Would love to see this pushed so I can shorten by setup cell to just an import rather that all this code.
Appreciate this library!

Add `-r` or `--remote` option which sends the video using a `data:video/mp4,base64` URL instead of a relative path.
Accidentally used `-r` when it was already being used for resolution, changed to just `--remote`
Don't pass `--remote` to manim
@krassowski
Copy link
Owner

Thank you, this is a great idea! I'm just not sure about the reassignment of -r - this could break the code of some existing users. How would you feel about using another shorthand?

@spencerpogo
Copy link
Contributor Author

@krassowski Yeah I realized that after my first commit and changed it from -r and --remote to only --remote once I realized that in 20acb22

@@ -83,7 +85,6 @@ def manim(self, line, cell):
settings[arg] = False

resolution_index = (
user_args.index('-r') if '-r' in user_args else
Copy link
Owner

@krassowski krassowski Nov 23, 2019

Choose a reason for hiding this comment

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

I meant keeping this...



remote_index = (
user_args.index('-r') if '-r' in user_args else
Copy link
Owner

Choose a reason for hiding this comment

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

....and renaming this.

@spencerpogo
Copy link
Contributor Author

How about now? If you have anything specific in mind I honestly don't care what the name is.

@krassowski
Copy link
Owner

Great! Thank you for you contribution. I will look into #5 and release a new version then.

@krassowski krassowski merged commit b65e680 into krassowski:master Nov 23, 2019
@spencerpogo
Copy link
Contributor Author

Oops, forgot to change the README. It still says --remote

@spencerpogo spencerpogo deleted the patch-1 branch November 30, 2019 22:49
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.

2 participants