Fix play/pause toggle bug

Sometimes, while casting, WT thinks the video isn't visible and the play/pause toggle stops working
This commit is contained in:
DC
2016-07-21 01:03:45 -07:00
parent 2fc1034cc5
commit c59abb251b

View File

@@ -54,8 +54,8 @@ module.exports = class PlaybackController {
// force rerendering if window is hidden,
// in order to bypass `raf` and play/pause media immediately
if (!state.window.isVisible) {
var mediaTag = document.querySelector('video,audio')
var mediaTag = document.querySelector('video,audio')
if (!state.window.isVisible && mediaTag) {
if (state.playing.isPaused) mediaTag.play()
else mediaTag.pause()
}