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

Audio Pane doesn't change size #5917

Closed
1 task
davies-w opened this issue Nov 25, 2023 · 4 comments · Fixed by #5936
Closed
1 task

Audio Pane doesn't change size #5917

davies-w opened this issue Nov 25, 2023 · 4 comments · Fixed by #5936
Labels
type: enhancement Minor feature or improvement to an existing feature
Milestone

Comments

@davies-w
Copy link

Thanks for contacting us! Please read and follow these instructions carefully, then delete this introductory text to keep your issue easy to read. Note that the issue tracker is NOT the place for usage questions and technical assistance; post those at Discourse instead. Issues without the required information below may be closed immediately.

ALL software version info

(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc)
Colab (latest)

Description of expected behavior and the observed behavior

Nothing seems to change the size of the widget.

pn.pane.Audio(y[x1:x2], rate=sr, height='20px')

Complete, minimal, self-contained example code that reproduces the issue

import panel as pn
pn.extension()
pn.pane.Audio('https://ccrma.stanford.edu/~jos/mp3/pno-cs.mp3', name='Audio', height=10, width=200)


from IPython.display import HTML, Audio
audio_style = "<style>audio { margin-left: 35px; width: 200px; height: 10px; }</style>"
display(HTML(audio_style))
display(Audio('https://ccrma.stanford.edu/~jos/mp3/pno-cs.mp3'))

Stack traceback and/or browser JavaScript console output

Screenshots or screencasts of the bug in action

  • I may be interested in making a pull request to address this
@davies-w
Copy link
Author

Note that I included an example that shows the audio player being able to be small.

@davies-w
Copy link
Author

I discovered that the various parameters to the Audio panel, actually only impact the outer element, but not the actual player size. So I'm assuming that's not intended, and that things like Height and Width should be passed through to the actual Audio widget

@davies-w
Copy link
Author

Workaround (man that made me work, I'm a scientist, not a CSS jockey!)

stylesheet = """
audio {
height: 20px;
}
"""
audio = pn.pane.Audio(y[x1:x2], sample_rate=sr, stylesheets=[stylesheet])

@davies-w
Copy link
Author

I still think this is a horrible experience, the Video Pane actually obeys the sizing controls, but Audio won't, so I'm going to keep this open, and let a maintainer decide. Note this person had the same problem, 4 years ago, and noone was able to help back then either: https://stackoverflow.com/questions/59423953/customization-of-panel-pane-audio-element

@philippjfr philippjfr added the type: enhancement Minor feature or improvement to an existing feature label Nov 26, 2023
@philippjfr philippjfr added this to the v1.4.0 milestone Nov 26, 2023
@philippjfr philippjfr modified the milestones: v1.4.0, v1.3.3 Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Minor feature or improvement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants