Media URL is case sensitive, but not with ionic serve

Continuing the discussion from How to play local audio files:

Finally got this working, using a slight variant of loicknuchel’s code. A couple tips might help others:

The kink that tripped me up was that the local media url turned out to be case sensitive in the emulator and device, but not using ionic serve. now redirects to cordoba-plugin-media.

The loicknuchel’s window.Media definition is needed using ionic serve, but is ignored in a device or emulator run.