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

AudioRecorder - selectively display recorder (or hide the audio widget) or changing to a HBox layout #85

Open
sathayen opened this issue Jun 23, 2020 · 4 comments

Comments

@sathayen
Copy link

I have created an AudioRecorder instance in a jupyter notebook for recording from the microphone.

The jupyter notebook output displays a recorder widget and an audio widget. Is there a way to turn off the audio widget display? I could call recorder.audio to show the audio player widget only , but could not find a way to only show the recorder widget.

I tried:
recorder.audio.layout.display = 'none' and then invoked the recorder object. But it still displays the audio widget.

If I set recorder.layout.display to 'none' then it hides all the widgets. Is there any attribute that will only display the 'record' widget and not the audio? If not, how can this be accomplished?

@martinRenou
Copy link
Collaborator

There is currently no way of doing this properly unfortunately.

@sathayen
Copy link
Author

thanks @martinRenou , could you please suggest any hack to get this working? Ideally, I want to be able to put the two widgets in a HBox layout like so : widgets.HBox(recorder, audio) .. is there a woraround to accomplish that (if not hide the audio widget)

@martinRenou
Copy link
Collaborator

martinRenou commented Jun 23, 2020

Yeah you could hack around it by injecting the right CSS in the page, that's not a great solution but it would work.

from IPython.display import HTML

display(HTML("""
<style>
.jupyter-widgets audio:nth-child(2) {
  display: none;
}
</style>
"""))

@sathayen
Copy link
Author

That works for now! thanks! :)

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

No branches or pull requests

2 participants