-
Notifications
You must be signed in to change notification settings - Fork 761
Master rebased #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…d. Fixes problems with starting sounds at a certain position. * In setPosition() use the duration from the instance options, if we don't have a track duration yet, otherwise the position is always 0. In start(): Seek after playing otherwise streams that have not played yet throw a NetStream.Seek.Failed. In start(): Fix bug for streams. nMsecOffset must be converted to seconds before calling ns.seek().
… resetting the _t.position.
|
Nice, got it. I think I got most things correct, although I didn't see JSLint complaining about certain functions not returning anything eg. true/false etc. (Did you see errors/warnings, and what version etc. of JSLint were you using? I didn't see these, hrm.) |
|
Hey Scott, I tested that merge and it something was wrong with the SMSound class...I think I merged into the wrong one, because there were two. Anyways, I spent a long time trying different merging strategies and have finally sorted things out. I'm testing it now. I'll send you another pull request later once I verify this build. |
…layered / "chorused" playback if play() is called and multiShot: true has been specified to either createSound() or play(). Behaviour should mimic that of Flash 9. If multiShotEvents: true is specified, onfinish() will fire for each instance. Implementation summary: A new Audio(src) instance is created, with an onfinish listener, and played immediately. It is unloaded and destroyed when playback finishes. Caveat #1: If a position argument is provided eg., play({ position: 1000 }), the cloned Audio() instance must wait for a HTML5 "canplay" event before a seek and playback can begin. This may mean playback *could* have a slight delay vs. playing without the position offset. Caveat #2: The from/to parameters used for "sound sprites", e.g., { from: 500, to: 1500 }, are not presently supported under multiShot. Caveat #3: multiShot is not supported where only a single audio instance can be playing at once, e.g., iOS (iPhone/iPad) and some Android devices. Secondary instances are "fire-and-forget", similar to the Flash 9 implementation, and fire no events other than onfinish(). They do not respond to position, volume etc. after playback has begun. HTML5 unloading: Firefox was supposed to like assigning '' to Audio().url for canceling requests, unloading and destroying the decoder (perhaps only on <audio>, in retrospect?) - similarly, .src = null did not seem to work, possible request to ./ - undesirable. Now using more-conservative Audio().url = (isSafari && !is_iDevice ? null : (isFirefox ? emptyURL : null)); where emptyURL is user-customizable, 'about:blank' by default.
Hi Scott,
Here are my fixes applied to your latest. I've still got to test the merge to make sure that everything went ok. I seemed to have included the SMSound class twice in soundmanager.js from the merge. I remove it at the end.
I think I can update this pull request so I'll do that if I have any changes.