File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ module Miso.Media
27
27
, play
28
28
, pause
29
29
, getUserMedia
30
+ , srcObject
30
31
-- *** Properties
31
32
, autoplay
32
33
, controls
@@ -60,7 +61,7 @@ import qualified Language.Javascript.JSaddle as JS
60
61
import qualified Miso.FFI.Internal as FFI
61
62
import Miso.FFI
62
63
import Miso.Event
63
- import Miso.Effect
64
+ import Miso.Effect hiding ( (<#) )
64
65
import Miso.String
65
66
-----------------------------------------------------------------------------
66
67
newtype Media = Media JSVal
@@ -215,6 +216,10 @@ userMedia = UserMedia True True
215
216
-----------------------------------------------------------------------------
216
217
type Stream = JSVal
217
218
-----------------------------------------------------------------------------
219
+ -- | Sets the `srcObject` on audio or video elements.
220
+ srcObject :: Stream -> Media -> JSM ()
221
+ srcObject stream (Media media) = media <# (" srcObject" :: MisoString ) $ stream
222
+ -----------------------------------------------------------------------------
218
223
-- | Get access to user's media devices.
219
224
--
220
225
-- <https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia>
You can’t perform that action at this time.
0 commit comments