This addresses a bug when we call setup multiple times before its ready [Delivers #83939432]

Good point. While testing it this way, I learned that when there is a setup
error, the _playerReady flag stays false, and so it never actually removes
the player.

On Mon, Dec 29, 2014 at 11:49 PM, Rob Walch <notifications@github.com>
wrote:

> In src/js/api/jwplayer.api.js
> <https://github.com/jwplayer/jwplayer/pull/235#discussion-diff-22338699>:
>
> >              if (!_playerReady) {
> > -                throw 'Cannot call remove() before player is ready';
> > +
> > +                // To ensure we don't double delete the player
> > +                if (_this.aborted) {
> > +                    return;
> > +                }
> > +                _this.aborted = true;
> > +
> > +                _this.onReady(function() {
>
> Either onReady or onSetupError may be called. How about adding a test that
> calls setup several times with a config that results in a setup error.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/jwplayer/jwplayer/pull/235/files#r22338699>.
>