Skip to main content

Ralsina.Me — Roberto Alsina's website

I knew not doing it was smarter, or how HTML5 and Qt do my work for me.

I wrote a while ago a RSS pro­gram called uRSSus. I ex­pect I am the on­ly us­er of it be­cause it has some prob­lems (all of them my fault ;-) but I re­al­ly like it.

For a while now I have want­ed it to have pod­cast sup­port. The thing is... that al­ways seemed like a lot of work. Sure, us­ing phonon I can cre­ate an au­dio play­er and ev­ery­thing, but...

I am us­ing a HTML wid­get to dis­play the post­s, so I would have to find a way to add the au­dio play­er to the UI and ... too much work.

So, to­day I woke up and thought... wait a minute... Qt's HTML wid­get is based on We­bkit. And We­bkit sup­ports HTM­L5. And HTM­L5 has an "au­dio" tag.

So, if I fixed uRSSus to fetch the en­clo­sure links, and added them in the database, and then added this to the post tem­plate:

<?py for enclosure in  post.enclosures: ?>
  <audio autobuffer="Yes" controls="controls" src=#{enclosure.href}></audio><br>
<?py #end ?>

Would­n't that ac­tu­al­ly work? Well, yeah!

urssus26

So there you have it, I was right not to im­ple­ment it, be­cause the eas­i­est way is to let Qt do it ;-)

Marcelo Fernández / 2009-12-03 16:46:

Groso e ingenioso! :-)

Lástima que Webkit (ni HTML5) soporta todos los códecs/contenedores de audio/video (sólo Ogg y Mkv o algo así); se me viene a la mente que la mayoría de los podcasts me parece que son en mp3.

Saludos!

Marcelo Fernández / 2009-12-03 16:46:

Groso e ingenioso! :-)

Lástima que Webkit (ni HTML5) soporta todos los códecs/contenedores de audio/video (sólo Ogg y Mkv o algo así); se me viene a la mente que la mayoría de los podcasts me parece que son en mp3.

Saludos!

Roberto Alsina / 2009-12-03 17:13:

Por lo menos para MP3 funciona. Bah, funciona el primero que probé: http://www.thelinuxlink.net...

Roberto Alsina / 2009-12-03 17:15:

Creo que esta es la explicación de porqué funciona: en realidad Qt Webkit hace esto via Phonon.

Como el backend de Phonon es Xine (o gstreamer o lo que sea) a menos que Qt verifique el tipo de archivo, debería fucionar para cualquier tipo de audio.

Capaz que algunos no funcionen muy bien como streaming, capaz que no se pueda avanzar o retroceder.

Para esos capaz que implemento descarga y cache de los archivos.

barthus / 2009-12-07 19:02:

How about embed mplayer? Is it a good idea??

Roberto Alsina / 2009-12-07 19:06:

@barthus: it surely is a lot more work.

barthus / 2009-12-07 20:13:

I found some examples in a qt french blog... (sadly I don't speak french)

but you are correct, it seems a lot of work.. ;)

http://forum.qtfr.org/viewt...

phone number lookup / 2011-12-03 22:30:

this is really interesting viewpoint on the subject i might add

employment background check / 2011-12-27 23:30:

Man ... Beautiful . Amazing ... I will bookmark your website and use the your RSS feed also


Contents © 2000-2024 Roberto Alsina