summaryrefslogtreecommitdiff
path: root/Miso/FFI/Audio.hs
diff options
context:
space:
mode:
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 ()