Gutenberg: Add Block: Audio

Created on 16 May 2017  路  10Comments  路  Source: WordPress/gutenberg

Splitting this out from #283 .

Attributes

  • None, Left, Right, Center, Full Width.
  • Caption

States

Placeholder:

audio placeholder

Neutral:

audio neutral

Selected:

audio selected

Customization New Block [Feature] Blocks [Feature] Media [Priority] High

All 10 comments

@jasmussen should this block be similar to the audio widget where we allow users to select audio from the library, or are you thinking of just having the URL input?

It was designed as a replacement for the audio shortcode, which allows you to hotlink URLs. But maybe it should indeed be the new widget, I like the idea of not having two blocks that do the same. Can you insert a sound file from a URL in the widget?

You can insert a url in the audio widget, it is kind of buried in the media modal though:

customize__blog_ _xwp

customize__blog_ _xwp

Seems like your original design is much quicker to insert the URL - I can pursue that in the first iteration of this block.

It seems the main thing missing is selecting the file from the media library.

Beware, however, that there are many more inspector-style settings for audio, including the selection of alternate HTML5 audio sources, configuring preloading, looping, and autoplay:

image

Hmm. Maybe it does make sense to have a separate "Embed Music" block, or someting in that vein. I can't quite wrap my head around it.

The thing is, I think there's a legit use case for both the one from the media library, and the one where you just have a URL that is hotlinked. As @iseulde suggested yesterday, a hotlinked URL is an embed, in a way.

CC: @melchoyce for thoughts also.

Maybe we could consider something like this:

image

Quick screen grab of progress thus far, will hopefully push up a branch/create a pr later today:

screenshot_8_8_17__2_36_pm

The current progress screenshot makes it look a bit like the insert button is referencing the URL entry box.

I think the route @melchoyce suggested with having a separator in between the two options makes it clearer what the controls will do.

Edit: Sorry, I was really unclear which designs I was referencing in the original comment.

Done in #2299. Further improvements in new issues.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

moorscode picture moorscode  路  3Comments

youknowriad picture youknowriad  路  3Comments

davidsword picture davidsword  路  3Comments

ellatrix picture ellatrix  路  3Comments

maddisondesigns picture maddisondesigns  路  3Comments