scottschiller/SoundManager2 — pull request #41 by glaszig (2013-10-18 16:12:21+00:00)
Title: make swf filenames configurable

### background

i'm maintaining the [soundmanager-rails](https://github.com/glaszig/soundmanager-rails) which packages soundmanager 2 for use with rails' asset pipeline.
one feature of the pipeline is that upon deployment all assets get precompiled and digested leading to filenames like `soundmanager2-frkq3rh23l23fg23rh2l3rb2l.swf`.

now, the current implementation uses `sm2.url` and just appends `soundmanager2.swf` which will not work since rails only knows about `soundmanager2-frkq3rh23l23fg23rh2l3rb2l.swf` which in turn leads to flash support not working anymore because the swf url will 404.

### proposal

make swf filenames configurable so that rails users (and probably users of any other system/framework behaving similarly) can do somthing like this:

```ruby
soundManager.setup({
url: '<%= Rails.application.config.assets.prefix + "/swf/" %>',
flashFilename: '<%= File.basename asset_path "swf/soundmanager2.swf" %>',
flash9Filename: '<%= File.basename asset_path "swf/soundmanager2_flash9.swf" %>',
flashDebugFilename: '<%= File.basename asset_path "swf/soundmanager2_debug.swf" %>',
flash9DebugFilename: '<%= File.basename asset_path "swf/soundmanager2_flash9_debug.swf" %>',
debugMode: !<%= Soundmanager.env.production?.to_s %>
});
```

### solution

see diff. the change is backward-compatible by providing defaults for the config options:

'flashFilename': 'soundmanager2.swf',
'flashDebugFilename': 'soundmanager2_debug.swf',
'flash9Filename': 'soundmanager2_flash9.swf',
'flash9DebugFilename': 'soundmanager2_flash9_debug.swf',