Well I thought this mime content thing would be an easy weekend project,
but the mime stuff, like a lot of my stuff,
looks like it was slapped together without enough thought.
I need to do some redesign of mime plugins.

I'll focus on audio, obviously I have a vested interest in that world.
Say there is a web file that I have determined, by suffix or by content type,
to be mp3, and I have a mime description of what to do with mp3.
Good so far, but there are three possible scenarios,
and I'm starting to think I should allow for 3 different commands.
These are stream, local file, and in memory.
This is how it might look.

cmdstream = mpg123 -q -C
cmdlocal = mpg123 -q -C
cmdmem = mpg123 -q -

The stream command, if it is present and if that is the one edbrowse selects,
is invoked with the url.
mpg123 -q -C url
No need to download a possibly large audio file, and it starts playing right 
away.
Some of the key controls work, particularly pause and fast forward.
Others do not, such as rewind or randomly jump to points 1 through 10 in the 
file.
So you get some of the interactive benefits of an audio player, but not all.

The most flexible plugin command, if the downloaded audio file is not too large,
is the local command, wherein edbrowse would download
and save it somewhere in /tmp and then run
mpg123 -q -C /tmp/foobar.mp3
All the key commands are available, rewind, restart, forward, random access.

The third command downloads the mp3 file into memory and then pipes
it to the running program.
buffer | mpg123 -q -

This allows for *none* of the key commands, since standard in is busy
reading the mp3 samples.
The only thing you can do is abort with control c.

So these are the possible commands and I think I should allow for at least 2 of 
them,
stream and local, and maybe all three, in each mime descriptor.

Of course something like streaming audio would only have the stream command.
The others are not meaningful.

If a particular mime type offers multiple commands, how would edbrowse pick?
Should there be a master switch, a toggle command like
pgs pgl pgo
plugin streams plugin local plugins off?
Turning it off would only be used if you liked what you were hearing,
the lecture is really interesting, and you want to download it
like it's just a file.
Some real interesting things to think about here.

Karl Dahlke
_______________________________________________
Edbrowse-dev mailing list
[email protected]
http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev

Reply via email to