Skip to content

Instantly share code, notes, and snippets.

@FruitieX
Created March 23, 2018 16:44
Show Gist options
  • Save FruitieX/6e918322864ebff530c6e816080e3805 to your computer and use it in GitHub Desktop.
Save FruitieX/6e918322864ebff530c6e816080e3805 to your computer and use it in GitHub Desktop.
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