Wrapping the whole player.js code in try-catch blocks