{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.SourceBuffer
(appendBuffer, abort, remove, setMode, getMode, getUpdating,
getBuffered, setTimestampOffset, getTimestampOffset,
getAudioTracks, getVideoTracks, getTextTracks,
setAppendWindowStart, getAppendWindowStart, setAppendWindowEnd,
getAppendWindowEnd, updatestart, update, updateend, error,
abortEvent, SourceBuffer(..), gTypeSourceBuffer)
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
appendBuffer ::
(MonadDOM m, IsBufferSource data') => SourceBuffer -> data' -> m ()
appendBuffer self data'
= liftDOM (void (self ^. jsf "appendBuffer" [toJSVal data']))
abort :: (MonadDOM m) => SourceBuffer -> m ()
abort self = liftDOM (void (self ^. jsf "abort" ()))
remove :: (MonadDOM m) => SourceBuffer -> Double -> Double -> m ()
remove self start end
= liftDOM
(void (self ^. jsf "remove" [toJSVal start, toJSVal end]))
setMode :: (MonadDOM m) => SourceBuffer -> AppendMode -> m ()
setMode self val = liftDOM (self ^. jss "mode" (toJSVal val))
getMode :: (MonadDOM m) => SourceBuffer -> m AppendMode
getMode self = liftDOM ((self ^. js "mode") >>= fromJSValUnchecked)
getUpdating :: (MonadDOM m) => SourceBuffer -> m Bool
getUpdating self = liftDOM ((self ^. js "updating") >>= valToBool)
getBuffered :: (MonadDOM m) => SourceBuffer -> m TimeRanges
getBuffered self
= liftDOM ((self ^. js "buffered") >>= fromJSValUnchecked)
setTimestampOffset ::
(MonadDOM m) => SourceBuffer -> Double -> m ()
setTimestampOffset self val
= liftDOM (self ^. jss "timestampOffset" (toJSVal val))
getTimestampOffset :: (MonadDOM m) => SourceBuffer -> m Double
getTimestampOffset self
= liftDOM ((self ^. js "timestampOffset") >>= valToNumber)
getAudioTracks :: (MonadDOM m) => SourceBuffer -> m AudioTrackList
getAudioTracks self
= liftDOM ((self ^. js "audioTracks") >>= fromJSValUnchecked)
getVideoTracks :: (MonadDOM m) => SourceBuffer -> m VideoTrackList
getVideoTracks self
= liftDOM ((self ^. js "videoTracks") >>= fromJSValUnchecked)
getTextTracks :: (MonadDOM m) => SourceBuffer -> m TextTrackList
getTextTracks self
= liftDOM ((self ^. js "textTracks") >>= fromJSValUnchecked)
setAppendWindowStart ::
(MonadDOM m) => SourceBuffer -> Double -> m ()
setAppendWindowStart self val
= liftDOM (self ^. jss "appendWindowStart" (toJSVal val))
getAppendWindowStart :: (MonadDOM m) => SourceBuffer -> m Double
getAppendWindowStart self
= liftDOM ((self ^. js "appendWindowStart") >>= valToNumber)
setAppendWindowEnd ::
(MonadDOM m) => SourceBuffer -> Double -> m ()
setAppendWindowEnd self val
= liftDOM (self ^. jss "appendWindowEnd" (toJSVal val))
getAppendWindowEnd :: (MonadDOM m) => SourceBuffer -> m Double
getAppendWindowEnd self
= liftDOM ((self ^. js "appendWindowEnd") >>= valToNumber)
updatestart :: EventName SourceBuffer onupdatestart
updatestart = unsafeEventName (toJSString "updatestart")
update :: EventName SourceBuffer onupdate
update = unsafeEventName (toJSString "update")
updateend :: EventName SourceBuffer onupdateend
updateend = unsafeEventName (toJSString "updateend")
error :: EventName SourceBuffer UIEvent
error = unsafeEventNameAsync (toJSString "error")
abortEvent :: EventName SourceBuffer UIEvent
abortEvent = unsafeEventNameAsync (toJSString "abort")