From 294c8e19b136f06ca7fa1bb4e4d109e90e2bb033 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 23 Nov 2019 16:38:47 -0800 Subject: Add Com.MusicMeetsComics --- Miso/FFI/Audio.hs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Miso/FFI/Audio.hs (limited to 'Miso/FFI/Audio.hs') 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 () -- cgit v1.2.3