Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #13873 from TheKinshu/issue12569
Browse files Browse the repository at this point in the history
Fixes Audio indicator if tab muted and video stops playing
  • Loading branch information
bsclifton authored May 7, 2018
2 parents ed7b2b4 + b9b5c24 commit d8438b3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/common/state/tabContentState/audioState.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ module.exports.showAudioTopBorder = (state, frameKey, isPinned) => {
return false
}

if (module.exports.isAudioMuted(state, frameKey)) {
return false
}

return (
module.exports.canPlayAudio(state, frameKey) &&
(isEntryIntersected(state, 'tabs') || isPinned)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,13 @@ describe('audioState unit tests', function () {
const result = audioState.showAudioTopBorder(state, frameKey, false)
assert.equal(result, false)
})

it('return false if tab audio is mute and not pinned', function * () {
const state = defaultState
.setIn(['frames', index, 'audioPlayback'], true)
.setIn(['frames', index, 'audioMuted'], true)
const result = audioState.showAudioTopBorder(state, frameKey, false)
assert.equal(result, false)
})
})
})

0 comments on commit d8438b3

Please sign in to comment.