Loading js libraries via register_asset

I looked at your plugin and I can confirm the eval is only present in development mode. In production it will be inserted in the global scope. I understand that’s not ideal but I also don’t think libraries should normally be distributed without some kind of support for modules (for example, UMD.)

My suggestion would be to repackage the JS with some kind of UMD support and then import it but that is somewhat tricky to set up if you don’t have a lot of JS experience with modules.

Instead, an easy way to get this to work is to edit RecordRTC.js and add the following line:

window.RecordRTC = RecordRTC;

It would be even better to surround the entire contents in an IIFE:

(function(exports) {
  // original file contents go here
  exports.RecordRTC = RecordRTC;
})(window);