module JSDOM.Generated.MediaDevices
(enumerateDevices, enumerateDevices_, getSupportedConstraints,
getSupportedConstraints_, getUserMedia, getUserMedia_,
devicechange, MediaDevices(..), gTypeMediaDevices)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show, Read, Eq, Ord, Maybe(..))
import qualified Prelude (error)
import Data.Typeable (Typeable)
import Data.Traversable (mapM)
import Language.Javascript.JSaddle (JSM(..), JSVal(..), JSString, strictEqual, toJSVal, valToStr, valToNumber, valToBool, js, jss, jsf, jsg, function, asyncFunction, new, array, jsUndefined, (!), (!!))
import Data.Int (Int64)
import Data.Word (Word, Word64)
import JSDOM.Types
import Control.Applicative ((<$>))
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import JSDOM.EventTargetClosures (EventName, unsafeEventName)
import JSDOM.Enums
enumerateDevices ::
(MonadDOM m) => MediaDevices -> m [MediaDeviceInfo]
enumerateDevices self
= liftDOM
(((self ^. jsf "enumerateDevices" ()) >>= readPromise) >>=
fromJSArrayUnchecked)
enumerateDevices_ :: (MonadDOM m) => MediaDevices -> m ()
enumerateDevices_ self
= liftDOM (void (self ^. jsf "enumerateDevices" ()))
getSupportedConstraints ::
(MonadDOM m) => MediaDevices -> m MediaTrackSupportedConstraints
getSupportedConstraints self
= liftDOM
((self ^. jsf "getSupportedConstraints" ()) >>= fromJSValUnchecked)
getSupportedConstraints_ :: (MonadDOM m) => MediaDevices -> m ()
getSupportedConstraints_ self
= liftDOM (void (self ^. jsf "getSupportedConstraints" ()))
getUserMedia ::
(MonadDOM m) =>
MediaDevices -> Maybe MediaStreamConstraints -> m MediaStream
getUserMedia self constraints
= liftDOM
(((self ^. jsf "getUserMedia" [toJSVal constraints]) >>=
readPromise)
>>= fromJSValUnchecked)
getUserMedia_ ::
(MonadDOM m) =>
MediaDevices -> Maybe MediaStreamConstraints -> m ()
getUserMedia_ self constraints
= liftDOM (void (self ^. jsf "getUserMedia" [toJSVal constraints]))
devicechange :: EventName MediaDevices ondevicechange
devicechange = unsafeEventName (toJSString "devicechange")