summaryrefslogtreecommitdiff
path: root/Miso/FFI/Audio.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2019-11-23 16:38:47 -0800
committerBen Sima <ben@bsima.me>2019-11-23 16:45:05 -0800
commit294c8e19b136f06ca7fa1bb4e4d109e90e2bb033 (patch)
treed8f56bdfc0451f9ad33e4ae396204bd0ba171d4d /Miso/FFI/Audio.hs
parenteb7e442d930bda88aac3c6aad0825b5aa4173e5e (diff)
Add Com.MusicMeetsComics
Diffstat (limited to 'Miso/FFI/Audio.hs')
-rw-r--r--Miso/FFI/Audio.hs20
1 files changed, 20 insertions, 0 deletions
diff --git a/Miso/FFI/Audio.hs b/Miso/FFI/Audio.hs
new file mode 100644
index 0000000..e21ab57
--- /dev/null
+++ b/Miso/FFI/Audio.hs
@@ -0,0 +1,20 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+module Miso.FFI.Audio where
+
+import GHCJS.Types
+import Protolude
+
+{-
+Usage:
+
+obj <- Miso.FFI.Document.getElementById "myAudioPlayer"
+play obj
+pause obj
+
+-}
+
+foreign import javascript unsafe "$1.play();"
+ play :: JSVal -> IO ()
+
+foreign import javascript unsafe "$1.pause();"
+ pause :: JSVal -> IO ()