Add support for multiple audio tracks

This commit is contained in:
hicom150
2019-09-25 22:17:02 +02:00
committed by Borewit
parent b9bcf747de
commit 0d27223f16
7 changed files with 106 additions and 5 deletions

View File

@@ -0,0 +1,17 @@
const { dispatch } = require('../lib/dispatcher')
module.exports = class AudioTracksController {
constructor (state) {
this.state = state
}
selectAudioTrack (ix) {
this.state.playing.audioTracks.selectedIndex = ix
dispatch('skip', 0.2) // HACK: hardcoded seek value for smooth audio change
}
toggleAudioTracksMenu () {
const audioTracks = this.state.playing.audioTracks
audioTracks.showMenu = !audioTracks.showMenu
}
}