Created
March 23, 2018 16:44
-
-
Save FruitieX/6e918322864ebff530c6e816080e3805 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let (loadedVideo :: Maybe VideoId) = old.loadedVideoId | |
let (nextVideo :: Maybe VideoId) = _.id <$> head new.app.queue | |
liftEff $ | |
case new.app.play /\ nextVideo of | |
true /\ loadedVideo -> YT.callPlayer player "playVideo" [] | |
true /\ Just nextVideo' -> YT.callPlayer player "loadVideoById" [unwrap nextVideo'] | |
_ -> YT.callPlayer player "pauseVideo" [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment