yodaos-project / yoda.js

Application Framework that powered YodaOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Application Component: VoiceFocus

legendecas opened this issue · comments

Is your feature request related to a problem? Please describe.
Please describe the problem you are trying to solve.

Describe the solution you'd like
App.js

module.exports = Application({
    url: function url (url) {
        this.startFocus('series-voice', url)
    }
})

series-voice-focus.js

module.exports = (url) => Focus({
    created: function created () {
        this.type = AudioFocus.Type.TRANSIENT
        // create player
    },
    started: function started () {
        // start playback
    },
    paused: function paused (mayDuck) {
        // pause or duck playback
    },
    resumed: function resumed () {
        // resume playback
    },
    stopped: function stopped () {
        // stop playback
    },
    destroyed: function destroyed () {
        // destroy player
    }
})

Describe alternatives you've considered
Please describe alternative solutions or features you have considered.

Application and AudioFocus have been landed on master in package @yodaos/application. Closing.