Skip to content

Commit

Permalink
Fix bug: Desc button sometimes out-of-sync with desc state
Browse files Browse the repository at this point in the history
  • Loading branch information
terrill committed Feb 23, 2020
1 parent 325ba11 commit 637dea6
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
9 changes: 7 additions & 2 deletions build/ableplayer.dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -8245,8 +8245,12 @@ if (thisObj.useTtml && (trackSrc.endsWith('.xml') || trackText.startsWith('<?xml

thisObj = this;
if (this.swappingSrc) {
// wait until new source has loaded before refreshing controls
return;
if (this.playing) {
// wait until new source has loaded before refreshing controls
// can't wait if player is NOT playing because some critical events
// won't fire until playback of new media starts
return;
}
}

if (context === 'timeline' || context === 'init') {
Expand Down Expand Up @@ -8973,6 +8977,7 @@ if (thisObj.useTtml && (trackSrc.endsWith('.xml') || trackText.startsWith('<?xml
};

AblePlayer.prototype.handleDescriptionToggle = function() {

this.descOn = !this.descOn;
this.prefDesc = + this.descOn; // convert boolean to integer
this.updateCookie('prefDesc');
Expand Down
9 changes: 7 additions & 2 deletions build/ableplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8245,8 +8245,12 @@ if (thisObj.useTtml && (trackSrc.endsWith('.xml') || trackText.startsWith('<?xml

thisObj = this;
if (this.swappingSrc) {
// wait until new source has loaded before refreshing controls
return;
if (this.playing) {
// wait until new source has loaded before refreshing controls
// can't wait if player is NOT playing because some critical events
// won't fire until playback of new media starts
return;
}
}

if (context === 'timeline' || context === 'init') {
Expand Down Expand Up @@ -8973,6 +8977,7 @@ if (thisObj.useTtml && (trackSrc.endsWith('.xml') || trackText.startsWith('<?xml
};

AblePlayer.prototype.handleDescriptionToggle = function() {

this.descOn = !this.descOn;
this.prefDesc = + this.descOn; // convert boolean to integer
this.updateCookie('prefDesc');
Expand Down
4 changes: 2 additions & 2 deletions build/ableplayer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ableplayer",
"version": "4.2.10",
"version": "4.2.11",
"description": "fully accessible HTML5 media player",
"homepage": "http://ableplayer.github.io/ableplayer",
"bugs": "https://github.com/ableplayer/ableplayer/issues",
Expand Down
9 changes: 7 additions & 2 deletions scripts/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,12 @@

thisObj = this;
if (this.swappingSrc) {
// wait until new source has loaded before refreshing controls
return;
if (this.playing) {
// wait until new source has loaded before refreshing controls
// can't wait if player is NOT playing because some critical events
// won't fire until playback of new media starts
return;
}
}

if (context === 'timeline' || context === 'init') {
Expand Down Expand Up @@ -1198,6 +1202,7 @@
};

AblePlayer.prototype.handleDescriptionToggle = function() {

this.descOn = !this.descOn;
this.prefDesc = + this.descOn; // convert boolean to integer
this.updateCookie('prefDesc');
Expand Down

0 comments on commit 637dea6

Please sign in to comment.