Launching default media player from strict snap

I’m working on a snap that downloads media files (mp3, ogg, mp4, mkv, etc) and allows to launch those media files in the default media player. Unfortunately it seems that on classic ubuntu desktop the launch command via glib fails with unknown scheme. I know we needed to monkey-patch web addresses with the snapd-xdg-open apt package (which is being ported into snapd itself), so do we need to also monkey-patch opening video and audio files from the filesystem?

If the default media player is in a snap then presumably the snap I’m building will need to provide a content interface, but that is for another day…

Error from app is:

Error org.freedesktop.DBus.Error.InvalidArgs: unknown scheme: /home/dllewellyn/snap/gpodder/x9/gPodder/Downloads/Ubuntu Podcast/ubuntupodcast_s10e22.ogg

i think that falls into the same category as “support more protocols and mime types” that was discussed in the last posts in:

This particular error message suggests xdg-open wants a file:// scheme for this url.

Doesn’t necessarily mean it will work, but you’ll know more about the issue.

I have the same issue. Looking at the code it looks like snapd-xdg-open actually denies all urls which are not listed in this pretty limited whitelist.