Closed spmurrayzzz closed 10 years ago
There might be link shortening services with APIs that don't require authentication. Maybe we could post to a shortening service with ajax and send it the hashed URL. Then present the user with the shortened one we get back.
When someone clicks the shortened link, they get redirected to the app, we read the hash and decode it, and then immediately set location.hash = ''
so the user never has to actually see it.
I'm not really sold on that, and it's sort of a gross hack... but I'd love to find a way to avoid having a back end. Maybe that's unrealistic though.
Committed 79abe4f6f9271957c4058a020224b7494bb1e02f as a temporary solution. It's just setting location.hash
to a super long JSON string of the whole mix. Pretty gross, but I know @ruthmann really wanted to get the sharing thing solved, so this should hopefully be okay at least in the short-term.
I'm gonna leave this issue open, because we still need something much better than this quick hack.
This is a good start. Its gonna be hard to do this properly without a real backend though. That discussion will also have to include whether or not this app is a hosted solution akin to something like Wordpress (i.e. can be hosted by a provider, but also downloaded by users and installed on their own hosts) or whether its more like a SaaS solution (i.e. singleton app that hosts different user's accounts).
The latter is clearly a shitshow.
As much as I hate PHP, that's probably the way to go, at least as a first pass. We could add Node/Mongo support too down the line if there was demand for that.
PHP plus JSON files would be a nice drop-in solution for anyone running Apache. I think we really want to limit (or remove) any kind of server configuration -- or at least have the easy path as an option for people.
Ultimately, I think this depends a bit on traction.
The load of the files breaks if you have a track soloed in the hash.
See: http://kevvv.in/mix/#{"name":"1901","gain":1,"minTime":3,"maxTime":192,"tracks":[{"name":"Kit L","path":"sounds/1901_drumsleft.mp3","gain":0.5175,"pan":-1,"muted":false,"_muted":false,"soloed":true,"afl":true,"duration":211.62612915039062},{"name":"Kit R","path":"sounds/1901_drumsright.mp3","gain":0.5175,"pan":1,"muted":false,"_muted":false,"soloed":true,"afl":true,"duration":211.62612915039062},{"name":"Triggers","path":"sounds/1901_triggers.mp3","gain":0.57045454545455,"pan":0,"muted":false,"_muted":true,"soloed":false,"afl":true,"duration":211.0693817138672},{"name":"Bass","path":"sounds/1901_bass.mp3","gain":0.38159090909091,"pan":0,"muted":false,"_muted":true,"soloed":false,"afl":true,"duration":211.0693817138672},{"name":"Keys","path":"sounds/1901_keys.mp3","gain":0.76318181818182,"pan":-0.31817540662604,"muted":false,"_muted":false,"soloed":true,"afl":true,"duration":211.0693817138672},{"name":"Gtr 1","path":"sounds/1901_gtr1.mp3","gain":1.0604318698347108,"pan":-0.16763424252422,"muted":false,"_muted":false,"soloed":true,"afl":true,"duration":211.0693817138672},{"name":"Gtr 2","path":"sounds/1901_gtr2.mp3","gain":0.805,"pan":0.44667745226923,"muted":false,"_muted":true,"soloed":false,"afl":true,"duration":211.0693817138672},{"name":"Synth 1","path":"sounds/1901_synth1.mp3","gain":0.41295454545455,"pan":-0.020272528811521,"muted":false,"_muted":true,"soloed":false,"afl":true,"duration":211.0693817138672},{"name":"Synth 2","path":"sounds/1901_synth2.mp3","gain":0.61159090909091,"pan":0.30769297080169,"muted":false,"_muted":true,"soloed":false,"afl":true,"duration":211.0693817138672},{"name":"Siren","path":"sounds/1901_siren.mp3","gain":0.54886363636364,"pan":0.086623719781989,"muted":false,"_muted":true,"soloed":false,"afl":true,"duration":211.0693817138672},{"name":"Vox FX","path":"sounds/1901_voxfx.mp3","gain":0.87295454545455,"pan":0,"muted":false,"_muted":true,"soloed":false,"afl":true,"duration":211.62612915039062},{"name":"Ld Vox","path":"sounds/1901_leadvox.mp3","gain":1.0088636363636,"pan":0,"muted":false,"_muted":true,"soloed":false,"afl":true,"duration":211.62612915039062}]}
If you set all "soloed" fields to false, all works fine.
Thanks for reporting. Should be all set now: edfb3d45bcc19f43c49a2c703d789ac861039016 (Issue #6)
If you find any more bugs, feel free to submit them as new issues.
Share functionality is working great - You can check it out via the convergent mix tool we built - http://www.nyu.edu/projects/ruthmann/PWYM/airtraffic/ - for integration in our online course at http://playwithyourmusic.org/.
I'm going to close this. We have the URL hash. It's ugly, but it's functional.
Part of what I like about this project is that it's very low barrier to entry. Clone the repo, maybe install Node if you don't already have it, and you can build a directory of static files that'll work on basically any machine.
If we add a Node/PHP/Python/Whatever back end plus database dependency, it's going to make it a lot harder for some people to get up and running.
If a better solution for sharing a mix is really important to someone, it would probably take less than an hour to clone the repo and build some kind of minimal little back end that meets their needs.
I know this is already closed, but just an update:
I just added a commit that uses the free myjson.com service for persistence. What that means, basically, is that instead of these ridiculous location hashes with the entire Mix object encoded, we now have hashes like '8XF7'
. Those refer to a bin ID on myjson.jom, and we fetch the actual mix data from there on page load.
The previous iteration used an exceedingly verbose query string to accomplish this, but if we have a backend setup, I imagine it could use a short hash as a mix identifier.