-
Notifications
You must be signed in to change notification settings - Fork 0
/
MediaSession.cljs
71 lines (50 loc) · 2.13 KB
/
MediaSession.cljs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
(ns web.audio.MediaSession
"The MediaSession interface of the Media Session API allows a
page to provide custom behaviors for standard media playback"
(:refer-clojure :exclude []))
(defn set-action-handler
"Method.
The setActionHandler() property of the `web.audio.MediaSession`
sets an event handler for a media session action.
`navigator.mediaSession.setActionHandler(type, callback)`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/setActionHandler`"
[this type callback]
(-> this (.setActionHandler type callback)))
(defn metadata
"Property.
The metadata property of the `web.audio.MediaSession` interface,
an instance of `web.audio.MediaMetadata` which contains rich
metadata, for display in a platform UI.
`var mediaMetadata = MediaSession.metadata
MediaSession.metadata = mediaMetadata`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/metadata`"
[this]
(-> this (.metadata)))
(defn set-metadata!
"Property.
The metadata property of the `web.audio.MediaSession` interface,
an instance of `web.audio.MediaMetadata` which contains rich
metadata, for display in a platform UI.
`var mediaMetadata = MediaSession.metadata
MediaSession.metadata = mediaMetadata`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/metadata`"
[this val]
(aset this "metadata" val))
(defn playback-state
"Property.
The playbackState property of the `web.audio.MediaSession` interface
whether the current media session is playing.
`var playbackState = MediaSession.playbackState
MediaSession.playbackState = playbackState`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/playbackState`"
[this]
(-> this (.playbackState)))
(defn set-playback-state!
"Property.
The playbackState property of the `web.audio.MediaSession` interface
whether the current media session is playing.
`var playbackState = MediaSession.playbackState
MediaSession.playbackState = playbackState`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/playbackState`"
[this val]
(aset this "playbackState" val))