File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ module Miso.Media
2727 , play
2828 , pause
2929 , getUserMedia
30+ , srcObject
3031 -- *** Properties
3132 , autoplay
3233 , controls
@@ -60,7 +61,7 @@ import qualified Language.Javascript.JSaddle as JS
6061import qualified Miso.FFI.Internal as FFI
6162import Miso.FFI
6263import Miso.Event
63- import Miso.Effect
64+ import Miso.Effect hiding ( (<#) )
6465import Miso.String
6566-----------------------------------------------------------------------------
6667newtype Media = Media JSVal
@@ -215,6 +216,10 @@ userMedia = UserMedia True True
215216-----------------------------------------------------------------------------
216217type Stream = JSVal
217218-----------------------------------------------------------------------------
219+ -- | Sets the `srcObject` on audio or video elements.
220+ srcObject :: Media -> Stream -> JSM ()
221+ srcObject (Media media) = media <# (" srcObject" :: MisoString )
222+ -----------------------------------------------------------------------------
218223-- | Get access to user's media devices.
219224--
220225-- <https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia>
You can’t perform that action at this time.
0 commit comments