Also, you need to perform your testing on a device and not in the browser. If you have the cordova.js script line in your index.html and still getting this error, then you are probably not testing in a device. Some plugins will work in the emulator and others require testing on an actual device because the physical hardware must be present, e.g. the camera plugin needs an actual camera. Also, the cordova library needs some time to load so if your app is executing the plugin immeadiately, you will need to wrap the code in the platform ready event…
There is some good info at the ngCordova site. This is a library that grew out of Ionic and provides a standard interface for using the cordova plugins. Unfortunately, your YouTube plugin does not appear to be provided. However, there are still some great best practices info on the site and in the library code. Give it a look…