Active Topics

 


Reply
Thread Tools
pipeline's Avatar
Posts: 693 | Thanked: 502 times | Joined on Jul 2007
#31
I have updated dbus-switchboard to version 1.1.0 which you can download here :
http://wardenclyffetower.com/MaemoFi...-1.1.3.all.deb

This release :
Adds two new cfg files in /home/user
Adds qole's custom asx handler
Adds evince and comix (neither tested)

New config files :
/home/user/.dbus-switch-apps.cfg : this contains registry of all dbus-switchboard apps

Code:
MPlayer,cli,/usr/bin/mplayer %params%
Transmission,cli,/usr/lib/transmission/transmission %params%
Evince,cli,evince %params%
Comix,cli,comix %params%
/home/user/.dbus-switch-xref.cfg : this contains crossref matching file extension to app

Code:
.torrent,Transmission
.avi,MPlayer
.wmv,MPlayer
.mp4,MPlayer
.mpeg,MPlayer
.pdf,Evince
.cbr,Comix
You still need to register the mime-types in defaults.list. Find the mime type in defaults.list and set it to = hildon-dbus-switchboard.desktop

If you try to associate a mime type with no previous entry in defaults.list and you want to use that association from file manager (and not web browser) then there might be another master-list mime config file it needs to be added to. Transmission (application/x-bittorrent) works because the web server tells browser what the mime type is... but that info is lost if you save the torrent and open from file manager... so probably another config file for those cases.

The .dbus-switch-apps.cfg file will be the 'master list' with any possible apps we might want to associate. Experiment with these files and then let me know of any new apps or 'profiles' you want added... so for like mplayer maybe you want multiple profiles with different launch settings.... mplayerStreaming, mplayerMADaudio, etc

The .dbus-switch-xref.cfg will be custom per user and used in future by a UI application to choose which app (if multiple choices) the file should be sent to.

Last edited by pipeline; 2008-05-15 at 02:01.
 

The Following 3 Users Say Thank You to pipeline For This Useful Post:
YoDude's Avatar
Posts: 2,869 | Thanked: 1,784 times | Joined on Feb 2007 @ Po' Bo'. PA
#32
WOW!
This sounds like the answer to my problem illustrated >>HERE<<

If so, is there a step by step available to associate WMV files I encounter with the web browser so that MPlayer opens instead of media player?

I'm sure it is in this thread somehow however, I'm slow like that...

Perhaps a summary then?

Where to find the file to edit.

How to access it and edit it.

What specific line should be edited with what specific new info.

Thanks for your time, output, and eventual patience.

Last edited by YoDude; 2008-03-22 at 17:50.
 
pipeline's Avatar
Posts: 693 | Thanked: 502 times | Joined on Jul 2007
#33
possibly... but doesnt seem to work at the moment so i need to research more

this seems different in that its not so much a mime type as a protocol type mms://

if i click on details it tells me no mime/type so i need to figure out how it determines who gets protocol handlers

if anyone else knows feel free to chime in otherwise i will test more later
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#34
BDIFD ("Boy, Do I Feel Dumb"):

playlist formats (like .asx and .pls) are handled in mplayer. You just have to add the -playlist parameter in front of the %s. No fancy file parsing necessary. So you can scrap my custom .asx handler and make it just like .avi, just change it to

Code:
mplayer -playlist %s
EDIT: I installed the latest dbus-switchboard, removed the custom handler, and edited the new config files as follows:

.dbus-switch-apps.cfg, added the following line:
Code:
MPlayer-playlist,cli,/usr/bin/mplayer -playlist %params%
.dbus-switch-xref.cfg, added the following lines:
Code:
.pls,MPlayer-playlist
.asf,MPlayer-playlist
.asx,MPlayer-playlist
Also, I'm changing my mind about mplayer performance with wmv streams. I am getting lots of "J-type picture is not supported" errors when trying to play those streams, while the realmedia streams seem to play more cleanly in Media Player.

Last edited by qole; 2008-03-23 at 00:00. Reason: poor mplayer wmv performance, asf fix
 

The Following User Says Thank You to qole For This Useful Post:
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#35
I copied the mms:// link from YoDude's TV Station website, and then opened a terminal and typed, "mplayer <pasted link>" and it played.

So the next test was to paste the mms:// link into the address bar of the browser and change the "mms://" to "http://". Now I get a dialog box that says "dbus-switchboard" handles this type, and when I click on "Open," mplayer plays the file.

