[maemo-developers] passing arguments to hildon applications
From: josh.soref at nokia.com josh.soref at nokia.comDate: Tue May 27 12:59:10 EEST 2008
- Previous message: passing arguments to hildon applications
- Next message: passing arguments to hildon applications
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Andrew Daviel <advax at triumf.ca> wrote: > What I'm really trying to do is click on an MPEG URL in > the N810 browser and have Mplayer play the video. > Which is something I thought I'd known how to do for years - > make an entry in /etc/mailcap like > video/mpeg; mplayer %s > or to handle a playlist, like .WVX > video/x-ms-wvx; mplaylist %s > where mplaylist is a script "mplayer -playlist $1" > > But although the Firefox microbrowser on the N810 reads /etc/mailcap > (and /home/user/.mozilla/microb/mimeTypes.rdf) it ignores them. > It seems to use entries in /etc/gnome/defaults.list to start > things like the PDF viewer, Nokia media player etc., provided there > are desktop and service files for them. > > So I can add a new MIME type and have osso_notes open it by adding a > line like: foo/bar=hildon-osso_notes.desktop > > But if I make an entry for mplayer, or mplaylist, it doesn't work. > There is no argument passed - mplaylist starts, but does not play > anything. > > Conversely, if I try to start osso_notes or osso_pdfviewer from the > command line, e.g. $ osso_pdfviewer foo.pdf > as I would normally start Xpdf or Acroread, it starts up with > a blank document. Passing a --help option has no effect, either. > > I presume someone decided to abandon 20 years of common Unix practice > and do things differently. Which is somewhat annoying, to say the > least. How the ** is this supposed to work - i.e. launch mplayer from > the browser or osso_pdfviewer from the command line ? ? Yep. I think it's called platform integration. You probably need to use/support dbus. Although in the case of mplayer, you're probably running afoul of this other bit that I'm about to mention There's a lot of hackery foating around. You don't want to read it (it took me around 20 pages of cross reference reading to compile what is below). First for a hard coded list of mime types, we'll pass urls instead of downloading files. ^ you may hit this ^ The "mime type" as I understand it is something which gnome-vfs decides, and isn't necessarily related to the actual mime type of the object (this is always fun). Assuming we go on the "normal" path, we call (and you could determine this by instrumenting gtk, so this is not a secret...) gnome_vfs_get_mime_type_from_uri gnome_vfs_mime_get_default_application hildon_mime_open_file_with_mime_type * DBUS, yay If that fails, we might call: hildon_mime_open_file * DBUS, yay http://timeless.justdave.net/mxr-test/chinook/ident?i=gnome_vfs_get_mime _type_from_uri http://timeless.justdave.net/mxr-test/chinook/ident?i=gnome_vfs_mime_get _default_application http://timeless.justdave.net/mxr-test/chinook/ident?i=hildon_mime_open_f ile_with_mime_type http://timeless.justdave.net/mxr-test/chinook/ident?i=hildon_mime_open_f ile Fwiw, at the present time, video/x-ms-wxv is among the "hacks". These "hacks" were requirements. We're hoping that some future version may lose some or all of these hacks. But don't hold your breath, I've been holding my breath for two years and only just now got a sign that maybe something might happen eventually. As for what you can do realistically. You can hack the binary to have a different hard coded list of mime types oediv/* and oidua/* would probably work wonders. The browser itself doesn't want this code so afaik binary hacking those away shouldn't do much harm :) You can replace the implementation of gnome_vfs_get_mime_type_from_uri so that it never returns the hard coded types that are causing you pain. Returning oediv/* and oidua/* instead would of course work. You might be able to find a text file or something like one which is used by gnome_vfs_get_mime_type_from_uri so that you don't actually have to change any binaries or source files. The file was probably called "mediaplayer-ui.xml" I'm not sure about the on device name (cross reference covers sources, not deliverables). It should be sufficient to change that file to use noitacilppa/x-ms-asx and friends in their corresponding type= lines. There will probably be a diablo xref up at some point after diablo is released. Obviously it won't happen before the release. But the APIs you're interested are not going to have changed. And you won't see new sources from the browser integration so the links above should be sufficient.
- Previous message: passing arguments to hildon applications
- Next message: passing arguments to hildon applications
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]