Is there a way to embed media players (audio/video) inside a table?

I’m wondering if there is a way to organize media files into some sort of table. This is my current approach:

Test 1:

Test 2:

Test 3:

But I’d like to be able to do something like this (with the players embedded instead of the URL):

1 Like

oh, this is going to be tricky, this is essentially asking for a way to force a “full onebox” somewhere on a link that is not at the beginning of a line. I think in very rare conditions like what you have here this may be useful.

I kind of support a change that would allow something like this for the ultra ninja cases where you want to force a onebox in the middle of a line:

<a href="onebox_url" type=onebox>...</a>

Trouble is all our onebox styling atm assumes it is the only thing in the line and gets full width so a bunch of assumptions would need to be changed.

6 Likes

This would also be useful for when you want to show oneboxes inside of a details section.

5 Likes

I don’t know if this would help, but an alternative interface could be to extend the BBCode syntax. Something like:

[audio src="https://file.m4a"][/audio]

Or even:

[inline_onebox]https://file.m4a[/inline_onebox]
4 Likes

Or can we just whitelist the audio video and source tags? Today it’s impossible to post a video to Discourse with multiple sources (one mp4 and one webm) so it plays on every device.

1 Like

Have you considered to allow Iframes and post the table elsewhere?

@martin Thanks to your awesome PR, audio links now work even if there are characters to the left of the URL! :tada: (many of my users struggled with this detail, so it will be much easier for them).

I noticed that now audio files work inside details:

Example

I was hoping that they would also work inside markdown tables, but I see that this doesn’t yet work:

name audio file goes here
example ![New Recording 23

I thought the problem might be the pipe character |, but it also doesn’t work with HTML tables:

name audio file goes here
example ![New Recording 23|video](upload://g3KMoFLMKmekLPcoBovHQCD71eU.mp4)

Is this a feature that could be included in a future release?

4 Likes

Markdown tables work, but you need to escape the | with \ eg \| it’s a slightly annoying issue with pipes cause md tables have semantics for it pipes already

I am half open to adding another optional char we can use there as a split. Comma is not ideal cause people can use it for descriptions.

3 Likes

This is a pretty good workaround for now. Thanks for pointing it out!

The only issue I’ve run into has been 429 errors (too many requests) when I try to edit a medium-sized table with several audio files (actually, the same one repeated). I got a discourse modal when I tried to save changes and this was in the console:

The only thing I did was add three rows to this table:

I don’t know if this is the expected behaviour or if there is a way to lazy-load the resources to avoid the error (I was able to do it after several retries).

1 Like

Hmmm I am curious, if we currently put a 40mb MP3 in a page are browsers downloading all of it prior to play?

A lazy loader certainly makes sense if we currently have this going on, only thing we would miss out is duration, but we could figure that out on the server.

1 Like