So, a quick and dirty fix is either a bookmarklet or greasemonkey script that changes all "mms://" links to "http://" links. Combine this with dbus-switchboard, and your problem is solved. Well, except for the fact that .wmv looks like crap on maemo-mplayer due to the error I mentioned above.

Anyone want to write the javascript?
 
YoDude's Avatar
Posts: 2,869 | Thanked: 1,784 times | Joined on Feb 2007 @ Po' Bo'. PA
#36
Originally Posted by qole View Post
I copied the mms:// link from YoDude's TV Station website, and then opened a terminal and typed, "mplayer <pasted link>" and it played.

So the next test was to paste the mms:// link into the address bar of the browser and change the "mms://" to "http://". Now I get a dialog box that says "dbus-switchboard" handles this type, and when I click on "Open," mplayer plays the file.

So, a quick and dirty fix is either a bookmarklet or greasemonkey script that changes all "mms://" links to "http://" links. Combine this with dbus-switchboard, and your problem is solved. Well, except for the fact that .wmv looks like crap on maemo-mplayer due to the error I mentioned above.

Anyone want to write the javascript?
Thanks fellas (pipeline and qole) for running this down for me.

So it sounds like for now, running dbus-switchboard, GreaseMonkey, and a yet to be written script is the way to go.

Could a future change in dbus-switchboard also accomplish this?
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#37
Ok, I wrote the Javascript, it works, so here's a sketchy HOWTO:

Before you start, you need:
  • A way to become root
  • Python
  • Text editor (leafpad)
  • Pipeline's dbus-switchboard package
  • Greasemonkey Browser Extension
  1. Install dbus-switchboard
  2. Edit /usr/share/applications/hildon/mp_ui.desktop, remove the line beginning with MimeType
  3. Edit /usr/share/applications/defaults.list, change (or add) the following lines from hildon-mp_ui.desktop to hildon-dbus-switchboard.desktop:
    Code:
    video/avi=hildon-dbus-switchboard.desktop
    video/x-ms-asf=hildon-dbus-switchboard.desktop
    video/x-msvideo=hildon-dbus-switchboard.desktop
    video/x-ms-wmv=hildon-dbus-switchboard.desktop
    video/x-ms-wm=hildon-dbus-switchboard.desktop
    video/x-ms-asf-plugin=hildon-dbus-switchboard.desktop
    video/x-ms-wvx=hildon-dbus-switchboard.desktop
    video/x-ms-wmx=hildon-dbus-switchboard.desktop
    application/x-ms-asx=hildon-dbus-switchboard.desktop
    application/octet-stream=hildon-dbus-switchboard.desktop
    (I have more, but these ones should ensure that all .wmv video plays in mplayer.)
  4. Install my Greasemonkey script.

EDIT: I uploaded my tiny script to userscripts.org. Click on the link above to install it.
Attached Files
File Type: txt mms2http.user.js.txt (385 Bytes, 146 views)

Last edited by qole; 2008-03-24 at 17:28. Reason: Added a link for Greasemonkey script
 

The Following 3 Users Say Thank You to qole For This Useful Post:
brontide's Avatar
Posts: 868 | Thanked: 474 times | Joined on Oct 2007 @ Capital District, NY, USA
#38
Could I use this to call my custom call.sh for tel: links from microb? Sweet!
 
brontide's Avatar
Posts: 868 | Thanked: 474 times | Joined on Oct 2007 @ Capital District, NY, USA
#39
Damn, looks like URI handling is similar, but different... any chance in getting the URI handler code into dbus-switcher? It would also alleviate the need to use greasemonkey for mms: as well ( if I'm seeing this right ).
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#40
Pipeline, could you please add the mp_ui.desktop without the MimeType line to your .deb? I'm not as sure about the defaults.list file; I think it would be a good idea, but there may be side effects...

If those two files are updated with the .deb, then the user doesn't have to do anything except change the two config files in the home dir.

The config files should probably have an example of a file type that is associated with the built-in Media Player, just so it is clear how to associate files to a hildonized, non-CLI app via dbus-switchboard.

Originally Posted by brontide View Post
Could I use this to call my custom call.sh for tel: links from microb? Sweet!
Please post your results here. I'm curious to find out! Could you link to the thread where you discuss this custom script?
 
Reply


 
Forum Jump


All times are GMT. The time now is 22:53.