-wesabe.provide('download.CompoundPlayer')
+extend = require 'lang/extend'
 
-class wesabe.download.CompoundPlayer
+class CompoundPlayer
   @register: (params) ->
-    klass = @create(params)
+    klass = @create params
 
     # make sure we put it where wesabe.require expects it
-    wesabe.provide("fi-scripts.#{klass.fid}", klass)
+    wesabe.provide "fi-scripts.#{klass.fid}", klass
 
     return klass
 

    # customize fail to go to the next player
    job_fail_original = @job.fail
    @job.fail = (status, result) =>
      wesabe.info "Could not complete job with ", @currentPlayer, " (", status, " ", result, ")"

      # if we can't, just report the last failure
      startNextPlayer(=> job_fail_original.call(@job, status, result))


  @::__defineGetter__ 'browser', ->
    @currentPlayer?.browser


module.exports = CompoundPlayer
