bongo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bongo-devel] Re: URI mplayer question


From: Daniel Brockman
Subject: Re: [bongo-devel] Re: URI mplayer question
Date: Wed, 21 Feb 2007 07:23:12 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux)

Dieter Deyke <address@hidden> writes:

> Dieter Deyke <address@hidden> writes:
>
>> I am using Bongo on Windows XP with the mplayer back-end (because VLC
>> does not work on Windows with Bongo).  I want to play two different
>> kind of streams:
>>
>> - type 1 is providing audio directly, like
>>   http://sc1.spacialnet.com:17762/ (may be offline at the moment)
>>
>> - type 2 is providing a playlist of type 1 streams, like
>>   http://www.sky.fm/mp3/the80s.pls
>>
>> mplayer can play type 1 with Bongo just fine, but it needs a command
>> line argument -playlist to deal with type 2.
>>
>> How can I deal with that when using bongo-insert-uri?
>
> To follow up on my own post, it looks like mplayer is able to play
> urls of the form http://xxx.pls without the -playlist command line
> option, but it requires it for urls of the form http://xxx.m3u

One way to do this is to advise `bongo-start-mplayer-player'
as follows:

   (defadvice bongo-start-mplayer-player (before m3u-playlists activate)
     "Add `-playlist' option for `http://foo.m3u' URLs."
     (when (string-match "^http://.+\\.m3u$"; file-name)
       (push "-playlist" extra-arguments)))

Normally, however, adding program arguments based on the
file name would be done using a file name transformer:

   :file-name-transformer
   (lambda (file-name)
     (when (string-match "^http://.?\\.m3u$"; file-name)
       (list file-name "-playlist")))

We don't currently provide a really convenient way for users
to add file name transformers, but you can do it like this:

   (bongo-backend-put 'mplayer 'file-name-transformers
     (cons (lambda (file-name)
             (when (string-match "^http://.?\\.m3u$"; file-name)
               (list file-name "-playlist")))
           (bongo-backend-get 'mplayer 'file-name-transformers)))

Maybe we should have a `bongo-backend-push'.

   (bongo-backend-push 'mplayer 'file-name-transformers
     (lambda (file-name)
       (when (string-match "^http://.?\\.m3u$"; file-name)
         (list file-name "-playlist"))))

I will add such a function.

Caveat:  I did not test any of this.  Please complain if I
screwed any of it up.

-- 
Daniel Brockman <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]