WIP Support for Windows AutoPlay
#1
Brick 
Hey all,

I have a local change-in-progress that adds Windows shell registration to Kodi (obviously, the Windows version only). This will allow the following scenarios:
  • Kodi will appear in the list of "Open with..." apps for all supported file types
  • Kodi can be set as the AutoPlay app to be launched when a DVD or CD is inserted.
  • Kodi can be set as the default app to launch when the user double-clicks on a supported media file

In technical terms, this amounts to the following:
  • Kodi needs to support the standard /regServer and /unregServer command-line arguments, telling it to add/remove itself from the Windows registry. This tells Windows how to launch Kodi, and what COM objects it exposes. kodi.exe /regServer will need to be run as part of the installation process of Kodi.
  • Kodi needs to register itself with COM on startup, in order to respond to any AutoPlay event which might've caused Kodi to be spawned in the first place.
  • Kodi needs to accept command-line arguments of files to be played. If launched in this fashion, it should jump straight into playing the specified file(s).

I am probably about 75% done with enabling AutoPlay integration right now, and hope to get that "pull worthy" within the next month or two. Adding "Open With..." support, after that, shouldn't be too hard (except for the tedium of tracking down all of the file types Kodi should register for). Allowing Kodi to make itself the "default" app for launching various file types would be the last step, and this requires some further thinking, as we wouldn't want to unconditionally stomp over whatever apps the user currently has as "default". Perhaps selecting file types would be made part of the install process...not sure.

Anyway, I'd be interested to hear feedback from anyone. Specifically:
  • I wanted people to know this was being worked on, and make sure there isn't some duplicate effort going on to accomplish the same thing.
  • IMO, this kind of integration is super-useful on Windows PC systems, and is a worthy addition. Do y'all agree? I'd hate to spend a lot of effort just to have my pull request denied. Sad
  • Can anyone tell me how to identify the full list of file types supported by Kodi?
  • I've mostly figured out the COM registration stuff...I just need to figure out what function to call in order to tell Kodi "Play the disc". I'm sure I can locate it if I go digging, but if someone call point me to it, that might save me some time.

JediRy
Reply
#2
I like your idea, and I hope this will be integrated in official version of Kodi in the future! Good luck with development Smile!
Reply
#3
Supported file types are defined in https://github.com/xbmc/xbmc/blob/master...#L391-L399. PlayDisc @ https://github.com/xbmc/xbmc/blob/master...utorun.cpp
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#4
Just bumping this thread to see if any progress has been made in Windows AutoPlay support. I think the minimum needed is support for a command line arg to play files (or better yet, a drive letter). Until the installer is updated, DefaultProgramsEditor can be used to manually add the necessary Windows AutoPlay handlers. I am willing to help code up this support if you let me know where you are at. Thanks for the idea, I think this would really be nice to have.

-miesch1
Reply

Logout Mark Read Team Forum Stats Members Help
Support for Windows AutoPlay0