diff --git a/libraries/stdlib/js/idl/org.w3c.dom.encryptedmedia.idl b/libraries/stdlib/js/idl/org.w3c.dom.encryptedmedia.idl new file mode 100644 index 00000000000..d507bdc6e72 --- /dev/null +++ b/libraries/stdlib/js/idl/org.w3c.dom.encryptedmedia.idl @@ -0,0 +1,102 @@ +package org.w3c.dom.encryptedmedia; + + +// Downloaded from https://www.w3.org/TR/encrypted-media +partial interface Navigator { + [SecureContext] Promise requestMediaKeySystemAccess(DOMString keySystem, sequence supportedConfigurations); +}; +enum MediaKeysRequirement { + "required", + "optional", + "not-allowed" +}; +dictionary MediaKeySystemConfiguration { + DOMString label = ""; + sequence initDataTypes = []; + sequence audioCapabilities = []; + sequence videoCapabilities = []; + MediaKeysRequirement distinctiveIdentifier = "optional"; + MediaKeysRequirement persistentState = "optional"; + sequence sessionTypes; +}; +dictionary MediaKeySystemMediaCapability { + DOMString contentType = ""; + DOMString robustness = ""; +}; +[SecureContext] +interface MediaKeySystemAccess { + readonly attribute DOMString keySystem; + MediaKeySystemConfiguration getConfiguration(); + Promise createMediaKeys(); +}; +enum MediaKeySessionType { + "temporary", + "persistent-license" +}; +[SecureContext] +interface MediaKeys { + MediaKeySession createSession(optional MediaKeySessionType sessionType = "temporary"); + Promise setServerCertificate(BufferSource serverCertificate); +}; +[SecureContext] +interface MediaKeySession : EventTarget { + readonly attribute DOMString sessionId; + readonly attribute unrestricted double expiration; + readonly attribute Promise closed; + readonly attribute MediaKeyStatusMap keyStatuses; + attribute EventHandler onkeystatuseschange; + attribute EventHandler onmessage; + Promise generateRequest(DOMString initDataType, BufferSource initData); + Promise load(DOMString sessionId); + Promise update(BufferSource response); + Promise close(); + Promise remove(); +}; +[SecureContext] +interface MediaKeyStatusMap { + iterable; + readonly attribute unsigned long size; + boolean has(BufferSource keyId); + any get(BufferSource keyId); +}; +enum MediaKeyStatus { + "usable", + "expired", + "released", + "output-restricted", + "output-downscaled", + "status-pending", + "internal-error" +}; +enum MediaKeyMessageType { + "license-request", + "license-renewal", + "license-release", + "individualization-request" +}; +[SecureContext, + Constructor(DOMString type, MediaKeyMessageEventInit eventInitDict)] +interface MediaKeyMessageEvent : Event { + readonly attribute MediaKeyMessageType messageType; + readonly attribute ArrayBuffer message; +}; +dictionary MediaKeyMessageEventInit : EventInit { + required MediaKeyMessageType messageType; + required ArrayBuffer message; +}; +partial interface HTMLMediaElement { + [SecureContext] readonly attribute MediaKeys? mediaKeys; + attribute EventHandler onencrypted; + attribute EventHandler onwaitingforkey; + [SecureContext] Promise setMediaKeys(MediaKeys? mediaKeys); +}; +[Constructor(DOMString type, optional MediaEncryptedEventInit eventInitDict)] +interface MediaEncryptedEvent : Event { + readonly attribute DOMString initDataType; + readonly attribute ArrayBuffer? initData; +}; +dictionary MediaEncryptedEventInit : EventInit { + DOMString initDataType = ""; + ArrayBuffer? initData = null; +}; + diff --git a/libraries/stdlib/js/idl/org.w3c.dom.mediasource.idl b/libraries/stdlib/js/idl/org.w3c.dom.mediasource.idl new file mode 100644 index 00000000000..8b271bed1fb --- /dev/null +++ b/libraries/stdlib/js/idl/org.w3c.dom.mediasource.idl @@ -0,0 +1,72 @@ +package org.w3c.dom.mediasource; + + +// Downloaded from https://www.w3.org/TR/media-source/ +enum ReadyState { + "closed", + "open", + "ended" +}; +enum EndOfStreamError { + "network", + "decode" +}; +[Constructor] +interface MediaSource : EventTarget { + readonly attribute SourceBufferList sourceBuffers; + readonly attribute SourceBufferList activeSourceBuffers; + readonly attribute ReadyState readyState; + attribute unrestricted double duration; + attribute EventHandler onsourceopen; + attribute EventHandler onsourceended; + attribute EventHandler onsourceclose; + SourceBuffer addSourceBuffer(DOMString type); + void removeSourceBuffer(SourceBuffer sourceBuffer); + void endOfStream(optional EndOfStreamError error); + void setLiveSeekableRange(double start, double end); + void clearLiveSeekableRange(); + static boolean isTypeSupported(DOMString type); +}; +enum AppendMode { + "segments", + "sequence" +}; +interface SourceBuffer : EventTarget { + attribute AppendMode mode; + readonly attribute boolean updating; + readonly attribute TimeRanges buffered; + attribute double timestampOffset; + readonly attribute AudioTrackList audioTracks; + readonly attribute VideoTrackList videoTracks; + readonly attribute TextTrackList textTracks; + attribute double appendWindowStart; + attribute unrestricted double appendWindowEnd; + attribute EventHandler onupdatestart; + attribute EventHandler onupdate; + attribute EventHandler onupdateend; + attribute EventHandler onerror; + attribute EventHandler onabort; + void appendBuffer(BufferSource data); + void abort(); + void remove(double start, unrestricted double end); +}; +interface SourceBufferList : EventTarget { + readonly attribute unsigned long length; + attribute EventHandler onaddsourcebuffer; + attribute EventHandler onremovesourcebuffer; + getter SourceBuffer (unsigned long index); +}; +[Exposed=Window] +partial interface URL { + static DOMString createObjectURL(MediaSource mediaSource); +}; +partial interface AudioTrack { + readonly attribute SourceBuffer? sourceBuffer; +}; +partial interface VideoTrack { + readonly attribute SourceBuffer? sourceBuffer; +}; +partial interface TextTrack { + readonly attribute SourceBuffer? sourceBuffer; +}; + diff --git a/libraries/stdlib/js/src/org.w3c/org.khronos.webgl.kt b/libraries/stdlib/js/src/org.w3c/org.khronos.webgl.kt index ee2c7c0ad2e..3f496191b7f 100644 --- a/libraries/stdlib/js/src/org.w3c/org.khronos.webgl.kt +++ b/libraries/stdlib/js/src/org.w3c/org.khronos.webgl.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -13,8 +13,10 @@ import org.w3c.css.masking.* import org.w3c.dom.* import org.w3c.dom.clipboard.* import org.w3c.dom.css.* +import org.w3c.dom.encryptedmedia.* import org.w3c.dom.events.* import org.w3c.dom.mediacapture.* +import org.w3c.dom.mediasource.* import org.w3c.dom.parsing.* import org.w3c.dom.pointerevents.* import org.w3c.dom.svg.* diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.css.masking.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.css.masking.kt index 38d9964a4d5..50628209f67 100644 --- a/libraries/stdlib/js/src/org.w3c/org.w3c.css.masking.kt +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.css.masking.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -13,8 +13,10 @@ import org.khronos.webgl.* import org.w3c.dom.* import org.w3c.dom.clipboard.* import org.w3c.dom.css.* +import org.w3c.dom.encryptedmedia.* import org.w3c.dom.events.* import org.w3c.dom.mediacapture.* +import org.w3c.dom.mediasource.* import org.w3c.dom.parsing.* import org.w3c.dom.pointerevents.* import org.w3c.dom.svg.* diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.clipboard.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.clipboard.kt index aa12d65eef8..38f2da5d563 100644 --- a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.clipboard.kt +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.clipboard.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -13,8 +13,10 @@ import org.khronos.webgl.* import org.w3c.css.masking.* import org.w3c.dom.* import org.w3c.dom.css.* +import org.w3c.dom.encryptedmedia.* import org.w3c.dom.events.* import org.w3c.dom.mediacapture.* +import org.w3c.dom.mediasource.* import org.w3c.dom.parsing.* import org.w3c.dom.pointerevents.* import org.w3c.dom.svg.* diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.css.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.css.kt index b05aeaef2c9..d538ba2f16a 100644 --- a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.css.kt +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.css.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -13,8 +13,10 @@ import org.khronos.webgl.* import org.w3c.css.masking.* import org.w3c.dom.* import org.w3c.dom.clipboard.* +import org.w3c.dom.encryptedmedia.* import org.w3c.dom.events.* import org.w3c.dom.mediacapture.* +import org.w3c.dom.mediasource.* import org.w3c.dom.parsing.* import org.w3c.dom.pointerevents.* import org.w3c.dom.svg.* diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.encryptedmedia.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.encryptedmedia.kt new file mode 100644 index 00000000000..993211e89cb --- /dev/null +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.encryptedmedia.kt @@ -0,0 +1,234 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT! +// See github.com/kotlin/dukat for details + +package org.w3c.dom.encryptedmedia + +import kotlin.js.* +import org.khronos.webgl.* +import org.w3c.css.masking.* +import org.w3c.dom.* +import org.w3c.dom.clipboard.* +import org.w3c.dom.css.* +import org.w3c.dom.events.* +import org.w3c.dom.mediacapture.* +import org.w3c.dom.mediasource.* +import org.w3c.dom.parsing.* +import org.w3c.dom.pointerevents.* +import org.w3c.dom.svg.* +import org.w3c.dom.url.* +import org.w3c.fetch.* +import org.w3c.files.* +import org.w3c.notifications.* +import org.w3c.performance.* +import org.w3c.workers.* +import org.w3c.xhr.* + +public external interface MediaKeySystemConfiguration { + var label: String? /* = "" */ + get() = definedExternally + set(value) = definedExternally + var initDataTypes: Array? /* = arrayOf() */ + get() = definedExternally + set(value) = definedExternally + var audioCapabilities: Array? /* = arrayOf() */ + get() = definedExternally + set(value) = definedExternally + var videoCapabilities: Array? /* = arrayOf() */ + get() = definedExternally + set(value) = definedExternally + var distinctiveIdentifier: MediaKeysRequirement? /* = MediaKeysRequirement.OPTIONAL */ + get() = definedExternally + set(value) = definedExternally + var persistentState: MediaKeysRequirement? /* = MediaKeysRequirement.OPTIONAL */ + get() = definedExternally + set(value) = definedExternally + var sessionTypes: Array? + get() = definedExternally + set(value) = definedExternally +} + +@kotlin.internal.InlineOnly +public inline fun MediaKeySystemConfiguration(label: String? = "", initDataTypes: Array? = arrayOf(), audioCapabilities: Array? = arrayOf(), videoCapabilities: Array? = arrayOf(), distinctiveIdentifier: MediaKeysRequirement? = MediaKeysRequirement.OPTIONAL, persistentState: MediaKeysRequirement? = MediaKeysRequirement.OPTIONAL, sessionTypes: Array? = undefined): MediaKeySystemConfiguration { + val o = js("({})") + o["label"] = label + o["initDataTypes"] = initDataTypes + o["audioCapabilities"] = audioCapabilities + o["videoCapabilities"] = videoCapabilities + o["distinctiveIdentifier"] = distinctiveIdentifier + o["persistentState"] = persistentState + o["sessionTypes"] = sessionTypes + return o +} + +public external interface MediaKeySystemMediaCapability { + var contentType: String? /* = "" */ + get() = definedExternally + set(value) = definedExternally + var robustness: String? /* = "" */ + get() = definedExternally + set(value) = definedExternally +} + +@kotlin.internal.InlineOnly +public inline fun MediaKeySystemMediaCapability(contentType: String? = "", robustness: String? = ""): MediaKeySystemMediaCapability { + val o = js("({})") + o["contentType"] = contentType + o["robustness"] = robustness + return o +} + +public external abstract class MediaKeySystemAccess { + open val keySystem: String + fun getConfiguration(): MediaKeySystemConfiguration + fun createMediaKeys(): Promise +} + +public external abstract class MediaKeys { + fun createSession(sessionType: MediaKeySessionType = definedExternally): MediaKeySession + fun setServerCertificate(serverCertificate: dynamic): Promise +} + +public external abstract class MediaKeySession : EventTarget { + open val sessionId: String + open val expiration: Double + open val closed: Promise + open val keyStatuses: MediaKeyStatusMap + open var onkeystatuseschange: ((Event) -> dynamic)? + open var onmessage: ((MessageEvent) -> dynamic)? + fun generateRequest(initDataType: String, initData: dynamic): Promise + fun load(sessionId: String): Promise + fun update(response: dynamic): Promise + fun close(): Promise + fun remove(): Promise +} + +public external abstract class MediaKeyStatusMap { + open val size: Int + fun has(keyId: dynamic): Boolean + fun get(keyId: dynamic): Any? +} + +public external open class MediaKeyMessageEvent(type: String, eventInitDict: MediaKeyMessageEventInit) : Event { + open val messageType: MediaKeyMessageType + open val message: ArrayBuffer + + companion object { + val NONE: Short + val CAPTURING_PHASE: Short + val AT_TARGET: Short + val BUBBLING_PHASE: Short + } +} + +public external interface MediaKeyMessageEventInit : EventInit { + var messageType: MediaKeyMessageType? + get() = definedExternally + set(value) = definedExternally + var message: ArrayBuffer? + get() = definedExternally + set(value) = definedExternally +} + +@kotlin.internal.InlineOnly +public inline fun MediaKeyMessageEventInit(messageType: MediaKeyMessageType?, message: ArrayBuffer?, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): MediaKeyMessageEventInit { + val o = js("({})") + o["messageType"] = messageType + o["message"] = message + o["bubbles"] = bubbles + o["cancelable"] = cancelable + o["composed"] = composed + return o +} + +public external open class MediaEncryptedEvent(type: String, eventInitDict: MediaEncryptedEventInit = definedExternally) : Event { + open val initDataType: String + open val initData: ArrayBuffer? + + companion object { + val NONE: Short + val CAPTURING_PHASE: Short + val AT_TARGET: Short + val BUBBLING_PHASE: Short + } +} + +public external interface MediaEncryptedEventInit : EventInit { + var initDataType: String? /* = "" */ + get() = definedExternally + set(value) = definedExternally + var initData: ArrayBuffer? /* = null */ + get() = definedExternally + set(value) = definedExternally +} + +@kotlin.internal.InlineOnly +public inline fun MediaEncryptedEventInit(initDataType: String? = "", initData: ArrayBuffer? = null, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): MediaEncryptedEventInit { + val o = js("({})") + o["initDataType"] = initDataType + o["initData"] = initData + o["bubbles"] = bubbles + o["cancelable"] = cancelable + o["composed"] = composed + return o +} + +/* please, don't implement this interface! */ +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +public external interface MediaKeysRequirement { + companion object +} + +public inline val MediaKeysRequirement.Companion.REQUIRED: MediaKeysRequirement get() = "required".asDynamic().unsafeCast() + +public inline val MediaKeysRequirement.Companion.OPTIONAL: MediaKeysRequirement get() = "optional".asDynamic().unsafeCast() + +public inline val MediaKeysRequirement.Companion.NOT_ALLOWED: MediaKeysRequirement get() = "not-allowed".asDynamic().unsafeCast() + +/* please, don't implement this interface! */ +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +public external interface MediaKeySessionType { + companion object +} + +public inline val MediaKeySessionType.Companion.TEMPORARY: MediaKeySessionType get() = "temporary".asDynamic().unsafeCast() + +public inline val MediaKeySessionType.Companion.PERSISTENT_LICENSE: MediaKeySessionType get() = "persistent-license".asDynamic().unsafeCast() + +/* please, don't implement this interface! */ +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +public external interface MediaKeyStatus { + companion object +} + +public inline val MediaKeyStatus.Companion.USABLE: MediaKeyStatus get() = "usable".asDynamic().unsafeCast() + +public inline val MediaKeyStatus.Companion.EXPIRED: MediaKeyStatus get() = "expired".asDynamic().unsafeCast() + +public inline val MediaKeyStatus.Companion.RELEASED: MediaKeyStatus get() = "released".asDynamic().unsafeCast() + +public inline val MediaKeyStatus.Companion.OUTPUT_RESTRICTED: MediaKeyStatus get() = "output-restricted".asDynamic().unsafeCast() + +public inline val MediaKeyStatus.Companion.OUTPUT_DOWNSCALED: MediaKeyStatus get() = "output-downscaled".asDynamic().unsafeCast() + +public inline val MediaKeyStatus.Companion.STATUS_PENDING: MediaKeyStatus get() = "status-pending".asDynamic().unsafeCast() + +public inline val MediaKeyStatus.Companion.INTERNAL_ERROR: MediaKeyStatus get() = "internal-error".asDynamic().unsafeCast() + +/* please, don't implement this interface! */ +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +public external interface MediaKeyMessageType { + companion object +} + +public inline val MediaKeyMessageType.Companion.LICENSE_REQUEST: MediaKeyMessageType get() = "license-request".asDynamic().unsafeCast() + +public inline val MediaKeyMessageType.Companion.LICENSE_RENEWAL: MediaKeyMessageType get() = "license-renewal".asDynamic().unsafeCast() + +public inline val MediaKeyMessageType.Companion.LICENSE_RELEASE: MediaKeyMessageType get() = "license-release".asDynamic().unsafeCast() + +public inline val MediaKeyMessageType.Companion.INDIVIDUALIZATION_REQUEST: MediaKeyMessageType get() = "individualization-request".asDynamic().unsafeCast() \ No newline at end of file diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.events.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.events.kt index 81f129ce3bd..a86ea8aad02 100644 --- a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.events.kt +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.events.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -14,7 +14,9 @@ import org.w3c.css.masking.* import org.w3c.dom.* import org.w3c.dom.clipboard.* import org.w3c.dom.css.* +import org.w3c.dom.encryptedmedia.* import org.w3c.dom.mediacapture.* +import org.w3c.dom.mediasource.* import org.w3c.dom.parsing.* import org.w3c.dom.pointerevents.* import org.w3c.dom.svg.* diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.kt index 9aaf3eacf7c..91bac5b7e03 100644 --- a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.kt +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -13,8 +13,10 @@ import org.khronos.webgl.* import org.w3c.css.masking.* import org.w3c.dom.clipboard.* import org.w3c.dom.css.* +import org.w3c.dom.encryptedmedia.* import org.w3c.dom.events.* import org.w3c.dom.mediacapture.* +import org.w3c.dom.mediasource.* import org.w3c.dom.parsing.* import org.w3c.dom.pointerevents.* import org.w3c.dom.svg.* @@ -1277,7 +1279,7 @@ public external abstract class HTMLTrackElement : HTMLElement { public external abstract class HTMLMediaElement : HTMLElement { open val error: MediaError? open var src: String - open var srcObject: dynamic + open var srcObject: MediaProvider? open val currentSrc: String open var crossOrigin: String? open val networkState: Short @@ -1302,6 +1304,9 @@ public external abstract class HTMLMediaElement : HTMLElement { open val audioTracks: AudioTrackList open val videoTracks: VideoTrackList open val textTracks: TextTrackList + open val mediaKeys: MediaKeys? + open var onencrypted: ((Event) -> dynamic)? + open var onwaitingforkey: ((Event) -> dynamic)? fun load() fun canPlayType(type: String): CanPlayTypeResult fun fastSeek(time: Double) @@ -1309,6 +1314,7 @@ public external abstract class HTMLMediaElement : HTMLElement { fun play(): Promise fun pause() fun addTextTrack(kind: TextTrackKind, label: String = definedExternally, language: String = definedExternally): TextTrack + fun setMediaKeys(mediaKeys: MediaKeys?): Promise companion object { val NETWORK_EMPTY: Short @@ -1378,6 +1384,7 @@ public external abstract class AudioTrack : UnionAudioTrackOrTextTrackOrVideoTra open val label: String open val language: String open var enabled: Boolean + open val sourceBuffer: SourceBuffer? } /** @@ -1404,6 +1411,7 @@ public external abstract class VideoTrack : UnionAudioTrackOrTextTrackOrVideoTra open val label: String open val language: String open var selected: Boolean + open val sourceBuffer: SourceBuffer? } public external abstract class TextTrackList : EventTarget { @@ -1430,6 +1438,7 @@ public external abstract class TextTrack : EventTarget, UnionAudioTrackOrTextTra open val cues: TextTrackCueList? open val activeCues: TextTrackCueList? open var oncuechange: ((Event) -> dynamic)? + open val sourceBuffer: SourceBuffer? fun addCue(cue: TextTrackCue) fun removeCue(cue: TextTrackCue) } @@ -3754,6 +3763,7 @@ public external abstract class Navigator : NavigatorID, NavigatorLanguage, Navig open val mediaDevices: MediaDevices open val maxTouchPoints: Int open val serviceWorker: ServiceWorkerContainer + fun requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: Array): Promise fun getUserMedia(constraints: MediaStreamConstraints, successCallback: (MediaStream) -> Unit, errorCallback: (dynamic) -> Unit) fun vibrate(pattern: dynamic): Boolean } @@ -6348,6 +6358,8 @@ public external interface UnionElementOrRadioNodeList public external interface UnionHTMLOptGroupElementOrHTMLOptionElement +public external interface MediaProvider + public external interface UnionAudioTrackOrTextTrackOrVideoTrack public external interface UnionElementOrMouseEvent diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.mediacapture.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.mediacapture.kt index 038eb86e8bb..84ebee5a423 100644 --- a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.mediacapture.kt +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.mediacapture.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -14,7 +14,9 @@ import org.w3c.css.masking.* import org.w3c.dom.* import org.w3c.dom.clipboard.* import org.w3c.dom.css.* +import org.w3c.dom.encryptedmedia.* import org.w3c.dom.events.* +import org.w3c.dom.mediasource.* import org.w3c.dom.parsing.* import org.w3c.dom.pointerevents.* import org.w3c.dom.svg.* @@ -29,7 +31,7 @@ import org.w3c.xhr.* /** * Exposes the JavaScript [MediaStream](https://developer.mozilla.org/en/docs/Web/API/MediaStream) to Kotlin */ -public external open class MediaStream() : EventTarget { +public external open class MediaStream() : EventTarget, MediaProvider { constructor(stream: MediaStream) constructor(tracks: Array) open val id: String diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.mediasource.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.mediasource.kt new file mode 100644 index 00000000000..7ba5aca271c --- /dev/null +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.mediasource.kt @@ -0,0 +1,109 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT! +// See github.com/kotlin/dukat for details + +package org.w3c.dom.mediasource + +import kotlin.js.* +import org.khronos.webgl.* +import org.w3c.css.masking.* +import org.w3c.dom.* +import org.w3c.dom.clipboard.* +import org.w3c.dom.css.* +import org.w3c.dom.encryptedmedia.* +import org.w3c.dom.events.* +import org.w3c.dom.mediacapture.* +import org.w3c.dom.parsing.* +import org.w3c.dom.pointerevents.* +import org.w3c.dom.svg.* +import org.w3c.dom.url.* +import org.w3c.fetch.* +import org.w3c.files.* +import org.w3c.notifications.* +import org.w3c.performance.* +import org.w3c.workers.* +import org.w3c.xhr.* + +public external open class MediaSource : EventTarget, MediaProvider { + open val sourceBuffers: SourceBufferList + open val activeSourceBuffers: SourceBufferList + open val readyState: ReadyState + var duration: Double + var onsourceopen: ((Event) -> dynamic)? + var onsourceended: ((Event) -> dynamic)? + var onsourceclose: ((Event) -> dynamic)? + fun addSourceBuffer(type: String): SourceBuffer + fun removeSourceBuffer(sourceBuffer: SourceBuffer) + fun endOfStream(error: EndOfStreamError = definedExternally) + fun setLiveSeekableRange(start: Double, end: Double) + fun clearLiveSeekableRange() + + companion object { + fun isTypeSupported(type: String): Boolean + } +} + +public external abstract class SourceBuffer : EventTarget { + open var mode: AppendMode + open val updating: Boolean + open val buffered: TimeRanges + open var timestampOffset: Double + open val audioTracks: AudioTrackList + open val videoTracks: VideoTrackList + open val textTracks: TextTrackList + open var appendWindowStart: Double + open var appendWindowEnd: Double + open var onupdatestart: ((Event) -> dynamic)? + open var onupdate: ((Event) -> dynamic)? + open var onupdateend: ((Event) -> dynamic)? + open var onerror: ((Event) -> dynamic)? + open var onabort: ((Event) -> dynamic)? + fun appendBuffer(data: dynamic) + fun abort() + fun remove(start: Double, end: Double) +} + +public external abstract class SourceBufferList : EventTarget { + open val length: Int + open var onaddsourcebuffer: ((Event) -> dynamic)? + open var onremovesourcebuffer: ((Event) -> dynamic)? +} + +@kotlin.internal.InlineOnly +public inline operator fun SourceBufferList.get(index: Int): SourceBuffer? = asDynamic()[index] + +/* please, don't implement this interface! */ +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +public external interface ReadyState { + companion object +} + +public inline val ReadyState.Companion.CLOSED: ReadyState get() = "closed".asDynamic().unsafeCast() + +public inline val ReadyState.Companion.OPEN: ReadyState get() = "open".asDynamic().unsafeCast() + +public inline val ReadyState.Companion.ENDED: ReadyState get() = "ended".asDynamic().unsafeCast() + +/* please, don't implement this interface! */ +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +public external interface EndOfStreamError { + companion object +} + +public inline val EndOfStreamError.Companion.NETWORK: EndOfStreamError get() = "network".asDynamic().unsafeCast() + +public inline val EndOfStreamError.Companion.DECODE: EndOfStreamError get() = "decode".asDynamic().unsafeCast() + +/* please, don't implement this interface! */ +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +public external interface AppendMode { + companion object +} + +public inline val AppendMode.Companion.SEGMENTS: AppendMode get() = "segments".asDynamic().unsafeCast() + +public inline val AppendMode.Companion.SEQUENCE: AppendMode get() = "sequence".asDynamic().unsafeCast() \ No newline at end of file diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.parsing.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.parsing.kt index 8b131132dc3..7a73bed87d9 100644 --- a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.parsing.kt +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.parsing.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -14,8 +14,10 @@ import org.w3c.css.masking.* import org.w3c.dom.* import org.w3c.dom.clipboard.* import org.w3c.dom.css.* +import org.w3c.dom.encryptedmedia.* import org.w3c.dom.events.* import org.w3c.dom.mediacapture.* +import org.w3c.dom.mediasource.* import org.w3c.dom.pointerevents.* import org.w3c.dom.svg.* import org.w3c.dom.url.* diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.pointerevents.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.pointerevents.kt index fc0c65683d5..53e311f59a3 100644 --- a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.pointerevents.kt +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.pointerevents.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -14,8 +14,10 @@ import org.w3c.css.masking.* import org.w3c.dom.* import org.w3c.dom.clipboard.* import org.w3c.dom.css.* +import org.w3c.dom.encryptedmedia.* import org.w3c.dom.events.* import org.w3c.dom.mediacapture.* +import org.w3c.dom.mediasource.* import org.w3c.dom.parsing.* import org.w3c.dom.svg.* import org.w3c.dom.url.* diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.svg.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.svg.kt index e24726257ae..fbcbd3cc787 100644 --- a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.svg.kt +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.svg.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -14,8 +14,10 @@ import org.w3c.css.masking.* import org.w3c.dom.* import org.w3c.dom.clipboard.* import org.w3c.dom.css.* +import org.w3c.dom.encryptedmedia.* import org.w3c.dom.events.* import org.w3c.dom.mediacapture.* +import org.w3c.dom.mediasource.* import org.w3c.dom.parsing.* import org.w3c.dom.pointerevents.* import org.w3c.dom.url.* diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.url.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.url.kt index 4d843f6ec1a..78c08cb1ac8 100644 --- a/libraries/stdlib/js/src/org.w3c/org.w3c.dom.url.kt +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.dom.url.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -14,8 +14,10 @@ import org.w3c.css.masking.* import org.w3c.dom.* import org.w3c.dom.clipboard.* import org.w3c.dom.css.* +import org.w3c.dom.encryptedmedia.* import org.w3c.dom.events.* import org.w3c.dom.mediacapture.* +import org.w3c.dom.mediasource.* import org.w3c.dom.parsing.* import org.w3c.dom.pointerevents.* import org.w3c.dom.svg.* @@ -46,6 +48,7 @@ public external open class URL(url: String, base: String = definedExternally) { companion object { fun domainToASCII(domain: String): String fun domainToUnicode(domain: String): String + fun createObjectURL(mediaSource: MediaSource): String fun createObjectURL(blob: Blob): String fun createFor(blob: Blob): String fun revokeObjectURL(url: String) diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.fetch.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.fetch.kt index d52f07b313f..0b40aefca3f 100644 --- a/libraries/stdlib/js/src/org.w3c/org.w3c.fetch.kt +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.fetch.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -14,8 +14,10 @@ import org.w3c.css.masking.* import org.w3c.dom.* import org.w3c.dom.clipboard.* import org.w3c.dom.css.* +import org.w3c.dom.encryptedmedia.* import org.w3c.dom.events.* import org.w3c.dom.mediacapture.* +import org.w3c.dom.mediasource.* import org.w3c.dom.parsing.* import org.w3c.dom.pointerevents.* import org.w3c.dom.svg.* diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.files.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.files.kt index b5f15a66231..b16f21e9dff 100644 --- a/libraries/stdlib/js/src/org.w3c/org.w3c.files.kt +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.files.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -14,8 +14,10 @@ import org.w3c.css.masking.* import org.w3c.dom.* import org.w3c.dom.clipboard.* import org.w3c.dom.css.* +import org.w3c.dom.encryptedmedia.* import org.w3c.dom.events.* import org.w3c.dom.mediacapture.* +import org.w3c.dom.mediasource.* import org.w3c.dom.parsing.* import org.w3c.dom.pointerevents.* import org.w3c.dom.svg.* @@ -29,7 +31,7 @@ import org.w3c.xhr.* /** * Exposes the JavaScript [Blob](https://developer.mozilla.org/en/docs/Web/API/Blob) to Kotlin */ -public external open class Blob(blobParts: Array = definedExternally, options: BlobPropertyBag = definedExternally) : ImageBitmapSource { +public external open class Blob(blobParts: Array = definedExternally, options: BlobPropertyBag = definedExternally) : MediaProvider, ImageBitmapSource { open val size: Number open val type: String open val isClosed: Boolean diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.notifications.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.notifications.kt index 3f1d4a3eed5..ccb49723692 100644 --- a/libraries/stdlib/js/src/org.w3c/org.w3c.notifications.kt +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.notifications.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -14,8 +14,10 @@ import org.w3c.css.masking.* import org.w3c.dom.* import org.w3c.dom.clipboard.* import org.w3c.dom.css.* +import org.w3c.dom.encryptedmedia.* import org.w3c.dom.events.* import org.w3c.dom.mediacapture.* +import org.w3c.dom.mediasource.* import org.w3c.dom.parsing.* import org.w3c.dom.pointerevents.* import org.w3c.dom.svg.* diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.performance.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.performance.kt index 7198b8d7399..4351049b6d7 100644 --- a/libraries/stdlib/js/src/org.w3c/org.w3c.performance.kt +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.performance.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -14,8 +14,10 @@ import org.w3c.css.masking.* import org.w3c.dom.* import org.w3c.dom.clipboard.* import org.w3c.dom.css.* +import org.w3c.dom.encryptedmedia.* import org.w3c.dom.events.* import org.w3c.dom.mediacapture.* +import org.w3c.dom.mediasource.* import org.w3c.dom.parsing.* import org.w3c.dom.pointerevents.* import org.w3c.dom.svg.* diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.workers.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.workers.kt index 0744ca92fe6..1dd2362197a 100644 --- a/libraries/stdlib/js/src/org.w3c/org.w3c.workers.kt +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.workers.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -14,8 +14,10 @@ import org.w3c.css.masking.* import org.w3c.dom.* import org.w3c.dom.clipboard.* import org.w3c.dom.css.* +import org.w3c.dom.encryptedmedia.* import org.w3c.dom.events.* import org.w3c.dom.mediacapture.* +import org.w3c.dom.mediasource.* import org.w3c.dom.parsing.* import org.w3c.dom.pointerevents.* import org.w3c.dom.svg.* diff --git a/libraries/stdlib/js/src/org.w3c/org.w3c.xhr.kt b/libraries/stdlib/js/src/org.w3c/org.w3c.xhr.kt index 1b2fcb94351..d1959610866 100644 --- a/libraries/stdlib/js/src/org.w3c/org.w3c.xhr.kt +++ b/libraries/stdlib/js/src/org.w3c/org.w3c.xhr.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -14,8 +14,10 @@ import org.w3c.css.masking.* import org.w3c.dom.* import org.w3c.dom.clipboard.* import org.w3c.dom.css.* +import org.w3c.dom.encryptedmedia.* import org.w3c.dom.events.* import org.w3c.dom.mediacapture.* +import org.w3c.dom.mediasource.* import org.w3c.dom.parsing.* import org.w3c.dom.pointerevents.* import org.w3c.dom.svg.* diff --git a/libraries/tools/dukat/src/main/kotlin/org/jetbrains/kotlin/tools/dukat/download.kt b/libraries/tools/dukat/src/main/kotlin/org/jetbrains/kotlin/tools/dukat/download.kt index 243ba4c33b1..7542ab1a286 100644 --- a/libraries/tools/dukat/src/main/kotlin/org/jetbrains/kotlin/tools/dukat/download.kt +++ b/libraries/tools/dukat/src/main/kotlin/org/jetbrains/kotlin/tools/dukat/download.kt @@ -128,5 +128,8 @@ private val urls = listOf( "https://www.w3.org/TR/hr-time/" to "org.w3c.performance", "https://www.w3.org/TR/2012/REC-navigation-timing-20121217/" to "org.w3c.performance", - "https://w3c.github.io/ServiceWorker/" to "org.w3c.workers" + "https://w3c.github.io/ServiceWorker/" to "org.w3c.workers", + + "https://www.w3.org/TR/media-source/" to "org.w3c.dom.mediasource", + "https://www.w3.org/TR/encrypted-media" to "org.w3c.dom.encryptedmedia" )