Confirmed users
220
edits
Line 16: | Line 16: | ||
enum InputPortType { "av", "displayport", "hdmi" }; | enum InputPortType { "av", "displayport", "hdmi" }; | ||
interface InputPort { | interface InputPort : EventTarget { | ||
readonly attribute DOMString id; | readonly attribute DOMString id; | ||
readonly attribute InputPortType type; | readonly attribute InputPortType type; | ||
readonly attribute MediaStream | readonly attribute MediaStream stream; | ||
attribute EventHandler onconnect; | attribute EventHandler onconnect; | ||
attribute EventHandler ondisconnect; | attribute EventHandler ondisconnect; | ||
}; | }; | ||
'''id''' of type DOMString, readonly<br /> | '''id''' of type DOMString, readonly<br /> | ||
The unique id for the represented input port.<br /> | |||
Input port identifier MUST be unique to the application, and persistent between application sessions. | |||
''This idea is referenced from the attribute [http://w3c.github.io/mediacapture-main/getusermedia.html#dictionary-mediadeviceinfo-members deviceId] of MediaDevice.'' | |||
'''type''' of type InputPortType, readonly<br /> | '''type''' of type InputPortType, readonly<br /> | ||
The type of this input port, value must be defined in the enum of InputPortType, e.g. "av", "displayport". | The type of this input port, value must be defined in the enum of InputPortType, e.g. "av", "displayport". | ||
'''stream''' of type MediaStream, readonly, | '''stream''' of type MediaStream, readonly<br /> | ||
The stream | The media content of this input port, represented as a MediaStream object.<br /> | ||
The reference of this object remains unchanged during the life time of its belonging InputPort; Dispatch of connect or disconnect event responses to the state of hardware connection, isolating to the fact of whether the media content is playable or not; Behaviour of stream with non-playable content should be the same as behavior of muted media tracks, described in section "[http://w3c.github.io/mediacapture-main/getusermedia.html#life-cycle-and-media-flow Life-cycle and Media Flow]". | |||
'''onconnect''' of type EventHandler,<br /> | |||
'''ondisconnect''' of type EventHandler,<br /> | |||
Whenever the hardware detects a connection/disconnection of this input port, UA must queue a task to fire a simple event name connect/disconnect. | |||
=== Specific Port Interfaces === | === Specific Port Interfaces === |