Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
3577 lines (3359 sloc) 124 KB
// Code generated by webidl-bind. DO NOT EDIT.
// +build !js
package local
import js "github.com/gowebapi/webapi/core/js"
import (
"github.com/gowebapi/webapi/dom/domcore"
"github.com/gowebapi/webapi/javascript"
"github.com/gowebapi/webapi/media/capture/depth"
"github.com/gowebapi/webapi/media/capture/screen"
"github.com/gowebapi/webapi/media/mediatype"
"github.com/gowebapi/webapi/patch"
)
// using following types:
// depth.DistortionCoefficients
// depth.Transformation
// domcore.Event
// domcore.EventHandler
// domcore.EventTarget
// javascript.Object
// javascript.PromiseFinally
// javascript.PromiseVoid
// mediatype.MediaSettingsRange
// mediatype.Point2D
// patch.OverconstrainedError
// screen.DisplayMediaStreamConstraints
// source idl files:
// mediacapture-streams.idl
// promises.idl
// transform files:
// mediacapture-streams.go.md
// promises.go.md
// workaround for compiler error
func unused(value interface{}) {
// TODO remove this method
}
type Union struct {
Value js.Value
}
func (u *Union) JSValue() js.Value {
return u.Value
}
func UnionFromJS(value js.Value) *Union {
return &Union{Value: value}
}
// enum: MediaDeviceKind
type MediaDeviceKind int
const (
AudioinputMediaDeviceKind MediaDeviceKind = iota
AudiooutputMediaDeviceKind
VideoinputMediaDeviceKind
)
var mediaDeviceKindToWasmTable = []string{
"audioinput", "audiooutput", "videoinput",
}
var mediaDeviceKindFromWasmTable = map[string]MediaDeviceKind{
"audioinput": AudioinputMediaDeviceKind, "audiooutput": AudiooutputMediaDeviceKind, "videoinput": VideoinputMediaDeviceKind,
}
// JSValue is converting this enum into a javascript object
func (this *MediaDeviceKind) JSValue() js.Value {
return js.ValueOf(this.Value())
}
// Value is converting this into javascript defined
// string value
func (this MediaDeviceKind) Value() string {
idx := int(this)
if idx >= 0 && idx < len(mediaDeviceKindToWasmTable) {
return mediaDeviceKindToWasmTable[idx]
}
panic("unknown input value")
}
// MediaDeviceKindFromJS is converting a javascript value into
// a MediaDeviceKind enum value.
func MediaDeviceKindFromJS(value js.Value) MediaDeviceKind {
key := value.String()
conv, ok := mediaDeviceKindFromWasmTable[key]
if !ok {
panic("unable to convert '" + key + "'")
}
return conv
}
// enum: MediaStreamTrackState
type MediaStreamTrackState int
const (
LiveMediaStreamTrackState MediaStreamTrackState = iota
EndedMediaStreamTrackState
)
var mediaStreamTrackStateToWasmTable = []string{
"live", "ended",
}
var mediaStreamTrackStateFromWasmTable = map[string]MediaStreamTrackState{
"live": LiveMediaStreamTrackState, "ended": EndedMediaStreamTrackState,
}
// JSValue is converting this enum into a javascript object
func (this *MediaStreamTrackState) JSValue() js.Value {
return js.ValueOf(this.Value())
}
// Value is converting this into javascript defined
// string value
func (this MediaStreamTrackState) Value() string {
idx := int(this)
if idx >= 0 && idx < len(mediaStreamTrackStateToWasmTable) {
return mediaStreamTrackStateToWasmTable[idx]
}
panic("unknown input value")
}
// MediaStreamTrackStateFromJS is converting a javascript value into
// a MediaStreamTrackState enum value.
func MediaStreamTrackStateFromJS(value js.Value) MediaStreamTrackState {
key := value.String()
conv, ok := mediaStreamTrackStateFromWasmTable[key]
if !ok {
panic("unable to convert '" + key + "'")
}
return conv
}
// callback: NavigatorUserMediaErrorCallback
type NavigatorUserMediaErrorCallbackFunc func(_error *javascript.Object)
// NavigatorUserMediaErrorCallback is a javascript function type.
//
// Call Release() when done to release resouces
// allocated to this type.
type NavigatorUserMediaErrorCallback js.Func
func NavigatorUserMediaErrorCallbackToJS(callback NavigatorUserMediaErrorCallbackFunc) *NavigatorUserMediaErrorCallback {
if callback == nil {
return nil
}
ret := NavigatorUserMediaErrorCallback(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
var (
_p0 *javascript.Object // javascript: object _error
)
_p0 = javascript.ObjectFromJS(args[0])
callback(_p0)
// returning no return value
return nil
}))
return &ret
}
func NavigatorUserMediaErrorCallbackFromJS(_value js.Value) NavigatorUserMediaErrorCallbackFunc {
return func(_error *javascript.Object) {
var (
_args [1]interface{}
_end int
)
_p0 := _error.JSValue()
_args[0] = _p0
_end++
_value.Invoke(_args[0:_end]...)
return
}
}
// callback: NavigatorUserMediaSuccessCallback
type NavigatorUserMediaSuccessCallbackFunc func(stream *MediaStream)
// NavigatorUserMediaSuccessCallback is a javascript function type.
//
// Call Release() when done to release resouces
// allocated to this type.
type NavigatorUserMediaSuccessCallback js.Func
func NavigatorUserMediaSuccessCallbackToJS(callback NavigatorUserMediaSuccessCallbackFunc) *NavigatorUserMediaSuccessCallback {
if callback == nil {
return nil
}
ret := NavigatorUserMediaSuccessCallback(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
var (
_p0 *MediaStream // javascript: MediaStream stream
)
_p0 = MediaStreamFromJS(args[0])
callback(_p0)
// returning no return value
return nil
}))
return &ret
}
func NavigatorUserMediaSuccessCallbackFromJS(_value js.Value) NavigatorUserMediaSuccessCallbackFunc {
return func(stream *MediaStream) {
var (
_args [1]interface{}
_end int
)
_p0 := stream.JSValue()
_args[0] = _p0
_end++
_value.Invoke(_args[0:_end]...)
return
}
}
// callback: PromiseTemplateOnFulfilled
type PromiseMediaStreamOnFulfilledFunc func(value *MediaStream)
// PromiseMediaStreamOnFulfilled is a javascript function type.
//
// Call Release() when done to release resouces
// allocated to this type.
type PromiseMediaStreamOnFulfilled js.Func
func PromiseMediaStreamOnFulfilledToJS(callback PromiseMediaStreamOnFulfilledFunc) *PromiseMediaStreamOnFulfilled {
if callback == nil {
return nil
}
ret := PromiseMediaStreamOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
var (
_p0 *MediaStream // javascript: MediaStream value
)
_p0 = MediaStreamFromJS(args[0])
callback(_p0)
// returning no return value
return nil
}))
return &ret
}
func PromiseMediaStreamOnFulfilledFromJS(_value js.Value) PromiseMediaStreamOnFulfilledFunc {
return func(value *MediaStream) {
var (
_args [1]interface{}
_end int
)
_p0 := value.JSValue()
_args[0] = _p0
_end++
_value.Invoke(_args[0:_end]...)
return
}
}
// callback: PromiseTemplateOnRejected
type PromiseMediaStreamOnRejectedFunc func(reason js.Value)
// PromiseMediaStreamOnRejected is a javascript function type.
//
// Call Release() when done to release resouces
// allocated to this type.
type PromiseMediaStreamOnRejected js.Func
func PromiseMediaStreamOnRejectedToJS(callback PromiseMediaStreamOnRejectedFunc) *PromiseMediaStreamOnRejected {
if callback == nil {
return nil
}
ret := PromiseMediaStreamOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
var (
_p0 js.Value // javascript: any reason
)
_p0 = args[0]
callback(_p0)
// returning no return value
return nil
}))
return &ret
}
func PromiseMediaStreamOnRejectedFromJS(_value js.Value) PromiseMediaStreamOnRejectedFunc {
return func(reason js.Value) {
var (
_args [1]interface{}
_end int
)
_p0 := reason
_args[0] = _p0
_end++
_value.Invoke(_args[0:_end]...)
return
}
}
// callback: PromiseTemplateOnFulfilled
type PromiseSequenceMediaDeviceInfoOnFulfilledFunc func(value []*MediaDeviceInfo)
// PromiseSequenceMediaDeviceInfoOnFulfilled is a javascript function type.
//
// Call Release() when done to release resouces
// allocated to this type.
type PromiseSequenceMediaDeviceInfoOnFulfilled js.Func
func PromiseSequenceMediaDeviceInfoOnFulfilledToJS(callback PromiseSequenceMediaDeviceInfoOnFulfilledFunc) *PromiseSequenceMediaDeviceInfoOnFulfilled {
if callback == nil {
return nil
}
ret := PromiseSequenceMediaDeviceInfoOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
var (
_p0 []*MediaDeviceInfo // javascript: sequence<MediaDeviceInfo> value
)
__length0 := args[0].Length()
__array0 := make([]*MediaDeviceInfo, __length0, __length0)
for __idx0 := 0; __idx0 < __length0; __idx0++ {
var __seq_out0 *MediaDeviceInfo
__seq_in0 := args[0].Index(__idx0)
__seq_out0 = MediaDeviceInfoFromJS(__seq_in0)
__array0[__idx0] = __seq_out0
}
_p0 = __array0
callback(_p0)
// returning no return value
return nil
}))
return &ret
}
func PromiseSequenceMediaDeviceInfoOnFulfilledFromJS(_value js.Value) PromiseSequenceMediaDeviceInfoOnFulfilledFunc {
return func(value []*MediaDeviceInfo) {
var (
_args [1]interface{}
_end int
)
_p0 := js.Global().Get("Array").New(len(value))
for __idx0, __seq_in0 := range value {
__seq_out0 := __seq_in0.JSValue()
_p0.SetIndex(__idx0, __seq_out0)
}
_args[0] = _p0
_end++
_value.Invoke(_args[0:_end]...)
return
}
}
// callback: PromiseTemplateOnRejected
type PromiseSequenceMediaDeviceInfoOnRejectedFunc func(reason js.Value)
// PromiseSequenceMediaDeviceInfoOnRejected is a javascript function type.
//
// Call Release() when done to release resouces
// allocated to this type.
type PromiseSequenceMediaDeviceInfoOnRejected js.Func
func PromiseSequenceMediaDeviceInfoOnRejectedToJS(callback PromiseSequenceMediaDeviceInfoOnRejectedFunc) *PromiseSequenceMediaDeviceInfoOnRejected {
if callback == nil {
return nil
}
ret := PromiseSequenceMediaDeviceInfoOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
var (
_p0 js.Value // javascript: any reason
)
_p0 = args[0]
callback(_p0)
// returning no return value
return nil
}))
return &ret
}
func PromiseSequenceMediaDeviceInfoOnRejectedFromJS(_value js.Value) PromiseSequenceMediaDeviceInfoOnRejectedFunc {
return func(reason js.Value) {
var (
_args [1]interface{}
_end int
)
_p0 := reason
_args[0] = _p0
_end++
_value.Invoke(_args[0:_end]...)
return
}
}
// dictionary: Capabilities
type Capabilities struct {
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *Capabilities) JSValue() js.Value {
out := js.Global().Get("Object").New()
return out
}
// CapabilitiesFromJS is allocating a new
// Capabilities object and copy all values from
// input javascript object
func CapabilitiesFromJS(value js.Wrapper) *Capabilities {
var out Capabilities
var ()
return &out
}
// dictionary: ConstrainBooleanParameters
type ConstrainBooleanParameters struct {
Exact bool
Ideal bool
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *ConstrainBooleanParameters) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Exact
out.Set("exact", value0)
value1 := _this.Ideal
out.Set("ideal", value1)
return out
}
// ConstrainBooleanParametersFromJS is allocating a new
// ConstrainBooleanParameters object and copy all values from
// input javascript object
func ConstrainBooleanParametersFromJS(value js.Wrapper) *ConstrainBooleanParameters {
input := value.JSValue()
var out ConstrainBooleanParameters
var (
value0 bool // javascript: boolean {exact Exact exact}
value1 bool // javascript: boolean {ideal Ideal ideal}
)
value0 = (input.Get("exact")).Bool()
out.Exact = value0
value1 = (input.Get("ideal")).Bool()
out.Ideal = value1
return &out
}
// dictionary: ConstrainDOMStringParameters
type ConstrainDOMStringParameters struct {
Exact *Union
Ideal *Union
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *ConstrainDOMStringParameters) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Exact.JSValue()
out.Set("exact", value0)
value1 := _this.Ideal.JSValue()
out.Set("ideal", value1)
return out
}
// ConstrainDOMStringParametersFromJS is allocating a new
// ConstrainDOMStringParameters object and copy all values from
// input javascript object
func ConstrainDOMStringParametersFromJS(value js.Wrapper) *ConstrainDOMStringParameters {
input := value.JSValue()
var out ConstrainDOMStringParameters
var (
value0 *Union // javascript: Union {exact Exact exact}
value1 *Union // javascript: Union {ideal Ideal ideal}
)
value0 = UnionFromJS(input.Get("exact"))
out.Exact = value0
value1 = UnionFromJS(input.Get("ideal"))
out.Ideal = value1
return &out
}
// dictionary: ConstrainDoubleRange
type ConstrainDoubleRange struct {
Max float64
Min float64
Exact float64
Ideal float64
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *ConstrainDoubleRange) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Max
out.Set("max", value0)
value1 := _this.Min
out.Set("min", value1)
value2 := _this.Exact
out.Set("exact", value2)
value3 := _this.Ideal
out.Set("ideal", value3)
return out
}
// ConstrainDoubleRangeFromJS is allocating a new
// ConstrainDoubleRange object and copy all values from
// input javascript object
func ConstrainDoubleRangeFromJS(value js.Wrapper) *ConstrainDoubleRange {
input := value.JSValue()
var out ConstrainDoubleRange
var (
value0 float64 // javascript: double {max Max max}
value1 float64 // javascript: double {min Min min}
value2 float64 // javascript: double {exact Exact exact}
value3 float64 // javascript: double {ideal Ideal ideal}
)
value0 = (input.Get("max")).Float()
out.Max = value0
value1 = (input.Get("min")).Float()
out.Min = value1
value2 = (input.Get("exact")).Float()
out.Exact = value2
value3 = (input.Get("ideal")).Float()
out.Ideal = value3
return &out
}
// dictionary: ConstrainULongRange
type ConstrainULongRange struct {
Max uint
Min uint
Exact uint
Ideal uint
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *ConstrainULongRange) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Max
out.Set("max", value0)
value1 := _this.Min
out.Set("min", value1)
value2 := _this.Exact
out.Set("exact", value2)
value3 := _this.Ideal
out.Set("ideal", value3)
return out
}
// ConstrainULongRangeFromJS is allocating a new
// ConstrainULongRange object and copy all values from
// input javascript object
func ConstrainULongRangeFromJS(value js.Wrapper) *ConstrainULongRange {
input := value.JSValue()
var out ConstrainULongRange
var (
value0 uint // javascript: unsigned long {max Max max}
value1 uint // javascript: unsigned long {min Min min}
value2 uint // javascript: unsigned long {exact Exact exact}
value3 uint // javascript: unsigned long {ideal Ideal ideal}
)
value0 = (uint)((input.Get("max")).Int())
out.Max = value0
value1 = (uint)((input.Get("min")).Int())
out.Min = value1
value2 = (uint)((input.Get("exact")).Int())
out.Exact = value2
value3 = (uint)((input.Get("ideal")).Int())
out.Ideal = value3
return &out
}
// dictionary: ConstraintSet
type ConstraintSet struct {
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *ConstraintSet) JSValue() js.Value {
out := js.Global().Get("Object").New()
return out
}
// ConstraintSetFromJS is allocating a new
// ConstraintSet object and copy all values from
// input javascript object
func ConstraintSetFromJS(value js.Wrapper) *ConstraintSet {
var out ConstraintSet
var ()
return &out
}
// dictionary: Constraints
type Constraints struct {
Advanced []*ConstraintSet
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *Constraints) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := js.Global().Get("Array").New(len(_this.Advanced))
for __idx0, __seq_in0 := range _this.Advanced {
__seq_out0 := __seq_in0.JSValue()
value0.SetIndex(__idx0, __seq_out0)
}
out.Set("advanced", value0)
return out
}
// ConstraintsFromJS is allocating a new
// Constraints object and copy all values from
// input javascript object
func ConstraintsFromJS(value js.Wrapper) *Constraints {
input := value.JSValue()
var out Constraints
var (
value0 []*ConstraintSet // javascript: sequence<ConstraintSet> {advanced Advanced advanced}
)
__length0 := input.Get("advanced").Length()
__array0 := make([]*ConstraintSet, __length0, __length0)
for __idx0 := 0; __idx0 < __length0; __idx0++ {
var __seq_out0 *ConstraintSet
__seq_in0 := input.Get("advanced").Index(__idx0)
__seq_out0 = ConstraintSetFromJS(__seq_in0)
__array0[__idx0] = __seq_out0
}
value0 = __array0
out.Advanced = value0
return &out
}
// dictionary: DoubleRange
type DoubleRange struct {
Max float64
Min float64
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *DoubleRange) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Max
out.Set("max", value0)
value1 := _this.Min
out.Set("min", value1)
return out
}
// DoubleRangeFromJS is allocating a new
// DoubleRange object and copy all values from
// input javascript object
func DoubleRangeFromJS(value js.Wrapper) *DoubleRange {
input := value.JSValue()
var out DoubleRange
var (
value0 float64 // javascript: double {max Max max}
value1 float64 // javascript: double {min Min min}
)
value0 = (input.Get("max")).Float()
out.Max = value0
value1 = (input.Get("min")).Float()
out.Min = value1
return &out
}
// dictionary: MediaStreamConstraints
type MediaStreamConstraints struct {
Video *Union
Audio *Union
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *MediaStreamConstraints) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Video.JSValue()
out.Set("video", value0)
value1 := _this.Audio.JSValue()
out.Set("audio", value1)
return out
}
// MediaStreamConstraintsFromJS is allocating a new
// MediaStreamConstraints object and copy all values from
// input javascript object
func MediaStreamConstraintsFromJS(value js.Wrapper) *MediaStreamConstraints {
input := value.JSValue()
var out MediaStreamConstraints
var (
value0 *Union // javascript: Union {video Video video}
value1 *Union // javascript: Union {audio Audio audio}
)
value0 = UnionFromJS(input.Get("video"))
out.Video = value0
value1 = UnionFromJS(input.Get("audio"))
out.Audio = value1
return &out
}
// dictionary: MediaStreamTrackEventInit
type MediaStreamTrackEventInit struct {
Bubbles bool
Cancelable bool
Composed bool
Track *MediaStreamTrack
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *MediaStreamTrackEventInit) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Bubbles
out.Set("bubbles", value0)
value1 := _this.Cancelable
out.Set("cancelable", value1)
value2 := _this.Composed
out.Set("composed", value2)
value3 := _this.Track.JSValue()
out.Set("track", value3)
return out
}
// MediaStreamTrackEventInitFromJS is allocating a new
// MediaStreamTrackEventInit object and copy all values from
// input javascript object
func MediaStreamTrackEventInitFromJS(value js.Wrapper) *MediaStreamTrackEventInit {
input := value.JSValue()
var out MediaStreamTrackEventInit
var (
value0 bool // javascript: boolean {bubbles Bubbles bubbles}
value1 bool // javascript: boolean {cancelable Cancelable cancelable}
value2 bool // javascript: boolean {composed Composed composed}
value3 *MediaStreamTrack // javascript: MediaStreamTrack {track Track track}
)
value0 = (input.Get("bubbles")).Bool()
out.Bubbles = value0
value1 = (input.Get("cancelable")).Bool()
out.Cancelable = value1
value2 = (input.Get("composed")).Bool()
out.Composed = value2
value3 = MediaStreamTrackFromJS(input.Get("track"))
out.Track = value3
return &out
}
// dictionary: MediaTrackCapabilities
type MediaTrackCapabilities struct {
Width *ULongRange
Height *ULongRange
AspectRatio *DoubleRange
FrameRate *DoubleRange
FacingMode []string
ResizeMode []string
Volume *DoubleRange
SampleRate *ULongRange
SampleSize *ULongRange
EchoCancellation []bool
AutoGainControl []bool
NoiseSuppression []bool
Latency *DoubleRange
ChannelCount *ULongRange
DeviceId string
GroupId string
WhiteBalanceMode []string
ExposureMode []string
FocusMode []string
ExposureCompensation *mediatype.MediaSettingsRange
ExposureTime *mediatype.MediaSettingsRange
ColorTemperature *mediatype.MediaSettingsRange
Iso *mediatype.MediaSettingsRange
Brightness *mediatype.MediaSettingsRange
Contrast *mediatype.MediaSettingsRange
Saturation *mediatype.MediaSettingsRange
Sharpness *mediatype.MediaSettingsRange
FocusDistance *mediatype.MediaSettingsRange
Zoom *mediatype.MediaSettingsRange
Torch bool
VideoKind string
FocalLengthX *Union
FocalLengthY *Union
PrincipalPointX *Union
PrincipalPointY *Union
DeprojectionDistortionCoefficients bool
ProjectionDistortionCoefficients bool
DepthNear *Union
DepthFar *Union
DepthToVideoTransform bool
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *MediaTrackCapabilities) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Width.JSValue()
out.Set("width", value0)
value1 := _this.Height.JSValue()
out.Set("height", value1)
value2 := _this.AspectRatio.JSValue()
out.Set("aspectRatio", value2)
value3 := _this.FrameRate.JSValue()
out.Set("frameRate", value3)
value4 := js.Global().Get("Array").New(len(_this.FacingMode))
for __idx4, __seq_in4 := range _this.FacingMode {
__seq_out4 := __seq_in4
value4.SetIndex(__idx4, __seq_out4)
}
out.Set("facingMode", value4)
value5 := js.Global().Get("Array").New(len(_this.ResizeMode))
for __idx5, __seq_in5 := range _this.ResizeMode {
__seq_out5 := __seq_in5
value5.SetIndex(__idx5, __seq_out5)
}
out.Set("resizeMode", value5)
value6 := _this.Volume.JSValue()
out.Set("volume", value6)
value7 := _this.SampleRate.JSValue()
out.Set("sampleRate", value7)
value8 := _this.SampleSize.JSValue()
out.Set("sampleSize", value8)
value9 := js.Global().Get("Array").New(len(_this.EchoCancellation))
for __idx9, __seq_in9 := range _this.EchoCancellation {
__seq_out9 := __seq_in9
value9.SetIndex(__idx9, __seq_out9)
}
out.Set("echoCancellation", value9)
value10 := js.Global().Get("Array").New(len(_this.AutoGainControl))
for __idx10, __seq_in10 := range _this.AutoGainControl {
__seq_out10 := __seq_in10
value10.SetIndex(__idx10, __seq_out10)
}
out.Set("autoGainControl", value10)
value11 := js.Global().Get("Array").New(len(_this.NoiseSuppression))
for __idx11, __seq_in11 := range _this.NoiseSuppression {
__seq_out11 := __seq_in11
value11.SetIndex(__idx11, __seq_out11)
}
out.Set("noiseSuppression", value11)
value12 := _this.Latency.JSValue()
out.Set("latency", value12)
value13 := _this.ChannelCount.JSValue()
out.Set("channelCount", value13)
value14 := _this.DeviceId
out.Set("deviceId", value14)
value15 := _this.GroupId
out.Set("groupId", value15)
value16 := js.Global().Get("Array").New(len(_this.WhiteBalanceMode))
for __idx16, __seq_in16 := range _this.WhiteBalanceMode {
__seq_out16 := __seq_in16
value16.SetIndex(__idx16, __seq_out16)
}
out.Set("whiteBalanceMode", value16)
value17 := js.Global().Get("Array").New(len(_this.ExposureMode))
for __idx17, __seq_in17 := range _this.ExposureMode {
__seq_out17 := __seq_in17
value17.SetIndex(__idx17, __seq_out17)
}
out.Set("exposureMode", value17)
value18 := js.Global().Get("Array").New(len(_this.FocusMode))
for __idx18, __seq_in18 := range _this.FocusMode {
__seq_out18 := __seq_in18
value18.SetIndex(__idx18, __seq_out18)
}
out.Set("focusMode", value18)
value19 := _this.ExposureCompensation.JSValue()
out.Set("exposureCompensation", value19)
value20 := _this.ExposureTime.JSValue()
out.Set("exposureTime", value20)
value21 := _this.ColorTemperature.JSValue()
out.Set("colorTemperature", value21)
value22 := _this.Iso.JSValue()
out.Set("iso", value22)
value23 := _this.Brightness.JSValue()
out.Set("brightness", value23)
value24 := _this.Contrast.JSValue()
out.Set("contrast", value24)
value25 := _this.Saturation.JSValue()
out.Set("saturation", value25)
value26 := _this.Sharpness.JSValue()
out.Set("sharpness", value26)
value27 := _this.FocusDistance.JSValue()
out.Set("focusDistance", value27)
value28 := _this.Zoom.JSValue()
out.Set("zoom", value28)
value29 := _this.Torch
out.Set("torch", value29)
value30 := _this.VideoKind
out.Set("videoKind", value30)
value31 := _this.FocalLengthX.JSValue()
out.Set("focalLengthX", value31)
value32 := _this.FocalLengthY.JSValue()
out.Set("focalLengthY", value32)
value33 := _this.PrincipalPointX.JSValue()
out.Set("principalPointX", value33)
value34 := _this.PrincipalPointY.JSValue()
out.Set("principalPointY", value34)
value35 := _this.DeprojectionDistortionCoefficients
out.Set("deprojectionDistortionCoefficients", value35)
value36 := _this.ProjectionDistortionCoefficients
out.Set("projectionDistortionCoefficients", value36)
value37 := _this.DepthNear.JSValue()
out.Set("depthNear", value37)
value38 := _this.DepthFar.JSValue()
out.Set("depthFar", value38)
value39 := _this.DepthToVideoTransform
out.Set("depthToVideoTransform", value39)
return out
}
// MediaTrackCapabilitiesFromJS is allocating a new
// MediaTrackCapabilities object and copy all values from
// input javascript object
func MediaTrackCapabilitiesFromJS(value js.Wrapper) *MediaTrackCapabilities {
input := value.JSValue()
var out MediaTrackCapabilities
var (
value0 *ULongRange // javascript: ULongRange {width Width width}
value1 *ULongRange // javascript: ULongRange {height Height height}
value2 *DoubleRange // javascript: DoubleRange {aspectRatio AspectRatio aspectRatio}
value3 *DoubleRange // javascript: DoubleRange {frameRate FrameRate frameRate}
value4 []string // javascript: sequence<DOMString> {facingMode FacingMode facingMode}
value5 []string // javascript: sequence<DOMString> {resizeMode ResizeMode resizeMode}
value6 *DoubleRange // javascript: DoubleRange {volume Volume volume}
value7 *ULongRange // javascript: ULongRange {sampleRate SampleRate sampleRate}
value8 *ULongRange // javascript: ULongRange {sampleSize SampleSize sampleSize}
value9 []bool // javascript: sequence<boolean> {echoCancellation EchoCancellation echoCancellation}
value10 []bool // javascript: sequence<boolean> {autoGainControl AutoGainControl autoGainControl}
value11 []bool // javascript: sequence<boolean> {noiseSuppression NoiseSuppression noiseSuppression}
value12 *DoubleRange // javascript: DoubleRange {latency Latency latency}
value13 *ULongRange // javascript: ULongRange {channelCount ChannelCount channelCount}
value14 string // javascript: DOMString {deviceId DeviceId deviceId}
value15 string // javascript: DOMString {groupId GroupId groupId}
value16 []string // javascript: sequence<DOMString> {whiteBalanceMode WhiteBalanceMode whiteBalanceMode}
value17 []string // javascript: sequence<DOMString> {exposureMode ExposureMode exposureMode}
value18 []string // javascript: sequence<DOMString> {focusMode FocusMode focusMode}
value19 *mediatype.MediaSettingsRange // javascript: MediaSettingsRange {exposureCompensation ExposureCompensation exposureCompensation}
value20 *mediatype.MediaSettingsRange // javascript: MediaSettingsRange {exposureTime ExposureTime exposureTime}
value21 *mediatype.MediaSettingsRange // javascript: MediaSettingsRange {colorTemperature ColorTemperature colorTemperature}
value22 *mediatype.MediaSettingsRange // javascript: MediaSettingsRange {iso Iso iso}
value23 *mediatype.MediaSettingsRange // javascript: MediaSettingsRange {brightness Brightness brightness}
value24 *mediatype.MediaSettingsRange // javascript: MediaSettingsRange {contrast Contrast contrast}
value25 *mediatype.MediaSettingsRange // javascript: MediaSettingsRange {saturation Saturation saturation}
value26 *mediatype.MediaSettingsRange // javascript: MediaSettingsRange {sharpness Sharpness sharpness}
value27 *mediatype.MediaSettingsRange // javascript: MediaSettingsRange {focusDistance FocusDistance focusDistance}
value28 *mediatype.MediaSettingsRange // javascript: MediaSettingsRange {zoom Zoom zoom}
value29 bool // javascript: boolean {torch Torch torch}
value30 string // javascript: DOMString {videoKind VideoKind videoKind}
value31 *Union // javascript: Union {focalLengthX FocalLengthX focalLengthX}
value32 *Union // javascript: Union {focalLengthY FocalLengthY focalLengthY}
value33 *Union // javascript: Union {principalPointX PrincipalPointX principalPointX}
value34 *Union // javascript: Union {principalPointY PrincipalPointY principalPointY}
value35 bool // javascript: boolean {deprojectionDistortionCoefficients DeprojectionDistortionCoefficients deprojectionDistortionCoefficients}
value36 bool // javascript: boolean {projectionDistortionCoefficients ProjectionDistortionCoefficients projectionDistortionCoefficients}
value37 *Union // javascript: Union {depthNear DepthNear depthNear}
value38 *Union // javascript: Union {depthFar DepthFar depthFar}
value39 bool // javascript: boolean {depthToVideoTransform DepthToVideoTransform depthToVideoTransform}
)
value0 = ULongRangeFromJS(input.Get("width"))
out.Width = value0
value1 = ULongRangeFromJS(input.Get("height"))
out.Height = value1
value2 = DoubleRangeFromJS(input.Get("aspectRatio"))
out.AspectRatio = value2
value3 = DoubleRangeFromJS(input.Get("frameRate"))
out.FrameRate = value3
__length4 := input.Get("facingMode").Length()
__array4 := make([]string, __length4, __length4)
for __idx4 := 0; __idx4 < __length4; __idx4++ {
var __seq_out4 string
__seq_in4 := input.Get("facingMode").Index(__idx4)
__seq_out4 = (__seq_in4).String()
__array4[__idx4] = __seq_out4
}
value4 = __array4
out.FacingMode = value4
__length5 := input.Get("resizeMode").Length()
__array5 := make([]string, __length5, __length5)
for __idx5 := 0; __idx5 < __length5; __idx5++ {
var __seq_out5 string
__seq_in5 := input.Get("resizeMode").Index(__idx5)
__seq_out5 = (__seq_in5).String()
__array5[__idx5] = __seq_out5
}
value5 = __array5
out.ResizeMode = value5
value6 = DoubleRangeFromJS(input.Get("volume"))
out.Volume = value6
value7 = ULongRangeFromJS(input.Get("sampleRate"))
out.SampleRate = value7
value8 = ULongRangeFromJS(input.Get("sampleSize"))
out.SampleSize = value8
__length9 := input.Get("echoCancellation").Length()
__array9 := make([]bool, __length9, __length9)
for __idx9 := 0; __idx9 < __length9; __idx9++ {
var __seq_out9 bool
__seq_in9 := input.Get("echoCancellation").Index(__idx9)
__seq_out9 = (__seq_in9).Bool()
__array9[__idx9] = __seq_out9
}
value9 = __array9
out.EchoCancellation = value9
__length10 := input.Get("autoGainControl").Length()
__array10 := make([]bool, __length10, __length10)
for __idx10 := 0; __idx10 < __length10; __idx10++ {
var __seq_out10 bool
__seq_in10 := input.Get("autoGainControl").Index(__idx10)
__seq_out10 = (__seq_in10).Bool()
__array10[__idx10] = __seq_out10
}
value10 = __array10
out.AutoGainControl = value10
__length11 := input.Get("noiseSuppression").Length()
__array11 := make([]bool, __length11, __length11)
for __idx11 := 0; __idx11 < __length11; __idx11++ {
var __seq_out11 bool
__seq_in11 := input.Get("noiseSuppression").Index(__idx11)
__seq_out11 = (__seq_in11).Bool()
__array11[__idx11] = __seq_out11
}
value11 = __array11
out.NoiseSuppression = value11
value12 = DoubleRangeFromJS(input.Get("latency"))
out.Latency = value12
value13 = ULongRangeFromJS(input.Get("channelCount"))
out.ChannelCount = value13
value14 = (input.Get("deviceId")).String()
out.DeviceId = value14
value15 = (input.Get("groupId")).String()
out.GroupId = value15
__length16 := input.Get("whiteBalanceMode").Length()
__array16 := make([]string, __length16, __length16)
for __idx16 := 0; __idx16 < __length16; __idx16++ {
var __seq_out16 string
__seq_in16 := input.Get("whiteBalanceMode").Index(__idx16)
__seq_out16 = (__seq_in16).String()
__array16[__idx16] = __seq_out16
}
value16 = __array16
out.WhiteBalanceMode = value16
__length17 := input.Get("exposureMode").Length()
__array17 := make([]string, __length17, __length17)
for __idx17 := 0; __idx17 < __length17; __idx17++ {
var __seq_out17 string
__seq_in17 := input.Get("exposureMode").Index(__idx17)
__seq_out17 = (__seq_in17).String()
__array17[__idx17] = __seq_out17
}
value17 = __array17
out.ExposureMode = value17
__length18 := input.Get("focusMode").Length()
__array18 := make([]string, __length18, __length18)
for __idx18 := 0; __idx18 < __length18; __idx18++ {
var __seq_out18 string
__seq_in18 := input.Get("focusMode").Index(__idx18)
__seq_out18 = (__seq_in18).String()
__array18[__idx18] = __seq_out18
}
value18 = __array18
out.FocusMode = value18
value19 = mediatype.MediaSettingsRangeFromJS(input.Get("exposureCompensation"))
out.ExposureCompensation = value19
value20 = mediatype.MediaSettingsRangeFromJS(input.Get("exposureTime"))
out.ExposureTime = value20
value21 = mediatype.MediaSettingsRangeFromJS(input.Get("colorTemperature"))
out.ColorTemperature = value21
value22 = mediatype.MediaSettingsRangeFromJS(input.Get("iso"))
out.Iso = value22
value23 = mediatype.MediaSettingsRangeFromJS(input.Get("brightness"))
out.Brightness = value23
value24 = mediatype.MediaSettingsRangeFromJS(input.Get("contrast"))
out.Contrast = value24
value25 = mediatype.MediaSettingsRangeFromJS(input.Get("saturation"))
out.Saturation = value25
value26 = mediatype.MediaSettingsRangeFromJS(input.Get("sharpness"))
out.Sharpness = value26
value27 = mediatype.MediaSettingsRangeFromJS(input.Get("focusDistance"))
out.FocusDistance = value27
value28 = mediatype.MediaSettingsRangeFromJS(input.Get("zoom"))
out.Zoom = value28
value29 = (input.Get("torch")).Bool()
out.Torch = value29
value30 = (input.Get("videoKind")).String()
out.VideoKind = value30
value31 = UnionFromJS(input.Get("focalLengthX"))
out.FocalLengthX = value31
value32 = UnionFromJS(input.Get("focalLengthY"))
out.FocalLengthY = value32
value33 = UnionFromJS(input.Get("principalPointX"))
out.PrincipalPointX = value33
value34 = UnionFromJS(input.Get("principalPointY"))
out.PrincipalPointY = value34
value35 = (input.Get("deprojectionDistortionCoefficients")).Bool()
out.DeprojectionDistortionCoefficients = value35
value36 = (input.Get("projectionDistortionCoefficients")).Bool()
out.ProjectionDistortionCoefficients = value36
value37 = UnionFromJS(input.Get("depthNear"))
out.DepthNear = value37
value38 = UnionFromJS(input.Get("depthFar"))
out.DepthFar = value38
value39 = (input.Get("depthToVideoTransform")).Bool()
out.DepthToVideoTransform = value39
return &out
}
// dictionary: MediaTrackConstraintSet
type MediaTrackConstraintSet struct {
Width *Union
Height *Union
AspectRatio *Union
FrameRate *Union
FacingMode *Union
ResizeMode *Union
Volume *Union
SampleRate *Union
SampleSize *Union
EchoCancellation *Union
AutoGainControl *Union
NoiseSuppression *Union
Latency *Union
ChannelCount *Union
DeviceId *Union
GroupId *Union
WhiteBalanceMode *Union
ExposureMode *Union
FocusMode *Union
PointsOfInterest *Union
ExposureCompensation *Union
ExposureTime *Union
ColorTemperature *Union
Iso *Union
Brightness *Union
Contrast *Union
Saturation *Union
Sharpness *Union
FocusDistance *Union
Zoom *Union
Torch *Union
VideoKind *Union
FocalLengthX *Union
FocalLengthY *Union
PrincipalPointX *Union
PrincipalPointY *Union
DeprojectionDistortionCoefficients *Union
ProjectionDistortionCoefficients *Union
DepthNear *Union
DepthFar *Union
DepthToVideoTransform *Union
DisplaySurface *Union
LogicalSurface *Union
Cursor *Union
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *MediaTrackConstraintSet) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Width.JSValue()
out.Set("width", value0)
value1 := _this.Height.JSValue()
out.Set("height", value1)
value2 := _this.AspectRatio.JSValue()
out.Set("aspectRatio", value2)
value3 := _this.FrameRate.JSValue()
out.Set("frameRate", value3)
value4 := _this.FacingMode.JSValue()
out.Set("facingMode", value4)
value5 := _this.ResizeMode.JSValue()
out.Set("resizeMode", value5)
value6 := _this.Volume.JSValue()
out.Set("volume", value6)
value7 := _this.SampleRate.JSValue()
out.Set("sampleRate", value7)
value8 := _this.SampleSize.JSValue()
out.Set("sampleSize", value8)
value9 := _this.EchoCancellation.JSValue()
out.Set("echoCancellation", value9)
value10 := _this.AutoGainControl.JSValue()
out.Set("autoGainControl", value10)
value11 := _this.NoiseSuppression.JSValue()
out.Set("noiseSuppression", value11)
value12 := _this.Latency.JSValue()
out.Set("latency", value12)
value13 := _this.ChannelCount.JSValue()
out.Set("channelCount", value13)
value14 := _this.DeviceId.JSValue()
out.Set("deviceId", value14)
value15 := _this.GroupId.JSValue()
out.Set("groupId", value15)
value16 := _this.WhiteBalanceMode.JSValue()
out.Set("whiteBalanceMode", value16)
value17 := _this.ExposureMode.JSValue()
out.Set("exposureMode", value17)
value18 := _this.FocusMode.JSValue()
out.Set("focusMode", value18)
value19 := _this.PointsOfInterest.JSValue()
out.Set("pointsOfInterest", value19)
value20 := _this.ExposureCompensation.JSValue()
out.Set("exposureCompensation", value20)
value21 := _this.ExposureTime.JSValue()
out.Set("exposureTime", value21)
value22 := _this.ColorTemperature.JSValue()
out.Set("colorTemperature", value22)
value23 := _this.Iso.JSValue()
out.Set("iso", value23)
value24 := _this.Brightness.JSValue()
out.Set("brightness", value24)
value25 := _this.Contrast.JSValue()
out.Set("contrast", value25)
value26 := _this.Saturation.JSValue()
out.Set("saturation", value26)
value27 := _this.Sharpness.JSValue()
out.Set("sharpness", value27)
value28 := _this.FocusDistance.JSValue()
out.Set("focusDistance", value28)
value29 := _this.Zoom.JSValue()
out.Set("zoom", value29)
value30 := _this.Torch.JSValue()
out.Set("torch", value30)
value31 := _this.VideoKind.JSValue()
out.Set("videoKind", value31)
value32 := _this.FocalLengthX.JSValue()
out.Set("focalLengthX", value32)
value33 := _this.FocalLengthY.JSValue()
out.Set("focalLengthY", value33)
value34 := _this.PrincipalPointX.JSValue()
out.Set("principalPointX", value34)
value35 := _this.PrincipalPointY.JSValue()
out.Set("principalPointY", value35)
value36 := _this.DeprojectionDistortionCoefficients.JSValue()
out.Set("deprojectionDistortionCoefficients", value36)
value37 := _this.ProjectionDistortionCoefficients.JSValue()
out.Set("projectionDistortionCoefficients", value37)
value38 := _this.DepthNear.JSValue()
out.Set("depthNear", value38)
value39 := _this.DepthFar.JSValue()
out.Set("depthFar", value39)
value40 := _this.DepthToVideoTransform.JSValue()
out.Set("depthToVideoTransform", value40)
value41 := _this.DisplaySurface.JSValue()
out.Set("displaySurface", value41)
value42 := _this.LogicalSurface.JSValue()
out.Set("logicalSurface", value42)
value43 := _this.Cursor.JSValue()
out.Set("cursor", value43)
return out
}
// MediaTrackConstraintSetFromJS is allocating a new
// MediaTrackConstraintSet object and copy all values from
// input javascript object
func MediaTrackConstraintSetFromJS(value js.Wrapper) *MediaTrackConstraintSet {
input := value.JSValue()
var out MediaTrackConstraintSet
var (
value0 *Union // javascript: Union {width Width width}
value1 *Union // javascript: Union {height Height height}
value2 *Union // javascript: Union {aspectRatio AspectRatio aspectRatio}
value3 *Union // javascript: Union {frameRate FrameRate frameRate}
value4 *Union // javascript: Union {facingMode FacingMode facingMode}
value5 *Union // javascript: Union {resizeMode ResizeMode resizeMode}
value6 *Union // javascript: Union {volume Volume volume}
value7 *Union // javascript: Union {sampleRate SampleRate sampleRate}
value8 *Union // javascript: Union {sampleSize SampleSize sampleSize}
value9 *Union // javascript: Union {echoCancellation EchoCancellation echoCancellation}
value10 *Union // javascript: Union {autoGainControl AutoGainControl autoGainControl}
value11 *Union // javascript: Union {noiseSuppression NoiseSuppression noiseSuppression}
value12 *Union // javascript: Union {latency Latency latency}
value13 *Union // javascript: Union {channelCount ChannelCount channelCount}
value14 *Union // javascript: Union {deviceId DeviceId deviceId}
value15 *Union // javascript: Union {groupId GroupId groupId}
value16 *Union // javascript: Union {whiteBalanceMode WhiteBalanceMode whiteBalanceMode}
value17 *Union // javascript: Union {exposureMode ExposureMode exposureMode}
value18 *Union // javascript: Union {focusMode FocusMode focusMode}
value19 *Union // javascript: Union {pointsOfInterest PointsOfInterest pointsOfInterest}
value20 *Union // javascript: Union {exposureCompensation ExposureCompensation exposureCompensation}
value21 *Union // javascript: Union {exposureTime ExposureTime exposureTime}
value22 *Union // javascript: Union {colorTemperature ColorTemperature colorTemperature}
value23 *Union // javascript: Union {iso Iso iso}
value24 *Union // javascript: Union {brightness Brightness brightness}
value25 *Union // javascript: Union {contrast Contrast contrast}
value26 *Union // javascript: Union {saturation Saturation saturation}
value27 *Union // javascript: Union {sharpness Sharpness sharpness}
value28 *Union // javascript: Union {focusDistance FocusDistance focusDistance}
value29 *Union // javascript: Union {zoom Zoom zoom}
value30 *Union // javascript: Union {torch Torch torch}
value31 *Union // javascript: Union {videoKind VideoKind videoKind}
value32 *Union // javascript: Union {focalLengthX FocalLengthX focalLengthX}
value33 *Union // javascript: Union {focalLengthY FocalLengthY focalLengthY}
value34 *Union // javascript: Union {principalPointX PrincipalPointX principalPointX}
value35 *Union // javascript: Union {principalPointY PrincipalPointY principalPointY}
value36 *Union // javascript: Union {deprojectionDistortionCoefficients DeprojectionDistortionCoefficients deprojectionDistortionCoefficients}
value37 *Union // javascript: Union {projectionDistortionCoefficients ProjectionDistortionCoefficients projectionDistortionCoefficients}
value38 *Union // javascript: Union {depthNear DepthNear depthNear}
value39 *Union // javascript: Union {depthFar DepthFar depthFar}
value40 *Union // javascript: Union {depthToVideoTransform DepthToVideoTransform depthToVideoTransform}
value41 *Union // javascript: Union {displaySurface DisplaySurface displaySurface}
value42 *Union // javascript: Union {logicalSurface LogicalSurface logicalSurface}
value43 *Union // javascript: Union {cursor Cursor cursor}
)
value0 = UnionFromJS(input.Get("width"))
out.Width = value0
value1 = UnionFromJS(input.Get("height"))
out.Height = value1
value2 = UnionFromJS(input.Get("aspectRatio"))
out.AspectRatio = value2
value3 = UnionFromJS(input.Get("frameRate"))
out.FrameRate = value3
value4 = UnionFromJS(input.Get("facingMode"))
out.FacingMode = value4
value5 = UnionFromJS(input.Get("resizeMode"))
out.ResizeMode = value5
value6 = UnionFromJS(input.Get("volume"))
out.Volume = value6
value7 = UnionFromJS(input.Get("sampleRate"))
out.SampleRate = value7
value8 = UnionFromJS(input.Get("sampleSize"))
out.SampleSize = value8
value9 = UnionFromJS(input.Get("echoCancellation"))
out.EchoCancellation = value9
value10 = UnionFromJS(input.Get("autoGainControl"))
out.AutoGainControl = value10
value11 = UnionFromJS(input.Get("noiseSuppression"))
out.NoiseSuppression = value11
value12 = UnionFromJS(input.Get("latency"))
out.Latency = value12
value13 = UnionFromJS(input.Get("channelCount"))
out.ChannelCount = value13
value14 = UnionFromJS(input.Get("deviceId"))
out.DeviceId = value14
value15 = UnionFromJS(input.Get("groupId"))
out.GroupId = value15
value16 = UnionFromJS(input.Get("whiteBalanceMode"))
out.WhiteBalanceMode = value16
value17 = UnionFromJS(input.Get("exposureMode"))
out.ExposureMode = value17
value18 = UnionFromJS(input.Get("focusMode"))
out.FocusMode = value18
value19 = UnionFromJS(input.Get("pointsOfInterest"))
out.PointsOfInterest = value19
value20 = UnionFromJS(input.Get("exposureCompensation"))
out.ExposureCompensation = value20
value21 = UnionFromJS(input.Get("exposureTime"))
out.ExposureTime = value21
value22 = UnionFromJS(input.Get("colorTemperature"))
out.ColorTemperature = value22
value23 = UnionFromJS(input.Get("iso"))
out.Iso = value23
value24 = UnionFromJS(input.Get("brightness"))
out.Brightness = value24
value25 = UnionFromJS(input.Get("contrast"))
out.Contrast = value25
value26 = UnionFromJS(input.Get("saturation"))
out.Saturation = value26
value27 = UnionFromJS(input.Get("sharpness"))
out.Sharpness = value27
value28 = UnionFromJS(input.Get("focusDistance"))
out.FocusDistance = value28
value29 = UnionFromJS(input.Get("zoom"))
out.Zoom = value29
value30 = UnionFromJS(input.Get("torch"))
out.Torch = value30
value31 = UnionFromJS(input.Get("videoKind"))
out.VideoKind = value31
value32 = UnionFromJS(input.Get("focalLengthX"))
out.FocalLengthX = value32
value33 = UnionFromJS(input.Get("focalLengthY"))
out.FocalLengthY = value33
value34 = UnionFromJS(input.Get("principalPointX"))
out.PrincipalPointX = value34
value35 = UnionFromJS(input.Get("principalPointY"))
out.PrincipalPointY = value35
value36 = UnionFromJS(input.Get("deprojectionDistortionCoefficients"))
out.DeprojectionDistortionCoefficients = value36
value37 = UnionFromJS(input.Get("projectionDistortionCoefficients"))
out.ProjectionDistortionCoefficients = value37
value38 = UnionFromJS(input.Get("depthNear"))
out.DepthNear = value38
value39 = UnionFromJS(input.Get("depthFar"))
out.DepthFar = value39
value40 = UnionFromJS(input.Get("depthToVideoTransform"))
out.DepthToVideoTransform = value40
value41 = UnionFromJS(input.Get("displaySurface"))
out.DisplaySurface = value41
value42 = UnionFromJS(input.Get("logicalSurface"))
out.LogicalSurface = value42
value43 = UnionFromJS(input.Get("cursor"))
out.Cursor = value43
return &out
}
// dictionary: MediaTrackConstraints
type MediaTrackConstraints struct {
Width *Union
Height *Union
AspectRatio *Union
FrameRate *Union
FacingMode *Union
ResizeMode *Union
Volume *Union
SampleRate *Union
SampleSize *Union
EchoCancellation *Union
AutoGainControl *Union
NoiseSuppression *Union
Latency *Union
ChannelCount *Union
DeviceId *Union
GroupId *Union
WhiteBalanceMode *Union
ExposureMode *Union
FocusMode *Union
PointsOfInterest *Union
ExposureCompensation *Union
ExposureTime *Union
ColorTemperature *Union
Iso *Union
Brightness *Union
Contrast *Union
Saturation *Union
Sharpness *Union
FocusDistance *Union
Zoom *Union
Torch *Union
VideoKind *Union
FocalLengthX *Union
FocalLengthY *Union
PrincipalPointX *Union
PrincipalPointY *Union
DeprojectionDistortionCoefficients *Union
ProjectionDistortionCoefficients *Union
DepthNear *Union
DepthFar *Union
DepthToVideoTransform *Union
DisplaySurface *Union
LogicalSurface *Union
Cursor *Union
Advanced []*MediaTrackConstraintSet
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *MediaTrackConstraints) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Width.JSValue()
out.Set("width", value0)
value1 := _this.Height.JSValue()
out.Set("height", value1)
value2 := _this.AspectRatio.JSValue()
out.Set("aspectRatio", value2)
value3 := _this.FrameRate.JSValue()
out.Set("frameRate", value3)
value4 := _this.FacingMode.JSValue()
out.Set("facingMode", value4)
value5 := _this.ResizeMode.JSValue()
out.Set("resizeMode", value5)
value6 := _this.Volume.JSValue()
out.Set("volume", value6)
value7 := _this.SampleRate.JSValue()
out.Set("sampleRate", value7)
value8 := _this.SampleSize.JSValue()
out.Set("sampleSize", value8)
value9 := _this.EchoCancellation.JSValue()
out.Set("echoCancellation", value9)
value10 := _this.AutoGainControl.JSValue()
out.Set("autoGainControl", value10)
value11 := _this.NoiseSuppression.JSValue()
out.Set("noiseSuppression", value11)
value12 := _this.Latency.JSValue()
out.Set("latency", value12)
value13 := _this.ChannelCount.JSValue()
out.Set("channelCount", value13)
value14 := _this.DeviceId.JSValue()
out.Set("deviceId", value14)
value15 := _this.GroupId.JSValue()
out.Set("groupId", value15)
value16 := _this.WhiteBalanceMode.JSValue()
out.Set("whiteBalanceMode", value16)
value17 := _this.ExposureMode.JSValue()
out.Set("exposureMode", value17)
value18 := _this.FocusMode.JSValue()
out.Set("focusMode", value18)
value19 := _this.PointsOfInterest.JSValue()
out.Set("pointsOfInterest", value19)
value20 := _this.ExposureCompensation.JSValue()
out.Set("exposureCompensation", value20)
value21 := _this.ExposureTime.JSValue()
out.Set("exposureTime", value21)
value22 := _this.ColorTemperature.JSValue()
out.Set("colorTemperature", value22)
value23 := _this.Iso.JSValue()
out.Set("iso", value23)
value24 := _this.Brightness.JSValue()
out.Set("brightness", value24)
value25 := _this.Contrast.JSValue()
out.Set("contrast", value25)
value26 := _this.Saturation.JSValue()
out.Set("saturation", value26)
value27 := _this.Sharpness.JSValue()
out.Set("sharpness", value27)
value28 := _this.FocusDistance.JSValue()
out.Set("focusDistance", value28)
value29 := _this.Zoom.JSValue()
out.Set("zoom", value29)
value30 := _this.Torch.JSValue()
out.Set("torch", value30)
value31 := _this.VideoKind.JSValue()
out.Set("videoKind", value31)
value32 := _this.FocalLengthX.JSValue()
out.Set("focalLengthX", value32)
value33 := _this.FocalLengthY.JSValue()
out.Set("focalLengthY", value33)
value34 := _this.PrincipalPointX.JSValue()
out.Set("principalPointX", value34)
value35 := _this.PrincipalPointY.JSValue()
out.Set("principalPointY", value35)
value36 := _this.DeprojectionDistortionCoefficients.JSValue()
out.Set("deprojectionDistortionCoefficients", value36)
value37 := _this.ProjectionDistortionCoefficients.JSValue()
out.Set("projectionDistortionCoefficients", value37)
value38 := _this.DepthNear.JSValue()
out.Set("depthNear", value38)
value39 := _this.DepthFar.JSValue()
out.Set("depthFar", value39)
value40 := _this.DepthToVideoTransform.JSValue()
out.Set("depthToVideoTransform", value40)
value41 := _this.DisplaySurface.JSValue()
out.Set("displaySurface", value41)
value42 := _this.LogicalSurface.JSValue()
out.Set("logicalSurface", value42)
value43 := _this.Cursor.JSValue()
out.Set("cursor", value43)
value44 := js.Global().Get("Array").New(len(_this.Advanced))
for __idx44, __seq_in44 := range _this.Advanced {
__seq_out44 := __seq_in44.JSValue()
value44.SetIndex(__idx44, __seq_out44)
}
out.Set("advanced", value44)
return out
}
// MediaTrackConstraintsFromJS is allocating a new
// MediaTrackConstraints object and copy all values from
// input javascript object
func MediaTrackConstraintsFromJS(value js.Wrapper) *MediaTrackConstraints {
input := value.JSValue()
var out MediaTrackConstraints
var (
value0 *Union // javascript: Union {width Width width}
value1 *Union // javascript: Union {height Height height}
value2 *Union // javascript: Union {aspectRatio AspectRatio aspectRatio}
value3 *Union // javascript: Union {frameRate FrameRate frameRate}
value4 *Union // javascript: Union {facingMode FacingMode facingMode}
value5 *Union // javascript: Union {resizeMode ResizeMode resizeMode}
value6 *Union // javascript: Union {volume Volume volume}
value7 *Union // javascript: Union {sampleRate SampleRate sampleRate}
value8 *Union // javascript: Union {sampleSize SampleSize sampleSize}
value9 *Union // javascript: Union {echoCancellation EchoCancellation echoCancellation}
value10 *Union // javascript: Union {autoGainControl AutoGainControl autoGainControl}
value11 *Union // javascript: Union {noiseSuppression NoiseSuppression noiseSuppression}
value12 *Union // javascript: Union {latency Latency latency}
value13 *Union // javascript: Union {channelCount ChannelCount channelCount}
value14 *Union // javascript: Union {deviceId DeviceId deviceId}
value15 *Union // javascript: Union {groupId GroupId groupId}
value16 *Union // javascript: Union {whiteBalanceMode WhiteBalanceMode whiteBalanceMode}
value17 *Union // javascript: Union {exposureMode ExposureMode exposureMode}
value18 *Union // javascript: Union {focusMode FocusMode focusMode}
value19 *Union // javascript: Union {pointsOfInterest PointsOfInterest pointsOfInterest}
value20 *Union // javascript: Union {exposureCompensation ExposureCompensation exposureCompensation}
value21 *Union // javascript: Union {exposureTime ExposureTime exposureTime}
value22 *Union // javascript: Union {colorTemperature ColorTemperature colorTemperature}
value23 *Union // javascript: Union {iso Iso iso}
value24 *Union // javascript: Union {brightness Brightness brightness}
value25 *Union // javascript: Union {contrast Contrast contrast}
value26 *Union // javascript: Union {saturation Saturation saturation}
value27 *Union // javascript: Union {sharpness Sharpness sharpness}
value28 *Union // javascript: Union {focusDistance FocusDistance focusDistance}
value29 *Union // javascript: Union {zoom Zoom zoom}
value30 *Union // javascript: Union {torch Torch torch}
value31 *Union // javascript: Union {videoKind VideoKind videoKind}
value32 *Union // javascript: Union {focalLengthX FocalLengthX focalLengthX}
value33 *Union // javascript: Union {focalLengthY FocalLengthY focalLengthY}
value34 *Union // javascript: Union {principalPointX PrincipalPointX principalPointX}
value35 *Union // javascript: Union {principalPointY PrincipalPointY principalPointY}
value36 *Union // javascript: Union {deprojectionDistortionCoefficients DeprojectionDistortionCoefficients deprojectionDistortionCoefficients}
value37 *Union // javascript: Union {projectionDistortionCoefficients ProjectionDistortionCoefficients projectionDistortionCoefficients}
value38 *Union // javascript: Union {depthNear DepthNear depthNear}
value39 *Union // javascript: Union {depthFar DepthFar depthFar}
value40 *Union // javascript: Union {depthToVideoTransform DepthToVideoTransform depthToVideoTransform}
value41 *Union // javascript: Union {displaySurface DisplaySurface displaySurface}
value42 *Union // javascript: Union {logicalSurface LogicalSurface logicalSurface}
value43 *Union // javascript: Union {cursor Cursor cursor}
value44 []*MediaTrackConstraintSet // javascript: sequence<MediaTrackConstraintSet> {advanced Advanced advanced}
)
value0 = UnionFromJS(input.Get("width"))
out.Width = value0
value1 = UnionFromJS(input.Get("height"))
out.Height = value1
value2 = UnionFromJS(input.Get("aspectRatio"))
out.AspectRatio = value2
value3 = UnionFromJS(input.Get("frameRate"))
out.FrameRate = value3
value4 = UnionFromJS(input.Get("facingMode"))
out.FacingMode = value4
value5 = UnionFromJS(input.Get("resizeMode"))
out.ResizeMode = value5
value6 = UnionFromJS(input.Get("volume"))
out.Volume = value6
value7 = UnionFromJS(input.Get("sampleRate"))
out.SampleRate = value7
value8 = UnionFromJS(input.Get("sampleSize"))
out.SampleSize = value8
value9 = UnionFromJS(input.Get("echoCancellation"))
out.EchoCancellation = value9
value10 = UnionFromJS(input.Get("autoGainControl"))
out.AutoGainControl = value10
value11 = UnionFromJS(input.Get("noiseSuppression"))
out.NoiseSuppression = value11
value12 = UnionFromJS(input.Get("latency"))
out.Latency = value12
value13 = UnionFromJS(input.Get("channelCount"))
out.ChannelCount = value13
value14 = UnionFromJS(input.Get("deviceId"))
out.DeviceId = value14
value15 = UnionFromJS(input.Get("groupId"))
out.GroupId = value15
value16 = UnionFromJS(input.Get("whiteBalanceMode"))
out.WhiteBalanceMode = value16
value17 = UnionFromJS(input.Get("exposureMode"))
out.ExposureMode = value17
value18 = UnionFromJS(input.Get("focusMode"))
out.FocusMode = value18
value19 = UnionFromJS(input.Get("pointsOfInterest"))
out.PointsOfInterest = value19
value20 = UnionFromJS(input.Get("exposureCompensation"))
out.ExposureCompensation = value20
value21 = UnionFromJS(input.Get("exposureTime"))
out.ExposureTime = value21
value22 = UnionFromJS(input.Get("colorTemperature"))
out.ColorTemperature = value22
value23 = UnionFromJS(input.Get("iso"))
out.Iso = value23
value24 = UnionFromJS(input.Get("brightness"))
out.Brightness = value24
value25 = UnionFromJS(input.Get("contrast"))
out.Contrast = value25
value26 = UnionFromJS(input.Get("saturation"))
out.Saturation = value26
value27 = UnionFromJS(input.Get("sharpness"))
out.Sharpness = value27
value28 = UnionFromJS(input.Get("focusDistance"))
out.FocusDistance = value28
value29 = UnionFromJS(input.Get("zoom"))
out.Zoom = value29
value30 = UnionFromJS(input.Get("torch"))
out.Torch = value30
value31 = UnionFromJS(input.Get("videoKind"))
out.VideoKind = value31
value32 = UnionFromJS(input.Get("focalLengthX"))
out.FocalLengthX = value32
value33 = UnionFromJS(input.Get("focalLengthY"))
out.FocalLengthY = value33
value34 = UnionFromJS(input.Get("principalPointX"))
out.PrincipalPointX = value34
value35 = UnionFromJS(input.Get("principalPointY"))
out.PrincipalPointY = value35
value36 = UnionFromJS(input.Get("deprojectionDistortionCoefficients"))
out.DeprojectionDistortionCoefficients = value36
value37 = UnionFromJS(input.Get("projectionDistortionCoefficients"))
out.ProjectionDistortionCoefficients = value37
value38 = UnionFromJS(input.Get("depthNear"))
out.DepthNear = value38
value39 = UnionFromJS(input.Get("depthFar"))
out.DepthFar = value39
value40 = UnionFromJS(input.Get("depthToVideoTransform"))
out.DepthToVideoTransform = value40
value41 = UnionFromJS(input.Get("displaySurface"))
out.DisplaySurface = value41
value42 = UnionFromJS(input.Get("logicalSurface"))
out.LogicalSurface = value42
value43 = UnionFromJS(input.Get("cursor"))
out.Cursor = value43
__length44 := input.Get("advanced").Length()
__array44 := make([]*MediaTrackConstraintSet, __length44, __length44)
for __idx44 := 0; __idx44 < __length44; __idx44++ {
var __seq_out44 *MediaTrackConstraintSet
__seq_in44 := input.Get("advanced").Index(__idx44)
__seq_out44 = MediaTrackConstraintSetFromJS(__seq_in44)
__array44[__idx44] = __seq_out44
}
value44 = __array44
out.Advanced = value44
return &out
}
// dictionary: MediaTrackSettings
type MediaTrackSettings struct {
Width int
Height int
AspectRatio float64
FrameRate float64
FacingMode string
ResizeMode string
Volume float64
SampleRate int
SampleSize int
EchoCancellation bool
AutoGainControl bool
NoiseSuppression bool
Latency float64
ChannelCount int
DeviceId string
GroupId string
WhiteBalanceMode string
ExposureMode string
FocusMode string
PointsOfInterest []*mediatype.Point2D
ExposureCompensation float64
ExposureTime float64
ColorTemperature float64
Iso float64
Brightness float64
Contrast float64
Saturation float64
Sharpness float64
FocusDistance float64
Zoom float64
Torch bool
VideoKind string
FocalLengthX float64
FocalLengthY float64
PrincipalPointX float64
PrincipalPointY float64
DeprojectionDistortionCoefficients *depth.DistortionCoefficients
ProjectionDistortionCoefficients *depth.DistortionCoefficients
DepthNear float64
DepthFar float64
DepthToVideoTransform *depth.Transformation
DisplaySurface string
LogicalSurface bool
Cursor string
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *MediaTrackSettings) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Width
out.Set("width", value0)
value1 := _this.Height
out.Set("height", value1)
value2 := _this.AspectRatio
out.Set("aspectRatio", value2)
value3 := _this.FrameRate
out.Set("frameRate", value3)
value4 := _this.FacingMode
out.Set("facingMode", value4)
value5 := _this.ResizeMode
out.Set("resizeMode", value5)
value6 := _this.Volume
out.Set("volume", value6)
value7 := _this.SampleRate
out.Set("sampleRate", value7)
value8 := _this.SampleSize
out.Set("sampleSize", value8)
value9 := _this.EchoCancellation
out.Set("echoCancellation", value9)
value10 := _this.AutoGainControl
out.Set("autoGainControl", value10)
value11 := _this.NoiseSuppression
out.Set("noiseSuppression", value11)
value12 := _this.Latency
out.Set("latency", value12)
value13 := _this.ChannelCount
out.Set("channelCount", value13)
value14 := _this.DeviceId
out.Set("deviceId", value14)
value15 := _this.GroupId
out.Set("groupId", value15)
value16 := _this.WhiteBalanceMode
out.Set("whiteBalanceMode", value16)
value17 := _this.ExposureMode
out.Set("exposureMode", value17)
value18 := _this.FocusMode
out.Set("focusMode", value18)
value19 := js.Global().Get("Array").New(len(_this.PointsOfInterest))
for __idx19, __seq_in19 := range _this.PointsOfInterest {
__seq_out19 := __seq_in19.JSValue()
value19.SetIndex(__idx19, __seq_out19)
}
out.Set("pointsOfInterest", value19)
value20 := _this.ExposureCompensation
out.Set("exposureCompensation", value20)
value21 := _this.ExposureTime
out.Set("exposureTime", value21)
value22 := _this.ColorTemperature
out.Set("colorTemperature", value22)
value23 := _this.Iso
out.Set("iso", value23)
value24 := _this.Brightness
out.Set("brightness", value24)
value25 := _this.Contrast
out.Set("contrast", value25)
value26 := _this.Saturation
out.Set("saturation", value26)
value27 := _this.Sharpness
out.Set("sharpness", value27)
value28 := _this.FocusDistance
out.Set("focusDistance", value28)
value29 := _this.Zoom
out.Set("zoom", value29)
value30 := _this.Torch
out.Set("torch", value30)
value31 := _this.VideoKind
out.Set("videoKind", value31)
value32 := _this.FocalLengthX
out.Set("focalLengthX", value32)
value33 := _this.FocalLengthY
out.Set("focalLengthY", value33)
value34 := _this.PrincipalPointX
out.Set("principalPointX", value34)
value35 := _this.PrincipalPointY
out.Set("principalPointY", value35)
value36 := _this.DeprojectionDistortionCoefficients.JSValue()
out.Set("deprojectionDistortionCoefficients", value36)
value37 := _this.ProjectionDistortionCoefficients.JSValue()
out.Set("projectionDistortionCoefficients", value37)
value38 := _this.DepthNear
out.Set("depthNear", value38)
value39 := _this.DepthFar
out.Set("depthFar", value39)
value40 := _this.DepthToVideoTransform.JSValue()
out.Set("depthToVideoTransform", value40)
value41 := _this.DisplaySurface
out.Set("displaySurface", value41)
value42 := _this.LogicalSurface
out.Set("logicalSurface", value42)
value43 := _this.Cursor
out.Set("cursor", value43)
return out
}
// MediaTrackSettingsFromJS is allocating a new
// MediaTrackSettings object and copy all values from
// input javascript object
func MediaTrackSettingsFromJS(value js.Wrapper) *MediaTrackSettings {
input := value.JSValue()
var out MediaTrackSettings
var (
value0 int // javascript: long {width Width width}
value1 int // javascript: long {height Height height}
value2 float64 // javascript: double {aspectRatio AspectRatio aspectRatio}
value3 float64 // javascript: double {frameRate FrameRate frameRate}
value4 string // javascript: DOMString {facingMode FacingMode facingMode}
value5 string // javascript: DOMString {resizeMode ResizeMode resizeMode}
value6 float64 // javascript: double {volume Volume volume}
value7 int // javascript: long {sampleRate SampleRate sampleRate}
value8 int // javascript: long {sampleSize SampleSize sampleSize}
value9 bool // javascript: boolean {echoCancellation EchoCancellation echoCancellation}
value10 bool // javascript: boolean {autoGainControl AutoGainControl autoGainControl}
value11 bool // javascript: boolean {noiseSuppression NoiseSuppression noiseSuppression}
value12 float64 // javascript: double {latency Latency latency}
value13 int // javascript: long {channelCount ChannelCount channelCount}
value14 string // javascript: DOMString {deviceId DeviceId deviceId}
value15 string // javascript: DOMString {groupId GroupId groupId}
value16 string // javascript: DOMString {whiteBalanceMode WhiteBalanceMode whiteBalanceMode}
value17 string // javascript: DOMString {exposureMode ExposureMode exposureMode}
value18 string // javascript: DOMString {focusMode FocusMode focusMode}
value19 []*mediatype.Point2D // javascript: sequence<Point2D> {pointsOfInterest PointsOfInterest pointsOfInterest}
value20 float64 // javascript: double {exposureCompensation ExposureCompensation exposureCompensation}
value21 float64 // javascript: double {exposureTime ExposureTime exposureTime}
value22 float64 // javascript: double {colorTemperature ColorTemperature colorTemperature}
value23 float64 // javascript: double {iso Iso iso}
value24 float64 // javascript: double {brightness Brightness brightness}
value25 float64 // javascript: double {contrast Contrast contrast}
value26 float64 // javascript: double {saturation Saturation saturation}
value27 float64 // javascript: double {sharpness Sharpness sharpness}
value28 float64 // javascript: double {focusDistance FocusDistance focusDistance}
value29 float64 // javascript: double {zoom Zoom zoom}
value30 bool // javascript: boolean {torch Torch torch}
value31 string // javascript: DOMString {videoKind VideoKind videoKind}
value32 float64 // javascript: double {focalLengthX FocalLengthX focalLengthX}
value33 float64 // javascript: double {focalLengthY FocalLengthY focalLengthY}
value34 float64 // javascript: double {principalPointX PrincipalPointX principalPointX}
value35 float64 // javascript: double {principalPointY PrincipalPointY principalPointY}
value36 *depth.DistortionCoefficients // javascript: DistortionCoefficients {deprojectionDistortionCoefficients DeprojectionDistortionCoefficients deprojectionDistortionCoefficients}
value37 *depth.DistortionCoefficients // javascript: DistortionCoefficients {projectionDistortionCoefficients ProjectionDistortionCoefficients projectionDistortionCoefficients}
value38 float64 // javascript: double {depthNear DepthNear depthNear}
value39 float64 // javascript: double {depthFar DepthFar depthFar}
value40 *depth.Transformation // javascript: Transformation {depthToVideoTransform DepthToVideoTransform depthToVideoTransform}
value41 string // javascript: DOMString {displaySurface DisplaySurface displaySurface}
value42 bool // javascript: boolean {logicalSurface LogicalSurface logicalSurface}
value43 string // javascript: DOMString {cursor Cursor cursor}
)
value0 = (input.Get("width")).Int()
out.Width = value0
value1 = (input.Get("height")).Int()
out.Height = value1
value2 = (input.Get("aspectRatio")).Float()
out.AspectRatio = value2
value3 = (input.Get("frameRate")).Float()
out.FrameRate = value3
value4 = (input.Get("facingMode")).String()
out.FacingMode = value4
value5 = (input.Get("resizeMode")).String()
out.ResizeMode = value5
value6 = (input.Get("volume")).Float()
out.Volume = value6
value7 = (input.Get("sampleRate")).Int()
out.SampleRate = value7
value8 = (input.Get("sampleSize")).Int()
out.SampleSize = value8
value9 = (input.Get("echoCancellation")).Bool()
out.EchoCancellation = value9
value10 = (input.Get("autoGainControl")).Bool()
out.AutoGainControl = value10
value11 = (input.Get("noiseSuppression")).Bool()
out.NoiseSuppression = value11
value12 = (input.Get("latency")).Float()
out.Latency = value12
value13 = (input.Get("channelCount")).Int()
out.ChannelCount = value13
value14 = (input.Get("deviceId")).String()
out.DeviceId = value14
value15 = (input.Get("groupId")).String()
out.GroupId = value15
value16 = (input.Get("whiteBalanceMode")).String()
out.WhiteBalanceMode = value16
value17 = (input.Get("exposureMode")).String()
out.ExposureMode = value17
value18 = (input.Get("focusMode")).String()
out.FocusMode = value18
__length19 := input.Get("pointsOfInterest").Length()
__array19 := make([]*mediatype.Point2D, __length19, __length19)
for __idx19 := 0; __idx19 < __length19; __idx19++ {
var __seq_out19 *mediatype.Point2D
__seq_in19 := input.Get("pointsOfInterest").Index(__idx19)
__seq_out19 = mediatype.Point2DFromJS(__seq_in19)
__array19[__idx19] = __seq_out19
}
value19 = __array19
out.PointsOfInterest = value19
value20 = (input.Get("exposureCompensation")).Float()
out.ExposureCompensation = value20
value21 = (input.Get("exposureTime")).Float()
out.ExposureTime = value21
value22 = (input.Get("colorTemperature")).Float()
out.ColorTemperature = value22
value23 = (input.Get("iso")).Float()
out.Iso = value23
value24 = (input.Get("brightness")).Float()
out.Brightness = value24
value25 = (input.Get("contrast")).Float()
out.Contrast = value25
value26 = (input.Get("saturation")).Float()
out.Saturation = value26
value27 = (input.Get("sharpness")).Float()
out.Sharpness = value27
value28 = (input.Get("focusDistance")).Float()
out.FocusDistance = value28
value29 = (input.Get("zoom")).Float()
out.Zoom = value29
value30 = (input.Get("torch")).Bool()
out.Torch = value30
value31 = (input.Get("videoKind")).String()
out.VideoKind = value31
value32 = (input.Get("focalLengthX")).Float()
out.FocalLengthX = value32
value33 = (input.Get("focalLengthY")).Float()
out.FocalLengthY = value33
value34 = (input.Get("principalPointX")).Float()
out.PrincipalPointX = value34
value35 = (input.Get("principalPointY")).Float()
out.PrincipalPointY = value35
value36 = depth.DistortionCoefficientsFromJS(input.Get("deprojectionDistortionCoefficients"))
out.DeprojectionDistortionCoefficients = value36
value37 = depth.DistortionCoefficientsFromJS(input.Get("projectionDistortionCoefficients"))
out.ProjectionDistortionCoefficients = value37
value38 = (input.Get("depthNear")).Float()
out.DepthNear = value38
value39 = (input.Get("depthFar")).Float()
out.DepthFar = value39
value40 = depth.TransformationFromJS(input.Get("depthToVideoTransform"))
out.DepthToVideoTransform = value40
value41 = (input.Get("displaySurface")).String()
out.DisplaySurface = value41
value42 = (input.Get("logicalSurface")).Bool()
out.LogicalSurface = value42
value43 = (input.Get("cursor")).String()
out.Cursor = value43
return &out
}
// dictionary: MediaTrackSupportedConstraints
type MediaTrackSupportedConstraints struct {
Width bool
Height bool
AspectRatio bool
FrameRate bool
FacingMode bool
ResizeMode bool
Volume bool
SampleRate bool
SampleSize bool
EchoCancellation bool
AutoGainControl bool
NoiseSuppression bool
Latency bool
ChannelCount bool
DeviceId bool
GroupId bool
WhiteBalanceMode bool
ExposureMode bool
FocusMode bool
PointsOfInterest bool
ExposureCompensation bool
ExposureTime bool
ColorTemperature bool
Iso bool
Brightness bool
Contrast bool
Saturation bool
Sharpness bool
FocusDistance bool
Zoom bool
Torch bool
VideoKind bool
FocalLengthX bool
FocalLengthY bool
PrincipalPointX bool
PrincipalPointY bool
DeprojectionDistortionCoefficients bool
ProjectionDistortionCoefficients bool
DepthNear bool
DepthFar bool
DepthToVideoTransform bool
DisplaySurface bool
LogicalSurface bool
Cursor bool
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *MediaTrackSupportedConstraints) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Width
out.Set("width", value0)
value1 := _this.Height
out.Set("height", value1)
value2 := _this.AspectRatio
out.Set("aspectRatio", value2)
value3 := _this.FrameRate
out.Set("frameRate", value3)
value4 := _this.FacingMode
out.Set("facingMode", value4)
value5 := _this.ResizeMode
out.Set("resizeMode", value5)
value6 := _this.Volume
out.Set("volume", value6)
value7 := _this.SampleRate
out.Set("sampleRate", value7)
value8 := _this.SampleSize
out.Set("sampleSize", value8)
value9 := _this.EchoCancellation
out.Set("echoCancellation", value9)
value10 := _this.AutoGainControl
out.Set("autoGainControl", value10)
value11 := _this.NoiseSuppression
out.Set("noiseSuppression", value11)
value12 := _this.Latency
out.Set("latency", value12)
value13 := _this.ChannelCount
out.Set("channelCount", value13)
value14 := _this.DeviceId
out.Set("deviceId", value14)
value15 := _this.GroupId
out.Set("groupId", value15)
value16 := _this.WhiteBalanceMode
out.Set("whiteBalanceMode", value16)
value17 := _this.ExposureMode
out.Set("exposureMode", value17)
value18 := _this.FocusMode
out.Set("focusMode", value18)
value19 := _this.PointsOfInterest
out.Set("pointsOfInterest", value19)
value20 := _this.ExposureCompensation
out.Set("exposureCompensation", value20)
value21 := _this.ExposureTime
out.Set("exposureTime", value21)
value22 := _this.ColorTemperature
out.Set("colorTemperature", value22)
value23 := _this.Iso
out.Set("iso", value23)
value24 := _this.Brightness
out.Set("brightness", value24)
value25 := _this.Contrast
out.Set("contrast", value25)
value26 := _this.Saturation
out.Set("saturation", value26)
value27 := _this.Sharpness
out.Set("sharpness", value27)
value28 := _this.FocusDistance
out.Set("focusDistance", value28)
value29 := _this.Zoom
out.Set("zoom", value29)
value30 := _this.Torch
out.Set("torch", value30)
value31 := _this.VideoKind
out.Set("videoKind", value31)
value32 := _this.FocalLengthX
out.Set("focalLengthX", value32)
value33 := _this.FocalLengthY
out.Set("focalLengthY", value33)
value34 := _this.PrincipalPointX
out.Set("principalPointX", value34)
value35 := _this.PrincipalPointY
out.Set("principalPointY", value35)
value36 := _this.DeprojectionDistortionCoefficients
out.Set("deprojectionDistortionCoefficients", value36)
value37 := _this.ProjectionDistortionCoefficients
out.Set("projectionDistortionCoefficients", value37)
value38 := _this.DepthNear
out.Set("depthNear", value38)
value39 := _this.DepthFar
out.Set("depthFar", value39)
value40 := _this.DepthToVideoTransform
out.Set("depthToVideoTransform", value40)
value41 := _this.DisplaySurface
out.Set("displaySurface", value41)
value42 := _this.LogicalSurface
out.Set("logicalSurface", value42)
value43 := _this.Cursor
out.Set("cursor", value43)
return out
}
// MediaTrackSupportedConstraintsFromJS is allocating a new
// MediaTrackSupportedConstraints object and copy all values from
// input javascript object
func MediaTrackSupportedConstraintsFromJS(value js.Wrapper) *MediaTrackSupportedConstraints {
input := value.JSValue()
var out MediaTrackSupportedConstraints
var (
value0 bool // javascript: boolean {width Width width}
value1 bool // javascript: boolean {height Height height}
value2 bool // javascript: boolean {aspectRatio AspectRatio aspectRatio}
value3 bool // javascript: boolean {frameRate FrameRate frameRate}
value4 bool // javascript: boolean {facingMode FacingMode facingMode}
value5 bool // javascript: boolean {resizeMode ResizeMode resizeMode}
value6 bool // javascript: boolean {volume Volume volume}
value7 bool // javascript: boolean {sampleRate SampleRate sampleRate}
value8 bool // javascript: boolean {sampleSize SampleSize sampleSize}
value9 bool // javascript: boolean {echoCancellation EchoCancellation echoCancellation}
value10 bool // javascript: boolean {autoGainControl AutoGainControl autoGainControl}
value11 bool // javascript: boolean {noiseSuppression NoiseSuppression noiseSuppression}
value12 bool // javascript: boolean {latency Latency latency}
value13 bool // javascript: boolean {channelCount ChannelCount channelCount}
value14 bool // javascript: boolean {deviceId DeviceId deviceId}
value15 bool // javascript: boolean {groupId GroupId groupId}
value16 bool // javascript: boolean {whiteBalanceMode WhiteBalanceMode whiteBalanceMode}
value17 bool // javascript: boolean {exposureMode ExposureMode exposureMode}
value18 bool // javascript: boolean {focusMode FocusMode focusMode}
value19 bool // javascript: boolean {pointsOfInterest PointsOfInterest pointsOfInterest}
value20 bool // javascript: boolean {exposureCompensation ExposureCompensation exposureCompensation}
value21 bool // javascript: boolean {exposureTime ExposureTime exposureTime}
value22 bool // javascript: boolean {colorTemperature ColorTemperature colorTemperature}
value23 bool // javascript: boolean {iso Iso iso}
value24 bool // javascript: boolean {brightness Brightness brightness}
value25 bool // javascript: boolean {contrast Contrast contrast}
value26 bool // javascript: boolean {saturation Saturation saturation}
value27 bool // javascript: boolean {sharpness Sharpness sharpness}
value28 bool // javascript: boolean {focusDistance FocusDistance focusDistance}
value29 bool // javascript: boolean {zoom Zoom zoom}
value30 bool // javascript: boolean {torch Torch torch}
value31 bool // javascript: boolean {videoKind VideoKind videoKind}
value32 bool // javascript: boolean {focalLengthX FocalLengthX focalLengthX}
value33 bool // javascript: boolean {focalLengthY FocalLengthY focalLengthY}
value34 bool // javascript: boolean {principalPointX PrincipalPointX principalPointX}
value35 bool // javascript: boolean {principalPointY PrincipalPointY principalPointY}
value36 bool // javascript: boolean {deprojectionDistortionCoefficients DeprojectionDistortionCoefficients deprojectionDistortionCoefficients}
value37 bool // javascript: boolean {projectionDistortionCoefficients ProjectionDistortionCoefficients projectionDistortionCoefficients}
value38 bool // javascript: boolean {depthNear DepthNear depthNear}
value39 bool // javascript: boolean {depthFar DepthFar depthFar}
value40 bool // javascript: boolean {depthToVideoTransform DepthToVideoTransform depthToVideoTransform}
value41 bool // javascript: boolean {displaySurface DisplaySurface displaySurface}
value42 bool // javascript: boolean {logicalSurface LogicalSurface logicalSurface}
value43 bool // javascript: boolean {cursor Cursor cursor}
)
value0 = (input.Get("width")).Bool()
out.Width = value0
value1 = (input.Get("height")).Bool()
out.Height = value1
value2 = (input.Get("aspectRatio")).Bool()
out.AspectRatio = value2
value3 = (input.Get("frameRate")).Bool()
out.FrameRate = value3
value4 = (input.Get("facingMode")).Bool()
out.FacingMode = value4
value5 = (input.Get("resizeMode")).Bool()
out.ResizeMode = value5
value6 = (input.Get("volume")).Bool()
out.Volume = value6
value7 = (input.Get("sampleRate")).Bool()
out.SampleRate = value7
value8 = (input.Get("sampleSize")).Bool()
out.SampleSize = value8
value9 = (input.Get("echoCancellation")).Bool()
out.EchoCancellation = value9
value10 = (input.Get("autoGainControl")).Bool()
out.AutoGainControl = value10
value11 = (input.Get("noiseSuppression")).Bool()
out.NoiseSuppression = value11
value12 = (input.Get("latency")).Bool()
out.Latency = value12
value13 = (input.Get("channelCount")).Bool()
out.ChannelCount = value13
value14 = (input.Get("deviceId")).Bool()
out.DeviceId = value14
value15 = (input.Get("groupId")).Bool()
out.GroupId = value15
value16 = (input.Get("whiteBalanceMode")).Bool()
out.WhiteBalanceMode = value16
value17 = (input.Get("exposureMode")).Bool()
out.ExposureMode = value17
value18 = (input.Get("focusMode")).Bool()
out.FocusMode = value18
value19 = (input.Get("pointsOfInterest")).Bool()
out.PointsOfInterest = value19
value20 = (input.Get("exposureCompensation")).Bool()
out.ExposureCompensation = value20
value21 = (input.Get("exposureTime")).Bool()
out.ExposureTime = value21
value22 = (input.Get("colorTemperature")).Bool()
out.ColorTemperature = value22
value23 = (input.Get("iso")).Bool()
out.Iso = value23
value24 = (input.Get("brightness")).Bool()
out.Brightness = value24
value25 = (input.Get("contrast")).Bool()
out.Contrast = value25
value26 = (input.Get("saturation")).Bool()
out.Saturation = value26
value27 = (input.Get("sharpness")).Bool()
out.Sharpness = value27
value28 = (input.Get("focusDistance")).Bool()
out.FocusDistance = value28
value29 = (input.Get("zoom")).Bool()
out.Zoom = value29
value30 = (input.Get("torch")).Bool()
out.Torch = value30
value31 = (input.Get("videoKind")).Bool()
out.VideoKind = value31
value32 = (input.Get("focalLengthX")).Bool()
out.FocalLengthX = value32
value33 = (input.Get("focalLengthY")).Bool()
out.FocalLengthY = value33
value34 = (input.Get("principalPointX")).Bool()
out.PrincipalPointX = value34
value35 = (input.Get("principalPointY")).Bool()
out.PrincipalPointY = value35
value36 = (input.Get("deprojectionDistortionCoefficients")).Bool()
out.DeprojectionDistortionCoefficients = value36
value37 = (input.Get("projectionDistortionCoefficients")).Bool()
out.ProjectionDistortionCoefficients = value37
value38 = (input.Get("depthNear")).Bool()
out.DepthNear = value38
value39 = (input.Get("depthFar")).Bool()
out.DepthFar = value39
value40 = (input.Get("depthToVideoTransform")).Bool()
out.DepthToVideoTransform = value40
value41 = (input.Get("displaySurface")).Bool()
out.DisplaySurface = value41
value42 = (input.Get("logicalSurface")).Bool()
out.LogicalSurface = value42
value43 = (input.Get("cursor")).Bool()
out.Cursor = value43
return &out
}
// dictionary: OverconstrainedErrorEventInit
type OverconstrainedErrorEventInit struct {
Bubbles bool
Cancelable bool
Composed bool
Error *patch.OverconstrainedError
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *OverconstrainedErrorEventInit) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Bubbles
out.Set("bubbles", value0)
value1 := _this.Cancelable
out.Set("cancelable", value1)
value2 := _this.Composed
out.Set("composed", value2)
value3 := _this.Error.JSValue()
out.Set("error", value3)
return out
}
// OverconstrainedErrorEventInitFromJS is allocating a new
// OverconstrainedErrorEventInit object and copy all values from
// input javascript object
func OverconstrainedErrorEventInitFromJS(value js.Wrapper) *OverconstrainedErrorEventInit {
input := value.JSValue()
var out OverconstrainedErrorEventInit
var (
value0 bool // javascript: boolean {bubbles Bubbles bubbles}
value1 bool // javascript: boolean {cancelable Cancelable cancelable}
value2 bool // javascript: boolean {composed Composed composed}
value3 *patch.OverconstrainedError // javascript: OverconstrainedError {error Error _error}
)
value0 = (input.Get("bubbles")).Bool()
out.Bubbles = value0
value1 = (input.Get("cancelable")).Bool()
out.Cancelable = value1
value2 = (input.Get("composed")).Bool()
out.Composed = value2
if input.Get("error").Type() != js.TypeNull && input.Get("error").Type() != js.TypeUndefined {
value3 = patch.OverconstrainedErrorFromJS(input.Get("error"))
}
out.Error = value3
return &out
}
// dictionary: Settings
type Settings struct {
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *Settings) JSValue() js.Value {
out := js.Global().Get("Object").New()
return out
}
// SettingsFromJS is allocating a new
// Settings object and copy all values from
// input javascript object
func SettingsFromJS(value js.Wrapper) *Settings {
var out Settings
var ()
return &out
}
// dictionary: ULongRange
type ULongRange struct {
Max uint
Min uint
}
// JSValue is allocating a new javasript object and copy
// all values
func (_this *ULongRange) JSValue() js.Value {
out := js.Global().Get("Object").New()
value0 := _this.Max
out.Set("max", value0)
value1 := _this.Min
out.Set("min", value1)
return out
}
// ULongRangeFromJS is allocating a new
// ULongRange object and copy all values from
// input javascript object
func ULongRangeFromJS(value js.Wrapper) *ULongRange {
input := value.JSValue()
var out ULongRange
var (
value0 uint // javascript: unsigned long {max Max max}
value1 uint // javascript: unsigned long {min Min min}
)
value0 = (uint)((input.Get("max")).Int())
out.Max = value0
value1 = (uint)((input.Get("min")).Int())
out.Min = value1
return &out
}
// class: ConstrainablePattern
type ConstrainablePattern struct {
// Value_JS holds a reference to a javascript value
Value_JS js.Value
}
func (_this *ConstrainablePattern) JSValue() js.Value {
return _this.Value_JS
}
// ConstrainablePatternFromJS is casting a js.Wrapper into ConstrainablePattern.
func ConstrainablePatternFromJS(value js.Wrapper) *ConstrainablePattern {
input := value.JSValue()
if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &ConstrainablePattern{}
ret.Value_JS = input
return ret
}
// OnOverConstrained returning attribute 'onoverconstrained' with
// type domcore.EventHandler (idl: EventHandlerNonNull).
func (_this *ConstrainablePattern) OnOverConstrained() domcore.EventHandlerFunc {
var ret domcore.EventHandlerFunc
value := _this.Value_JS.Get("onoverconstrained")
if value.Type() != js.TypeNull && value.Type() != js.TypeUndefined {
ret = domcore.EventHandlerFromJS(value)
}
return ret
}
// event attribute: domcore.Event
func eventFuncConstrainablePattern_domcore_Event(listener func(event *domcore.Event, target *ConstrainablePattern)) js.Func {
fn := func(this js.Value, args []js.Value) interface{} {
var ret *domcore.Event
value := args[0]
incoming := value.Get("target")
ret = domcore.EventFromJS(value)
src := ConstrainablePatternFromJS(incoming)
listener(ret, src)
return js.Undefined
}
return js.FuncOf(fn)
}
// AddOverConstrained is adding doing AddEventListener for 'OverConstrained' on target.
// This method is returning allocated javascript function that need to be released.
func (_this *ConstrainablePattern) AddEventOverConstrained(listener func(event *domcore.Event, currentTarget *ConstrainablePattern)) js.Func {
cb := eventFuncConstrainablePattern_domcore_Event(listener)
_this.Value_JS.Call("addEventListener", "overconstrained", cb)
return cb
}
// SetOnOverConstrained is assigning a function to 'onoverconstrained'. This
// This method is returning allocated javascript function that need to be released.
func (_this *ConstrainablePattern) SetOnOverConstrained(listener func(event *domcore.Event, currentTarget *ConstrainablePattern)) js.Func {
cb := eventFuncConstrainablePattern_domcore_Event(listener)
_this.Value_JS.Set("onoverconstrained", cb)
return cb
}
func (_this *ConstrainablePattern) GetCapabilities() (_result *Capabilities) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("getCapabilities", _args[0:_end]...)
var (
_converted *Capabilities // javascript: Capabilities _what_return_name
)
_converted = CapabilitiesFromJS(_returned)
_result = _converted
return
}
func (_this *ConstrainablePattern) GetConstraints() (_result *Constraints) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("getConstraints", _args[0:_end]...)
var (
_converted *Constraints // javascript: Constraints _what_return_name
)
_converted = ConstraintsFromJS(_returned)
_result = _converted
return
}
func (_this *ConstrainablePattern) GetSettings() (_result *Settings) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("getSettings", _args[0:_end]...)
var (
_converted *Settings // javascript: Settings _what_return_name
)
_converted = SettingsFromJS(_returned)
_result = _converted
return
}
func (_this *ConstrainablePattern) ApplyConstraints(constraints *Constraints) (_result *javascript.PromiseVoid) {
var (
_args [1]interface{}
_end int
)
if constraints != nil {
_p0 := constraints.JSValue()
_args[0] = _p0
_end++
}
_returned := _this.Value_JS.Call("applyConstraints", _args[0:_end]...)
var (
_converted *javascript.PromiseVoid // javascript: PromiseVoid _what_return_name
)
_converted = javascript.PromiseVoidFromJS(_returned)
_result = _converted
return
}
// class: InputDeviceInfo
type InputDeviceInfo struct {
MediaDeviceInfo
}
// InputDeviceInfoFromJS is casting a js.Wrapper into InputDeviceInfo.
func InputDeviceInfoFromJS(value js.Wrapper) *InputDeviceInfo {
input := value.JSValue()
if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &InputDeviceInfo{}
ret.Value_JS = input
return ret
}
func (_this *InputDeviceInfo) GetCapabilities() (_result *MediaTrackCapabilities) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("getCapabilities", _args[0:_end]...)
var (
_converted *MediaTrackCapabilities // javascript: MediaTrackCapabilities _what_return_name
)
_converted = MediaTrackCapabilitiesFromJS(_returned)
_result = _converted
return
}
// class: MediaDeviceInfo
type MediaDeviceInfo struct {
// Value_JS holds a reference to a javascript value
Value_JS js.Value
}
func (_this *MediaDeviceInfo) JSValue() js.Value {
return _this.Value_JS
}
// MediaDeviceInfoFromJS is casting a js.Wrapper into MediaDeviceInfo.
func MediaDeviceInfoFromJS(value js.Wrapper) *MediaDeviceInfo {
input := value.JSValue()
if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &MediaDeviceInfo{}
ret.Value_JS = input
return ret
}
// DeviceId returning attribute 'deviceId' with
// type string (idl: DOMString).
func (_this *MediaDeviceInfo) DeviceId() string {
var ret string
value := _this.Value_JS.Get("deviceId")
ret = (value).String()
return ret
}
// Kind returning attribute 'kind' with
// type MediaDeviceKind (idl: MediaDeviceKind).
func (_this *MediaDeviceInfo) Kind() MediaDeviceKind {
var ret MediaDeviceKind
value := _this.Value_JS.Get("kind")
ret = MediaDeviceKindFromJS(value)
return ret
}
// Label returning attribute 'label' with
// type string (idl: DOMString).
func (_this *MediaDeviceInfo) Label() string {
var ret string
value := _this.Value_JS.Get("label")
ret = (value).String()
return ret
}
// GroupId returning attribute 'groupId' with
// type string (idl: DOMString).
func (_this *MediaDeviceInfo) GroupId() string {
var ret string
value := _this.Value_JS.Get("groupId")
ret = (value).String()
return ret
}
func (_this *MediaDeviceInfo) ToJSON() (_result *javascript.Object) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("toJSON", _args[0:_end]...)
var (
_converted *javascript.Object // javascript: object _what_return_name
)
_converted = javascript.ObjectFromJS(_returned)
_result = _converted
return
}
// class: MediaDevices
type MediaDevices struct {
domcore.EventTarget
}
// MediaDevicesFromJS is casting a js.Wrapper into MediaDevices.
func MediaDevicesFromJS(value js.Wrapper) *MediaDevices {
input := value.JSValue()
if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &MediaDevices{}
ret.Value_JS = input
return ret
}
// OnDeviceChange returning attribute 'ondevicechange' with
// type domcore.EventHandler (idl: EventHandlerNonNull).
func (_this *MediaDevices) OnDeviceChange() domcore.EventHandlerFunc {
var ret domcore.EventHandlerFunc
value := _this.Value_JS.Get("ondevicechange")
if value.Type() != js.TypeNull && value.Type() != js.TypeUndefined {
ret = domcore.EventHandlerFromJS(value)
}
return ret
}
// event attribute: domcore.Event
func eventFuncMediaDevices_domcore_Event(listener func(event *domcore.Event, target *MediaDevices)) js.Func {
fn := func(this js.Value, args []js.Value) interface{} {
var ret *domcore.Event
value := args[0]
incoming := value.Get("target")
ret = domcore.EventFromJS(value)
src := MediaDevicesFromJS(incoming)
listener(ret, src)
return js.Undefined
}
return js.FuncOf(fn)
}
// AddDeviceChange is adding doing AddEventListener for 'DeviceChange' on target.
// This method is returning allocated javascript function that need to be released.
func (_this *MediaDevices) AddEventDeviceChange(listener func(event *domcore.Event, currentTarget *MediaDevices)) js.Func {
cb := eventFuncMediaDevices_domcore_Event(listener)
_this.Value_JS.Call("addEventListener", "devicechange", cb)
return cb
}
// SetOnDeviceChange is assigning a function to 'ondevicechange'. This
// This method is returning allocated javascript function that need to be released.
func (_this *MediaDevices) SetOnDeviceChange(listener func(event *domcore.Event, currentTarget *MediaDevices)) js.Func {
cb := eventFuncMediaDevices_domcore_Event(listener)
_this.Value_JS.Set("ondevicechange", cb)
return cb
}
func (_this *MediaDevices) EnumerateDevices() (_result *PromiseSequenceMediaDeviceInfo) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("enumerateDevices", _args[0:_end]...)
var (
_converted *PromiseSequenceMediaDeviceInfo // javascript: Promise _what_return_name
)
_converted = PromiseSequenceMediaDeviceInfoFromJS(_returned)
_result = _converted
return
}
func (_this *MediaDevices) GetSupportedConstraints() (_result *MediaTrackSupportedConstraints) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("getSupportedConstraints", _args[0:_end]...)
var (
_converted *MediaTrackSupportedConstraints // javascript: MediaTrackSupportedConstraints _what_return_name
)
_converted = MediaTrackSupportedConstraintsFromJS(_returned)
_result = _converted
return
}
func (_this *MediaDevices) GetUserMedia(constraints *MediaStreamConstraints) (_result *PromiseMediaStream) {
var (
_args [1]interface{}
_end int
)
if constraints != nil {
_p0 := constraints.JSValue()
_args[0] = _p0
_end++
}
_returned := _this.Value_JS.Call("getUserMedia", _args[0:_end]...)
var (
_converted *PromiseMediaStream // javascript: Promise _what_return_name
)
_converted = PromiseMediaStreamFromJS(_returned)
_result = _converted
return
}
func (_this *MediaDevices) GetDisplayMedia(constraints *screen.DisplayMediaStreamConstraints) (_result *PromiseMediaStream) {
var (
_args [1]interface{}
_end int
)
if constraints != nil {
_p0 := constraints.JSValue()
_args[0] = _p0
_end++
}
_returned := _this.Value_JS.Call("getDisplayMedia", _args[0:_end]...)
var (
_converted *PromiseMediaStream // javascript: Promise _what_return_name
)
_converted = PromiseMediaStreamFromJS(_returned)
_result = _converted
return
}
// class: MediaStream
type MediaStream struct {
domcore.EventTarget
}
// MediaStreamFromJS is casting a js.Wrapper into MediaStream.
func MediaStreamFromJS(value js.Wrapper) *MediaStream {
input := value.JSValue()
if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &MediaStream{}
ret.Value_JS = input
return ret
}
func NewMediaStream(tracks []*MediaStreamTrack) (_result *MediaStream) {
_klass := js.Global().Get("MediaStream")
var (
_args [1]interface{}
_end int
)
_p0 := js.Global().Get("Array").New(len(tracks))
for __idx0, __seq_in0 := range tracks {
__seq_out0 := __seq_in0.JSValue()
_p0.SetIndex(__idx0, __seq_out0)
}
_args[0] = _p0
_end++
_returned := _klass.New(_args[0:_end]...)
var (
_converted *MediaStream // javascript: MediaStream _what_return_name
)
_converted = MediaStreamFromJS(_returned)
_result = _converted
return
}
// Id returning attribute 'id' with
// type string (idl: DOMString).
func (_this *MediaStream) Id() string {
var ret string
value := _this.Value_JS.Get("id")
ret = (value).String()
return ret
}
// Active returning attribute 'active' with
// type bool (idl: boolean).
func (_this *MediaStream) Active() bool {
var ret bool
value := _this.Value_JS.Get("active")
ret = (value).Bool()
return ret
}
// OnAddTrack returning attribute 'onaddtrack' with
// type domcore.EventHandler (idl: EventHandlerNonNull).
func (_this *MediaStream) OnAddTrack() domcore.EventHandlerFunc {
var ret domcore.EventHandlerFunc
value := _this.Value_JS.Get("onaddtrack")
if value.Type() != js.TypeNull && value.Type() != js.TypeUndefined {
ret = domcore.EventHandlerFromJS(value)
}
return ret
}
// OnRemoveTrack returning attribute 'onremovetrack' with
// type domcore.EventHandler (idl: EventHandlerNonNull).
func (_this *MediaStream) OnRemoveTrack() domcore.EventHandlerFunc {
var ret domcore.EventHandlerFunc
value := _this.Value_JS.Get("onremovetrack")
if value.Type() != js.TypeNull && value.Type() != js.TypeUndefined {
ret = domcore.EventHandlerFromJS(value)
}
return ret
}
// event attribute: MediaStreamTrackEvent
func eventFuncMediaStream_MediaStreamTrackEvent(listener func(event *MediaStreamTrackEvent, target *MediaStream)) js.Func {
fn := func(this js.Value, args []js.Value) interface{} {
var ret *MediaStreamTrackEvent
value := args[0]
incoming := value.Get("target")
ret = MediaStreamTrackEventFromJS(value)
src := MediaStreamFromJS(incoming)
listener(ret, src)
return js.Undefined
}
return js.FuncOf(fn)
}
// AddAddTrack is adding doing AddEventListener for 'AddTrack' on target.
// This method is returning allocated javascript function that need to be released.
func (_this *MediaStream) AddEventAddTrack(listener func(event *MediaStreamTrackEvent, currentTarget *MediaStream)) js.Func {
cb := eventFuncMediaStream_MediaStreamTrackEvent(listener)
_this.Value_JS.Call("addEventListener", "addtrack", cb)
return cb
}
// SetOnAddTrack is assigning a function to 'onaddtrack'. This
// This method is returning allocated javascript function that need to be released.
func (_this *MediaStream) SetOnAddTrack(listener func(event *MediaStreamTrackEvent, currentTarget *MediaStream)) js.Func {
cb := eventFuncMediaStream_MediaStreamTrackEvent(listener)
_this.Value_JS.Set("onaddtrack", cb)
return cb
}
// AddRemoveTrack is adding doing AddEventListener for 'RemoveTrack' on target.
// This method is returning allocated javascript function that need to be released.
func (_this *MediaStream) AddEventRemoveTrack(listener func(event *MediaStreamTrackEvent, currentTarget *MediaStream)) js.Func {
cb := eventFuncMediaStream_MediaStreamTrackEvent(listener)
_this.Value_JS.Call("addEventListener", "removetrack", cb)
return cb
}
// SetOnRemoveTrack is assigning a function to 'onremovetrack'. This
// This method is returning allocated javascript function that need to be released.
func (_this *MediaStream) SetOnRemoveTrack(listener func(event *MediaStreamTrackEvent, currentTarget *MediaStream)) js.Func {
cb := eventFuncMediaStream_MediaStreamTrackEvent(listener)
_this.Value_JS.Set("onremovetrack", cb)
return cb
}
func (_this *MediaStream) GetAudioTracks() (_result []*MediaStreamTrack) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("getAudioTracks", _args[0:_end]...)
var (
_converted []*MediaStreamTrack // javascript: sequence<MediaStreamTrack> _what_return_name
)
__length0 := _returned.Length()
__array0 := make([]*MediaStreamTrack, __length0, __length0)
for __idx0 := 0; __idx0 < __length0; __idx0++ {
var __seq_out0 *MediaStreamTrack
__seq_in0 := _returned.Index(__idx0)
__seq_out0 = MediaStreamTrackFromJS(__seq_in0)
__array0[__idx0] = __seq_out0
}
_converted = __array0
_result = _converted
return
}
func (_this *MediaStream) GetVideoTracks() (_result []*MediaStreamTrack) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("getVideoTracks", _args[0:_end]...)
var (
_converted []*MediaStreamTrack // javascript: sequence<MediaStreamTrack> _what_return_name
)
__length0 := _returned.Length()
__array0 := make([]*MediaStreamTrack, __length0, __length0)
for __idx0 := 0; __idx0 < __length0; __idx0++ {
var __seq_out0 *MediaStreamTrack
__seq_in0 := _returned.Index(__idx0)
__seq_out0 = MediaStreamTrackFromJS(__seq_in0)
__array0[__idx0] = __seq_out0
}
_converted = __array0
_result = _converted
return
}
func (_this *MediaStream) GetTracks() (_result []*MediaStreamTrack) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("getTracks", _args[0:_end]...)
var (
_converted []*MediaStreamTrack // javascript: sequence<MediaStreamTrack> _what_return_name
)
__length0 := _returned.Length()
__array0 := make([]*MediaStreamTrack, __length0, __length0)
for __idx0 := 0; __idx0 < __length0; __idx0++ {
var __seq_out0 *MediaStreamTrack
__seq_in0 := _returned.Index(__idx0)
__seq_out0 = MediaStreamTrackFromJS(__seq_in0)
__array0[__idx0] = __seq_out0
}
_converted = __array0
_result = _converted
return
}
func (_this *MediaStream) GetTrackById(trackId string) (_result *MediaStreamTrack) {
var (
_args [1]interface{}
_end int
)
_p0 := trackId
_args[0] = _p0
_end++
_returned := _this.Value_JS.Call("getTrackById", _args[0:_end]...)
var (
_converted *MediaStreamTrack // javascript: MediaStreamTrack _what_return_name
)
if _returned.Type() != js.TypeNull && _returned.Type() != js.TypeUndefined {
_converted = MediaStreamTrackFromJS(_returned)
}
_result = _converted
return
}
func (_this *MediaStream) AddTrack(track *MediaStreamTrack) {
var (
_args [1]interface{}
_end int
)
_p0 := track.JSValue()
_args[0] = _p0
_end++
_this.Value_JS.Call("addTrack", _args[0:_end]...)
return
}
func (_this *MediaStream) RemoveTrack(track *MediaStreamTrack) {
var (
_args [1]interface{}
_end int
)
_p0 := track.JSValue()
_args[0] = _p0
_end++
_this.Value_JS.Call("removeTrack", _args[0:_end]...)
return
}
func (_this *MediaStream) Clone() (_result *MediaStream) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("clone", _args[0:_end]...)
var (
_converted *MediaStream // javascript: MediaStream _what_return_name
)
_converted = MediaStreamFromJS(_returned)
_result = _converted
return
}
// class: MediaStreamTrack
type MediaStreamTrack struct {
domcore.EventTarget
}
// MediaStreamTrackFromJS is casting a js.Wrapper into MediaStreamTrack.
func MediaStreamTrackFromJS(value js.Wrapper) *MediaStreamTrack {
input := value.JSValue()
if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &MediaStreamTrack{}
ret.Value_JS = input
return ret
}
// Kind returning attribute 'kind' with
// type string (idl: DOMString).
func (_this *MediaStreamTrack) Kind() string {
var ret string
value := _this.Value_JS.Get("kind")
ret = (value).String()
return ret
}
// Id returning attribute 'id' with
// type string (idl: DOMString).
func (_this *MediaStreamTrack) Id() string {
var ret string
value := _this.Value_JS.Get("id")
ret = (value).String()
return ret
}
// Label returning attribute 'label' with
// type string (idl: DOMString).
func (_this *MediaStreamTrack) Label() string {
var ret string
value := _this.Value_JS.Get("label")
ret = (value).String()
return ret
}
// Enabled returning attribute 'enabled' with
// type bool (idl: boolean).
func (_this *MediaStreamTrack) Enabled() bool {
var ret bool
value := _this.Value_JS.Get("enabled")
ret = (value).Bool()
return ret
}
// SetEnabled setting attribute 'enabled' with
// type bool (idl: boolean).
func (_this *MediaStreamTrack) SetEnabled(value bool) {
input := value
_this.Value_JS.Set("enabled", input)
}
// Muted returning attribute 'muted' with
// type bool (idl: boolean).
func (_this *MediaStreamTrack) Muted() bool {
var ret bool
value := _this.Value_JS.Get("muted")
ret = (value).Bool()
return ret
}
// OnMute returning attribute 'onmute' with
// type domcore.EventHandler (idl: EventHandlerNonNull).
func (_this *MediaStreamTrack) OnMute() domcore.EventHandlerFunc {
var ret domcore.EventHandlerFunc
value := _this.Value_JS.Get("onmute")
if value.Type() != js.TypeNull && value.Type() != js.TypeUndefined {
ret = domcore.EventHandlerFromJS(value)
}
return ret
}
// OnUnmute returning attribute 'onunmute' with
// type domcore.EventHandler (idl: EventHandlerNonNull).
func (_this *MediaStreamTrack) OnUnmute() domcore.EventHandlerFunc {
var ret domcore.EventHandlerFunc
value := _this.Value_JS.Get("onunmute")
if value.Type() != js.TypeNull && value.Type() != js.TypeUndefined {
ret = domcore.EventHandlerFromJS(value)
}
return ret
}
// ReadyState returning attribute 'readyState' with
// type MediaStreamTrackState (idl: MediaStreamTrackState).
func (_this *MediaStreamTrack) ReadyState() MediaStreamTrackState {
var ret MediaStreamTrackState
value := _this.Value_JS.Get("readyState")
ret = MediaStreamTrackStateFromJS(value)
return ret
}
// OnEnded returning attribute 'onended' with
// type domcore.EventHandler (idl: EventHandlerNonNull).
func (_this *MediaStreamTrack) OnEnded() domcore.EventHandlerFunc {
var ret domcore.EventHandlerFunc
value := _this.Value_JS.Get("onended")
if value.Type() != js.TypeNull && value.Type() != js.TypeUndefined {
ret = domcore.EventHandlerFromJS(value)
}
return ret
}
// OnOverConstrained returning attribute 'onoverconstrained' with
// type domcore.EventHandler (idl: EventHandlerNonNull).
func (_this *MediaStreamTrack) OnOverConstrained() domcore.EventHandlerFunc {
var ret domcore.EventHandlerFunc
value := _this.Value_JS.Get("onoverconstrained")
if value.Type() != js.TypeNull && value.Type() != js.TypeUndefined {
ret = domcore.EventHandlerFromJS(value)
}
return ret
}
// ContentHint returning attribute 'contentHint' with
// type string (idl: DOMString).
func (_this *MediaStreamTrack) ContentHint() string {
var ret string
value := _this.Value_JS.Get("contentHint")
ret = (value).String()
return ret
}
// SetContentHint setting attribute 'contentHint' with
// type string (idl: DOMString).
func (_this *MediaStreamTrack) SetContentHint(value string) {
input := value
_this.Value_JS.Set("contentHint", input)
}
// event attribute: domcore.Event
func eventFuncMediaStreamTrack_domcore_Event(listener func(event *domcore.Event, target *MediaStreamTrack)) js.Func {
fn := func(this js.Value, args []js.Value) interface{} {
var ret *domcore.Event
value := args[0]
incoming := value.Get("target")
ret = domcore.EventFromJS(value)
src := MediaStreamTrackFromJS(incoming)
listener(ret, src)
return js.Undefined
}
return js.FuncOf(fn)
}
// AddEnded is adding doing AddEventListener for 'Ended' on target.
// This method is returning allocated javascript function that need to be released.
func (_this *MediaStreamTrack) AddEventEnded(listener func(event *domcore.Event, currentTarget *MediaStreamTrack)) js.Func {
cb := eventFuncMediaStreamTrack_domcore_Event(listener)
_this.Value_JS.Call("addEventListener", "ended", cb)
return cb
}
// SetOnEnded is assigning a function to 'onended'. This
// This method is returning allocated javascript function that need to be released.
func (_this *MediaStreamTrack) SetOnEnded(listener func(event *domcore.Event, currentTarget *MediaStreamTrack)) js.Func {
cb := eventFuncMediaStreamTrack_domcore_Event(listener)
_this.Value_JS.Set("onended", cb)
return cb
}
// AddMute is adding doing AddEventListener for 'Mute' on target.
// This method is returning allocated javascript function that need to be released.
func (_this *MediaStreamTrack) AddEventMute(listener func(event *domcore.Event, currentTarget *MediaStreamTrack)) js.Func {
cb := eventFuncMediaStreamTrack_domcore_Event(listener)
_this.Value_JS.Call("addEventListener", "mute", cb)
return cb
}
// SetOnMute is assigning a function to 'onmute'. This
// This method is returning allocated javascript function that need to be released.
func (_this *MediaStreamTrack) SetOnMute(listener func(event *domcore.Event, currentTarget *MediaStreamTrack)) js.Func {
cb := eventFuncMediaStreamTrack_domcore_Event(listener)
_this.Value_JS.Set("onmute", cb)
return cb
}
// AddOverConstrained is adding doing AddEventListener for 'OverConstrained' on target.
// This method is returning allocated javascript function that need to be released.
func (_this *MediaStreamTrack) AddEventOverConstrained(listener func(event *domcore.Event, currentTarget *MediaStreamTrack)) js.Func {
cb := eventFuncMediaStreamTrack_domcore_Event(listener)
_this.Value_JS.Call("addEventListener", "overconstrained", cb)
return cb
}
// SetOnOverConstrained is assigning a function to 'onoverconstrained'. This
// This method is returning allocated javascript function that need to be released.
func (_this *MediaStreamTrack) SetOnOverConstrained(listener func(event *domcore.Event, currentTarget *MediaStreamTrack)) js.Func {
cb := eventFuncMediaStreamTrack_domcore_Event(listener)
_this.Value_JS.Set("onoverconstrained", cb)
return cb
}
// AddUnmute is adding doing AddEventListener for 'Unmute' on target.
// This method is returning allocated javascript function that need to be released.
func (_this *MediaStreamTrack) AddEventUnmute(listener func(event *domcore.Event, currentTarget *MediaStreamTrack)) js.Func {
cb := eventFuncMediaStreamTrack_domcore_Event(listener)
_this.Value_JS.Call("addEventListener", "unmute", cb)
return cb
}
// SetOnUnmute is assigning a function to 'onunmute'. This
// This method is returning allocated javascript function that need to be released.
func (_this *MediaStreamTrack) SetOnUnmute(listener func(event *domcore.Event, currentTarget *MediaStreamTrack)) js.Func {
cb := eventFuncMediaStreamTrack_domcore_Event(listener)
_this.Value_JS.Set("onunmute", cb)
return cb
}
func (_this *MediaStreamTrack) Clone() (_result *MediaStreamTrack) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("clone", _args[0:_end]...)
var (
_converted *MediaStreamTrack // javascript: MediaStreamTrack _what_return_name
)
_converted = MediaStreamTrackFromJS(_returned)
_result = _converted
return
}
func (_this *MediaStreamTrack) Stop() {
var (
_args [0]interface{}
_end int
)
_this.Value_JS.Call("stop", _args[0:_end]...)
return
}
func (_this *MediaStreamTrack) GetCapabilities() (_result *MediaTrackCapabilities) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("getCapabilities", _args[0:_end]...)
var (
_converted *MediaTrackCapabilities // javascript: MediaTrackCapabilities _what_return_name
)
_converted = MediaTrackCapabilitiesFromJS(_returned)
_result = _converted
return
}
func (_this *MediaStreamTrack) GetConstraints() (_result *MediaTrackConstraints) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("getConstraints", _args[0:_end]...)
var (
_converted *MediaTrackConstraints // javascript: MediaTrackConstraints _what_return_name
)
_converted = MediaTrackConstraintsFromJS(_returned)
_result = _converted
return
}
func (_this *MediaStreamTrack) GetSettings() (_result *MediaTrackSettings) {
var (
_args [0]interface{}
_end int
)
_returned := _this.Value_JS.Call("getSettings", _args[0:_end]...)
var (
_converted *MediaTrackSettings // javascript: MediaTrackSettings _what_return_name
)
_converted = MediaTrackSettingsFromJS(_returned)
_result = _converted
return
}
func (_this *MediaStreamTrack) ApplyConstraints(constraints *MediaTrackConstraints) (_result *javascript.PromiseVoid) {
var (
_args [1]interface{}
_end int
)
if constraints != nil {
_p0 := constraints.JSValue()
_args[0] = _p0
_end++
}
_returned := _this.Value_JS.Call("applyConstraints", _args[0:_end]...)
var (
_converted *javascript.PromiseVoid // javascript: PromiseVoid _what_return_name
)
_converted = javascript.PromiseVoidFromJS(_returned)
_result = _converted
return
}
// class: MediaStreamTrackEvent
type MediaStreamTrackEvent struct {
domcore.Event
}
// MediaStreamTrackEventFromJS is casting a js.Wrapper into MediaStreamTrackEvent.
func MediaStreamTrackEventFromJS(value js.Wrapper) *MediaStreamTrackEvent {
input := value.JSValue()
if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &MediaStreamTrackEvent{}
ret.Value_JS = input
return ret
}
func NewMediaStreamTrackEvent(_type string, eventInitDict *MediaStreamTrackEventInit) (_result *MediaStreamTrackEvent) {
_klass := js.Global().Get("MediaStreamTrackEvent")
var (
_args [2]interface{}
_end int
)
_p0 := _type
_args[0] = _p0
_end++
_p1 := eventInitDict.JSValue()
_args[1] = _p1
_end++
_returned := _klass.New(_args[0:_end]...)
var (
_converted *MediaStreamTrackEvent // javascript: MediaStreamTrackEvent _what_return_name
)
_converted = MediaStreamTrackEventFromJS(_returned)
_result = _converted
return
}
// Track returning attribute 'track' with
// type MediaStreamTrack (idl: MediaStreamTrack).
func (_this *MediaStreamTrackEvent) Track() *MediaStreamTrack {
var ret *MediaStreamTrack
value := _this.Value_JS.Get("track")
ret = MediaStreamTrackFromJS(value)
return ret
}
// class: OverconstrainedErrorEvent
type OverconstrainedErrorEvent struct {
domcore.Event
}
// OverconstrainedErrorEventFromJS is casting a js.Wrapper into OverconstrainedErrorEvent.
func OverconstrainedErrorEventFromJS(value js.Wrapper) *OverconstrainedErrorEvent {
input := value.JSValue()
if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &OverconstrainedErrorEvent{}
ret.Value_JS = input
return ret
}
func NewOverconstrainedErrorEvent(_type string, eventInitDict *OverconstrainedErrorEventInit) (_result *OverconstrainedErrorEvent) {
_klass := js.Global().Get("OverconstrainedErrorEvent")
var (
_args [2]interface{}
_end int
)
_p0 := _type
_args[0] = _p0
_end++
_p1 := eventInitDict.JSValue()
_args[1] = _p1
_end++
_returned := _klass.New(_args[0:_end]...)
var (
_converted *OverconstrainedErrorEvent // javascript: OverconstrainedErrorEvent _what_return_name
)
_converted = OverconstrainedErrorEventFromJS(_returned)
_result = _converted
return
}
// Error returning attribute 'error' with
// type patch.OverconstrainedError (idl: OverconstrainedError).
func (_this *OverconstrainedErrorEvent) Error() *patch.OverconstrainedError {
var ret *patch.OverconstrainedError
value := _this.Value_JS.Get("error")
if value.Type() != js.TypeNull && value.Type() != js.TypeUndefined {
ret = patch.OverconstrainedErrorFromJS(value)
}
return ret
}
// class: Promise
type PromiseMediaStream struct {
// Value_JS holds a reference to a javascript value
Value_JS js.Value
}
func (_this *PromiseMediaStream) JSValue() js.Value {
return _this.Value_JS
}
// PromiseMediaStreamFromJS is casting a js.Wrapper into PromiseMediaStream.
func PromiseMediaStreamFromJS(value js.Wrapper) *PromiseMediaStream {
input := value.JSValue()
if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
return nil
}
ret := &PromiseMediaStream{}
ret.Value_JS = input
return ret
}
func (_this *PromiseMediaStream) Then(onFulfilled *PromiseMediaStreamOnFulfilled, onRejected *PromiseMediaStreamOnRejected) (_result *PromiseMediaStream) {
var (
_args [2]interface{}
_end int
)
var __callback0 js.Value
if onFulfilled != nil {
__callback0 = (*onFulfilled).Value
} else {
__callback0 = js.Null()
}
_p0 := __callback0
_args[0] = _p0
_end++
if onRejected != nil {
var __callback1 js.Value
if onRejected != nil {
__callback1 = (*onRejected).Value
} else {
__callback1 = js.Null()
}
_p1 := __callback1
_args[1] = _p1
_end++
}
_returned := _this.Value_JS.Call("then", _args[0:_end]...)
var (
_converted *PromiseMediaStream // javascript: Promise _what_return_name
)
_converted = PromiseMediaStreamFromJS(_returned)
_result = _converted
return
}
func (_this *PromiseMediaStream) Catch(onRejected *PromiseMediaStreamOnRejected) (_result *PromiseMediaStream) {
var (
_args [1]interface{}
_end int
)
var __callback0 js.Value
if onRejected != nil {
__callback0 = (*onRejected).Value
} else {
__callback0 = js.Null()
}
_p0 := __callback0
_args[0] = _p0
_end++
_returned := _this.Value_JS.Call("catch", _args[0:_end]...)
var (
_converted *PromiseMediaStream // javascript: Promise _what_return_name
)
_converted = PromiseMediaStreamFromJS(_returned)
_result = _converted
return
}
func (_this *PromiseMediaStream) Finally(onFinally *javascript.PromiseFinally) (_result *PromiseMediaStream) {
var (
_args [1]interface{}
_end int
)
var __callback0 js.Value
if onFinally != nil {
__callback0 = (*onFinally).Value
} else {
__callback0 = js.Null()
}
_p0 := __callback0
_args[0] = _p0
_end++
_returned := _this.Value_JS.Call("finally", _args[0:_end]...)
var (
_converted *PromiseMediaStream // javascript: Promise _what_return_name
)
_converted = PromiseMediaStreamFromJS(_returned)
_result = _converted
return
}