Skip to content

Commit

Permalink
Fix (FEC-8755): player starts on mute (#3948)
Browse files Browse the repository at this point in the history
Added condition for the player to autoPlay when Automated
  • Loading branch information
shalomm-gloat authored and OrenMe committed Dec 6, 2018
1 parent dbe84d2 commit 6cc49fd
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions modules/EmbedPlayer/resources/mw.EmbedPlayerNative.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,9 @@
this.bindOnceHelper('playerReady', function () {
_this.setVolume(0);
});
} else {

} else if (mw.getConfig('autoMute') && mw.getConfig('autoPlay')) {
this.toggleMute( true );
if (mw.isMobileDevice()) {
this.mobileAutoPlay = true;
}
}

this.addBindings();
Expand Down Expand Up @@ -334,10 +332,14 @@
*/
canAutoPlay: function () {
if ( mw.isMobileDevice() ) {
return (this.mobileAutoPlay) || this.mobilePlayed;
var playsinline = true;
if ( mw.isIphone() ) {
playsinline = this.inline;
}
return (this.mobileAutoPlay && playsinline) || this.mobilePlayed || this.isMuted();
}
return true;
},
},

/**
* Post element javascript, binds event listeners and starts monitor
Expand Down

0 comments on commit 6cc49fd

Please sign in to comment.