MythWeb ASX Streaming on Ubuntu 14.04

I want to be able to click on a ASX link in Google Chrome and instantly launch SMPLAYER.

Unfortunately the default mime type for these files is audio/x-ms-asx.  

This is defined in the /usr/share/mime/packages/freedesktop.org.xml

<mime-type type="audio/x-ms-asx">
 <comment>Microsoft ASX playlist</comment>
---- snip -----
<glob pattern="*.asx"/>
<glob pattern="*.wax"/>
<glob pattern="*.wvx"/>
<glob pattern="*.wmx"/>
<magic priority="51">
<match value="ASF " type="string" offset="0"/>
<match value="&lt;ASX" type="string" offset="0:64"/>
<match value="&lt;asx" type="string" offset="0:64"/>
<match value="&lt;Asx" type="string" offset="0:64"/>
</magic>
</mime-type>

Since this is a video play list coming from Myth, it seems strange that it’s defined as audio/x-ms-asx.

The default type for audio/x-ms-asx is Totem:

~ $ xdg-mime query default audio/x-ms-asx
totem.desktop

But really I wanted to fix it so that the asx files coming from myth would be identified as video/x-ms-asx

So I created a xml file:

<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
 <mime-type type="video/x-ms-asx">
 <comment>Microsoft ASX Video playlist</comment>
 <magic priority="100">
 <match value="&lt;ASX" type="string" offset="0:64"/>
 </magic>
 <glob weight="100" pattern="*.asx"/>
 </mime-type>
</mime-info>

I then installed that via xdg-mime:

xdg-mime install x-ms-asx.xml
 ~ $ xdg-mime query filetype 1404712800
video/x-ms-asx

Good so far, but now we need to associate the video/x-ms-asx.  By default its still totem.desktop.

 ~ $ xdg-mime query default video/x-ms-asx
totem.desktop

We can override this like so:

xdg-mime default smplayer.desktop video/x-ms-asx
~ $ xdg-mime query default video/x-ms-asx
smplayer.desktop

 

2 Responses to MythWeb ASX Streaming on Ubuntu 14.04

  1. Jason Pell says:

    From what I can tell, the default associations are located in:

    /usr/share/applications/defaults.list

    audio/x-ms-asx=totem.desktop
    video/x-ms-asx=totem.desktop

    The overrides seem to go into…

    For the mime database:

    ~/.local/share/mime/packages/

    For the overriden application associations:

    ~/.local/share/applications/mimeapps.list

    But it’s good to know the commands to use instead of modifying the files directly.

  2. Pingback: A 4 year old boy and his Ubuntu 14.04 laptop | Jason's Blog

Leave a Reply

Your email address will not be published. Required fields are marked *