{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.HTMLMediaElement
(load, canPlayType, canPlayType_, getStartDate, getStartDate_,
play, pause, fastSeek, webkitSetMediaKeys, setMediaKeys,
addTextTrack, addTextTrack_, getVideoPlaybackQuality,
getVideoPlaybackQuality_, webkitShowPlaybackTargetPicker,
pattern NETWORK_EMPTY, pattern NETWORK_IDLE,
pattern NETWORK_LOADING, pattern NETWORK_NO_SOURCE,
pattern HAVE_NOTHING, pattern HAVE_METADATA,
pattern HAVE_CURRENT_DATA, pattern HAVE_FUTURE_DATA,
pattern HAVE_ENOUGH_DATA, getError, setSrc, getSrc, setSrcObject,
getSrcObject, getSrcObjectUnsafe, getSrcObjectUnchecked,
getCurrentSrc, setCrossOrigin, getCrossOrigin,
getCrossOriginUnsafe, getCrossOriginUnchecked, getNetworkState,
setPreload, getPreload, getBuffered, getReadyState, getSeeking,
setCurrentTime, getCurrentTime, getDuration, getPaused,
setDefaultPlaybackRate, getDefaultPlaybackRate, setPlaybackRate,
getPlaybackRate, getPlayed, getSeekable, getEnded, setAutoplay,
getAutoplay, setLoop, getLoop, setControls, getControls, setVolume,
getVolume, setMuted, getMuted, setDefaultMuted, getDefaultMuted,
setWebkitPreservesPitch, getWebkitPreservesPitch,
getWebkitHasClosedCaptions, setWebkitClosedCaptionsVisible,
getWebkitClosedCaptionsVisible, getWebkitAudioDecodedByteCount,
getWebkitVideoDecodedByteCount, getWebkitKeys, getMediaKeys,
encrypted, waitingforkey, getAudioTracks, getTextTracks,
getVideoTracks, setMediaGroup, getMediaGroup, setController,
getController, getControllerUnsafe, getControllerUnchecked,
getWebkitCurrentPlaybackTargetIsWireless, setKind, getKind,
setSession, getSession, getSessionUnsafe, getSessionUnchecked,
HTMLMediaElement(..), gTypeHTMLMediaElement, IsHTMLMediaElement,
toHTMLMediaElement)
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, unsafeEventNameAsync)
import JSDOM.Enums
load :: (MonadDOM m, IsHTMLMediaElement self) => self -> m ()
load self
= liftDOM (void ((toHTMLMediaElement self) ^. jsf "load" ()))
canPlayType ::
(MonadDOM m, IsHTMLMediaElement self, ToJSString type',
FromJSString result) =>
self -> type' -> m result
canPlayType self type'
= liftDOM
(((toHTMLMediaElement self) ^. jsf "canPlayType" [toJSVal type'])
>>= fromJSValUnchecked)
canPlayType_ ::
(MonadDOM m, IsHTMLMediaElement self, ToJSString type') =>
self -> type' -> m ()
canPlayType_ self type'
= liftDOM
(void
((toHTMLMediaElement self) ^. jsf "canPlayType" [toJSVal type']))
getStartDate ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Date
getStartDate self
= liftDOM
(((toHTMLMediaElement self) ^. jsf "getStartDate" ()) >>=
fromJSValUnchecked)
getStartDate_ ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m ()
getStartDate_ self
= liftDOM
(void ((toHTMLMediaElement self) ^. jsf "getStartDate" ()))
play :: (MonadDOM m, IsHTMLMediaElement self) => self -> m ()
play self
= liftDOM
(void
(((toHTMLMediaElement self) ^. jsf "play" ()) >>= readPromise))
pause :: (MonadDOM m, IsHTMLMediaElement self) => self -> m ()
pause self
= liftDOM (void ((toHTMLMediaElement self) ^. jsf "pause" ()))
fastSeek ::
(MonadDOM m, IsHTMLMediaElement self) => self -> Double -> m ()
fastSeek self time
= liftDOM
(void ((toHTMLMediaElement self) ^. jsf "fastSeek" [toJSVal time]))
webkitSetMediaKeys ::
(MonadDOM m, IsHTMLMediaElement self) =>
self -> Maybe WebKitMediaKeys -> m ()
webkitSetMediaKeys self mediaKeys
= liftDOM
(void
((toHTMLMediaElement self) ^. jsf "webkitSetMediaKeys"
[toJSVal mediaKeys]))
setMediaKeys ::
(MonadDOM m, IsHTMLMediaElement self) =>
self -> Maybe MediaKeys -> m ()
setMediaKeys self mediaKeys
= liftDOM
(void
(((toHTMLMediaElement self) ^. jsf "setMediaKeys"
[toJSVal mediaKeys])
>>= readPromise))
addTextTrack ::
(MonadDOM m, IsHTMLMediaElement self, ToJSString kind,
ToJSString label, ToJSString language) =>
self -> kind -> Maybe label -> Maybe language -> m TextTrack
addTextTrack self kind label language
= liftDOM
(((toHTMLMediaElement self) ^. jsf "addTextTrack"
[toJSVal kind, toJSVal label, toJSVal language])
>>= fromJSValUnchecked)
addTextTrack_ ::
(MonadDOM m, IsHTMLMediaElement self, ToJSString kind,
ToJSString label, ToJSString language) =>
self -> kind -> Maybe label -> Maybe language -> m ()
addTextTrack_ self kind label language
= liftDOM
(void
((toHTMLMediaElement self) ^. jsf "addTextTrack"
[toJSVal kind, toJSVal label, toJSVal language]))
getVideoPlaybackQuality ::
(MonadDOM m, IsHTMLMediaElement self) =>
self -> m VideoPlaybackQuality
getVideoPlaybackQuality self
= liftDOM
(((toHTMLMediaElement self) ^. jsf "getVideoPlaybackQuality" ())
>>= fromJSValUnchecked)
getVideoPlaybackQuality_ ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m ()
getVideoPlaybackQuality_ self
= liftDOM
(void
((toHTMLMediaElement self) ^. jsf "getVideoPlaybackQuality" ()))
webkitShowPlaybackTargetPicker ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m ()
webkitShowPlaybackTargetPicker self
= liftDOM
(void
((toHTMLMediaElement self) ^. jsf "webkitShowPlaybackTargetPicker"
()))
pattern NETWORK_EMPTY = 0
pattern NETWORK_IDLE = 1
pattern NETWORK_LOADING = 2
pattern NETWORK_NO_SOURCE = 3
pattern HAVE_NOTHING = 0
pattern HAVE_METADATA = 1
pattern HAVE_CURRENT_DATA = 2
pattern HAVE_FUTURE_DATA = 3
pattern HAVE_ENOUGH_DATA = 4
getError ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m MediaError
getError self
= liftDOM
(((toHTMLMediaElement self) ^. js "error") >>= fromJSValUnchecked)
setSrc ::
(MonadDOM m, IsHTMLMediaElement self, ToJSString val) =>
self -> val -> m ()
setSrc self val
= liftDOM ((toHTMLMediaElement self) ^. jss "src" (toJSVal val))
getSrc ::
(MonadDOM m, IsHTMLMediaElement self, FromJSString result) =>
self -> m result
getSrc self
= liftDOM
(((toHTMLMediaElement self) ^. js "src") >>= fromJSValUnchecked)
setSrcObject ::
(MonadDOM m, IsHTMLMediaElement self, IsMediaProvider val) =>
self -> Maybe val -> m ()
setSrcObject self val
= liftDOM
((toHTMLMediaElement self) ^. jss "srcObject" (toJSVal val))
getSrcObject ::
(MonadDOM m, IsHTMLMediaElement self) =>
self -> m (Maybe MediaProvider)
getSrcObject self
= liftDOM
(((toHTMLMediaElement self) ^. js "srcObject") >>= fromJSVal)
getSrcObjectUnsafe ::
(MonadDOM m, IsHTMLMediaElement self, HasCallStack) =>
self -> m MediaProvider
getSrcObjectUnsafe self
= liftDOM
((((toHTMLMediaElement self) ^. js "srcObject") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getSrcObjectUnchecked ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m MediaProvider
getSrcObjectUnchecked self
= liftDOM
(((toHTMLMediaElement self) ^. js "srcObject") >>=
fromJSValUnchecked)
getCurrentSrc ::
(MonadDOM m, IsHTMLMediaElement self, FromJSString result) =>
self -> m result
getCurrentSrc self
= liftDOM
(((toHTMLMediaElement self) ^. js "currentSrc") >>=
fromJSValUnchecked)
setCrossOrigin ::
(MonadDOM m, IsHTMLMediaElement self, ToJSString val) =>
self -> Maybe val -> m ()
setCrossOrigin self val
= liftDOM
((toHTMLMediaElement self) ^. jss "crossOrigin" (toJSVal val))
getCrossOrigin ::
(MonadDOM m, IsHTMLMediaElement self, FromJSString result) =>
self -> m (Maybe result)
getCrossOrigin self
= liftDOM
(((toHTMLMediaElement self) ^. js "crossOrigin") >>=
fromMaybeJSString)
getCrossOriginUnsafe ::
(MonadDOM m, IsHTMLMediaElement self, HasCallStack,
FromJSString result) =>
self -> m result
getCrossOriginUnsafe self
= liftDOM
((((toHTMLMediaElement self) ^. js "crossOrigin") >>=
fromMaybeJSString)
>>= maybe (Prelude.error "Nothing to return") return)
getCrossOriginUnchecked ::
(MonadDOM m, IsHTMLMediaElement self, FromJSString result) =>
self -> m result
getCrossOriginUnchecked self
= liftDOM
(((toHTMLMediaElement self) ^. js "crossOrigin") >>=
fromJSValUnchecked)
getNetworkState ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Word
getNetworkState self
= liftDOM
(round <$>
(((toHTMLMediaElement self) ^. js "networkState") >>= valToNumber))
setPreload ::
(MonadDOM m, IsHTMLMediaElement self, ToJSString val) =>
self -> val -> m ()
setPreload self val
= liftDOM
((toHTMLMediaElement self) ^. jss "preload" (toJSVal val))
getPreload ::
(MonadDOM m, IsHTMLMediaElement self, FromJSString result) =>
self -> m result
getPreload self
= liftDOM
(((toHTMLMediaElement self) ^. js "preload") >>=
fromJSValUnchecked)
getBuffered ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m TimeRanges
getBuffered self
= liftDOM
(((toHTMLMediaElement self) ^. js "buffered") >>=
fromJSValUnchecked)
getReadyState ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Word
getReadyState self
= liftDOM
(round <$>
(((toHTMLMediaElement self) ^. js "readyState") >>= valToNumber))
getSeeking ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Bool
getSeeking self
= liftDOM
(((toHTMLMediaElement self) ^. js "seeking") >>= valToBool)
setCurrentTime ::
(MonadDOM m, IsHTMLMediaElement self) => self -> Double -> m ()
setCurrentTime self val
= liftDOM
((toHTMLMediaElement self) ^. jss "currentTime" (toJSVal val))
getCurrentTime ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Double
getCurrentTime self
= liftDOM
(((toHTMLMediaElement self) ^. js "currentTime") >>= valToNumber)
getDuration ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Double
getDuration self
= liftDOM
(((toHTMLMediaElement self) ^. js "duration") >>= valToNumber)
getPaused ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Bool
getPaused self
= liftDOM
(((toHTMLMediaElement self) ^. js "paused") >>= valToBool)
setDefaultPlaybackRate ::
(MonadDOM m, IsHTMLMediaElement self) => self -> Double -> m ()
setDefaultPlaybackRate self val
= liftDOM
((toHTMLMediaElement self) ^. jss "defaultPlaybackRate"
(toJSVal val))
getDefaultPlaybackRate ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Double
getDefaultPlaybackRate self
= liftDOM
(((toHTMLMediaElement self) ^. js "defaultPlaybackRate") >>=
valToNumber)
setPlaybackRate ::
(MonadDOM m, IsHTMLMediaElement self) => self -> Double -> m ()
setPlaybackRate self val
= liftDOM
((toHTMLMediaElement self) ^. jss "playbackRate" (toJSVal val))
getPlaybackRate ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Double
getPlaybackRate self
= liftDOM
(((toHTMLMediaElement self) ^. js "playbackRate") >>= valToNumber)
getPlayed ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m TimeRanges
getPlayed self
= liftDOM
(((toHTMLMediaElement self) ^. js "played") >>= fromJSValUnchecked)
getSeekable ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m TimeRanges
getSeekable self
= liftDOM
(((toHTMLMediaElement self) ^. js "seekable") >>=
fromJSValUnchecked)
getEnded :: (MonadDOM m, IsHTMLMediaElement self) => self -> m Bool
getEnded self
= liftDOM (((toHTMLMediaElement self) ^. js "ended") >>= valToBool)
setAutoplay ::
(MonadDOM m, IsHTMLMediaElement self) => self -> Bool -> m ()
setAutoplay self val
= liftDOM
((toHTMLMediaElement self) ^. jss "autoplay" (toJSVal val))
getAutoplay ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Bool
getAutoplay self
= liftDOM
(((toHTMLMediaElement self) ^. js "autoplay") >>= valToBool)
setLoop ::
(MonadDOM m, IsHTMLMediaElement self) => self -> Bool -> m ()
setLoop self val
= liftDOM ((toHTMLMediaElement self) ^. jss "loop" (toJSVal val))
getLoop :: (MonadDOM m, IsHTMLMediaElement self) => self -> m Bool
getLoop self
= liftDOM (((toHTMLMediaElement self) ^. js "loop") >>= valToBool)
setControls ::
(MonadDOM m, IsHTMLMediaElement self) => self -> Bool -> m ()
setControls self val
= liftDOM
((toHTMLMediaElement self) ^. jss "controls" (toJSVal val))
getControls ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Bool
getControls self
= liftDOM
(((toHTMLMediaElement self) ^. js "controls") >>= valToBool)
setVolume ::
(MonadDOM m, IsHTMLMediaElement self) => self -> Double -> m ()
setVolume self val
= liftDOM ((toHTMLMediaElement self) ^. jss "volume" (toJSVal val))
getVolume ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Double
getVolume self
= liftDOM
(((toHTMLMediaElement self) ^. js "volume") >>= valToNumber)
setMuted ::
(MonadDOM m, IsHTMLMediaElement self) => self -> Bool -> m ()
setMuted self val
= liftDOM ((toHTMLMediaElement self) ^. jss "muted" (toJSVal val))
getMuted :: (MonadDOM m, IsHTMLMediaElement self) => self -> m Bool
getMuted self
= liftDOM (((toHTMLMediaElement self) ^. js "muted") >>= valToBool)
setDefaultMuted ::
(MonadDOM m, IsHTMLMediaElement self) => self -> Bool -> m ()
setDefaultMuted self val
= liftDOM
((toHTMLMediaElement self) ^. jss "defaultMuted" (toJSVal val))
getDefaultMuted ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Bool
getDefaultMuted self
= liftDOM
(((toHTMLMediaElement self) ^. js "defaultMuted") >>= valToBool)
setWebkitPreservesPitch ::
(MonadDOM m, IsHTMLMediaElement self) => self -> Bool -> m ()
setWebkitPreservesPitch self val
= liftDOM
((toHTMLMediaElement self) ^. jss "webkitPreservesPitch"
(toJSVal val))
getWebkitPreservesPitch ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Bool
getWebkitPreservesPitch self
= liftDOM
(((toHTMLMediaElement self) ^. js "webkitPreservesPitch") >>=
valToBool)
getWebkitHasClosedCaptions ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Bool
getWebkitHasClosedCaptions self
= liftDOM
(((toHTMLMediaElement self) ^. js "webkitHasClosedCaptions") >>=
valToBool)
setWebkitClosedCaptionsVisible ::
(MonadDOM m, IsHTMLMediaElement self) => self -> Bool -> m ()
setWebkitClosedCaptionsVisible self val
= liftDOM
((toHTMLMediaElement self) ^. jss "webkitClosedCaptionsVisible"
(toJSVal val))
getWebkitClosedCaptionsVisible ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Bool
getWebkitClosedCaptionsVisible self
= liftDOM
(((toHTMLMediaElement self) ^. js "webkitClosedCaptionsVisible")
>>= valToBool)
getWebkitAudioDecodedByteCount ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Word
getWebkitAudioDecodedByteCount self
= liftDOM
(round <$>
(((toHTMLMediaElement self) ^. js "webkitAudioDecodedByteCount")
>>= valToNumber))
getWebkitVideoDecodedByteCount ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Word
getWebkitVideoDecodedByteCount self
= liftDOM
(round <$>
(((toHTMLMediaElement self) ^. js "webkitVideoDecodedByteCount")
>>= valToNumber))
getWebkitKeys ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m WebKitMediaKeys
getWebkitKeys self
= liftDOM
(((toHTMLMediaElement self) ^. js "webkitKeys") >>=
fromJSValUnchecked)
getMediaKeys ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m MediaKeys
getMediaKeys self
= liftDOM
(((toHTMLMediaElement self) ^. js "mediaKeys") >>=
fromJSValUnchecked)
encrypted ::
(IsHTMLMediaElement self, IsEventTarget self) =>
EventName self onencrypted
encrypted = unsafeEventName (toJSString "encrypted")
waitingforkey ::
(IsHTMLMediaElement self, IsEventTarget self) =>
EventName self onwaitingforkey
waitingforkey = unsafeEventName (toJSString "waitingforkey")
getAudioTracks ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m AudioTrackList
getAudioTracks self
= liftDOM
(((toHTMLMediaElement self) ^. js "audioTracks") >>=
fromJSValUnchecked)
getTextTracks ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m TextTrackList
getTextTracks self
= liftDOM
(((toHTMLMediaElement self) ^. js "textTracks") >>=
fromJSValUnchecked)
getVideoTracks ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m VideoTrackList
getVideoTracks self
= liftDOM
(((toHTMLMediaElement self) ^. js "videoTracks") >>=
fromJSValUnchecked)
setMediaGroup ::
(MonadDOM m, IsHTMLMediaElement self, ToJSString val) =>
self -> val -> m ()
setMediaGroup self val
= liftDOM
((toHTMLMediaElement self) ^. jss "mediaGroup" (toJSVal val))
getMediaGroup ::
(MonadDOM m, IsHTMLMediaElement self, FromJSString result) =>
self -> m result
getMediaGroup self
= liftDOM
(((toHTMLMediaElement self) ^. js "mediaGroup") >>=
fromJSValUnchecked)
setController ::
(MonadDOM m, IsHTMLMediaElement self) =>
self -> Maybe MediaController -> m ()
setController self val
= liftDOM
((toHTMLMediaElement self) ^. jss "controller" (toJSVal val))
getController ::
(MonadDOM m, IsHTMLMediaElement self) =>
self -> m (Maybe MediaController)
getController self
= liftDOM
(((toHTMLMediaElement self) ^. js "controller") >>= fromJSVal)
getControllerUnsafe ::
(MonadDOM m, IsHTMLMediaElement self, HasCallStack) =>
self -> m MediaController
getControllerUnsafe self
= liftDOM
((((toHTMLMediaElement self) ^. js "controller") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getControllerUnchecked ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m MediaController
getControllerUnchecked self
= liftDOM
(((toHTMLMediaElement self) ^. js "controller") >>=
fromJSValUnchecked)
getWebkitCurrentPlaybackTargetIsWireless ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m Bool
getWebkitCurrentPlaybackTargetIsWireless self
= liftDOM
(((toHTMLMediaElement self) ^.
js "webkitCurrentPlaybackTargetIsWireless")
>>= valToBool)
setKind ::
(MonadDOM m, IsHTMLMediaElement self, ToJSString val) =>
self -> val -> m ()
setKind self val
= liftDOM ((toHTMLMediaElement self) ^. jss "kind" (toJSVal val))
getKind ::
(MonadDOM m, IsHTMLMediaElement self, FromJSString result) =>
self -> m result
getKind self
= liftDOM
(((toHTMLMediaElement self) ^. js "kind") >>= fromJSValUnchecked)
setSession ::
(MonadDOM m, IsHTMLMediaElement self) =>
self -> Maybe MediaSession -> m ()
setSession self val
= liftDOM
((toHTMLMediaElement self) ^. jss "session" (toJSVal val))
getSession ::
(MonadDOM m, IsHTMLMediaElement self) =>
self -> m (Maybe MediaSession)
getSession self
= liftDOM
(((toHTMLMediaElement self) ^. js "session") >>= fromJSVal)
getSessionUnsafe ::
(MonadDOM m, IsHTMLMediaElement self, HasCallStack) =>
self -> m MediaSession
getSessionUnsafe self
= liftDOM
((((toHTMLMediaElement self) ^. js "session") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getSessionUnchecked ::
(MonadDOM m, IsHTMLMediaElement self) => self -> m MediaSession
getSessionUnchecked self
= liftDOM
(((toHTMLMediaElement self) ^. js "session") >>=
fromJSValUnchecked)