Input Port API: Difference between revisions

→‎Basic Port Interface: edit for sycing with the current design
(Create page of Input Port API)
 
(→‎Basic Port Interface: edit for sycing with the current design)
Line 15: Line 15:
== Proposed API ==
== Proposed API ==
=== Basic Port Interface ===
=== Basic Port Interface ===
   enum InputPortType { "av", "displayport", "hdmi" };
   [Pref="dom.inputport.enabled", CheckPermissions="inputport", AvailableIn=CertifiedApps]
 
   interface InputPort : EventTarget {
   interface InputPort : EventTarget {
     readonly attribute DOMString id;
     readonly attribute DOMString id;
    readonly attribute InputPortType type;
     readonly attribute MediaStream stream;
     readonly attribute MediaStream stream;
     readonly attribute boolean connected;
     readonly attribute boolean connected;
            attribute EventHandler onconnect;
    attribute EventHandler onconnect;
            attribute EventHandler ondisconnect;
    attribute EventHandler ondisconnect;
   };
   };


Line 31: Line 29:


''This idea is referenced from the attribute [http://w3c.github.io/mediacapture-main/getusermedia.html#dictionary-mediadeviceinfo-members deviceId] of MediaDevice.''
''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 />
The type of this input port, value must be defined in the enum of InputPortType, e.g. "av", "displayport".


'''stream''' of type MediaStream, readonly<br />
'''stream''' of type MediaStream, readonly<br />
17

edits