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 option to change HTML attributes in display.Video #12212

Merged
merged 2 commits into from Apr 18, 2020
Merged

Add option to change HTML attributes in display.Video #12212

merged 2 commits into from Apr 18, 2020

Conversation

mancellin
Copy link
Contributor

@mancellin mancellin commented Mar 30, 2020

I want to display video in a Jupyter notebook, and I would like to customize the behaviour of the video by changing some of the attributes of the HTML5 element (autoplay, loop, muted, ... see e.g. [1])

[1] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video

This PR allows this by adding an option to the Video constructor:

Video("foo.mp4", html_attributes="controls loop")

Another solution would have been to add boolean options for each properties

Video("foo.mp4", loop=True, autoplay=False)

but that might be too cumbersome to maintain for such a specialized feature.

ivanov
ivanov approved these changes Apr 17, 2020
Copy link
Member

@ivanov ivanov left a comment

This looks great, @mancellin! I like how you've already added the new functionality to the examples AND spruced up the formatting of the doc string for the rendered API docs ! 🍰

@Carreau Carreau added this to the 7.14 milestone Apr 18, 2020
@Carreau
Copy link
Member

Carreau commented Apr 18, 2020

Thanks ! That looks great, and thanks @ivanov for the first review.

Merging, that should be out by end of month !

@Carreau Carreau merged commit edc9381 into ipython:master Apr 18, 2020
2 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/ipython that referenced this issue Apr 18, 2020
Carreau added a commit that referenced this issue Apr 19, 2020
…212-on-7.x

Backport PR #12212 on branch 7.x (Add option to change HTML attributes in display.Video)
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.

None yet

3 participants