OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>getUserMedia({video:true}) creates a stream with a properly initialized v
ideo track</title> | 4 <title>getUserMedia({video:true}) creates a stream with a properly initialized v
ideo track</title> |
5 <link rel="author" title="Dominique Hazael-Massieux" href="mailto:dom@w3.org"/> | 5 <link rel="author" title="Dominique Hazael-Massieux" href="mailto:dom@w3.org"/> |
6 <link rel="help" href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html#id
l-def-MediaStreamTrack"> | 6 <link rel="help" href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html#id
l-def-MediaStreamTrack"> |
7 <link rel="help" href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html#li
fe-cycle-and-media-flow"> | 7 <link rel="help" href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html#li
fe-cycle-and-media-flow"> |
8 <link rel="help" href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html#wi
dl-MediaStreamTrack-kind"> | 8 <link rel="help" href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html#wi
dl-MediaStreamTrack-kind"> |
9 <link rel="help" href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html#wi
dl-MediaStreamTrack-enabled"> | 9 <link rel="help" href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html#wi
dl-MediaStreamTrack-enabled"> |
10 <link rel="help" href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html#wi
dl-MediaStreamTrack-readyState"> | 10 <link rel="help" href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html#wi
dl-MediaStreamTrack-readyState"> |
(...skipping 22 matching lines...) Expand all Loading... |
33 };"); | 33 };"); |
34 | 34 |
35 idl_array.add_idls("interface MediaStreamTrack : EventTarget {\ | 35 idl_array.add_idls("interface MediaStreamTrack : EventTarget {\ |
36 readonly attribute DOMString kind;\ | 36 readonly attribute DOMString kind;\ |
37 readonly attribute DOMString id;\ | 37 readonly attribute DOMString id;\ |
38 readonly attribute DOMString label;\ | 38 readonly attribute DOMString label;\ |
39 attribute boolean enabled;\ | 39 attribute boolean enabled;\ |
40 readonly attribute boolean muted;\ | 40 readonly attribute boolean muted;\ |
41 attribute EventHandler onmute;\ | 41 attribute EventHandler onmute;\ |
42 attribute EventHandler onunmute;\ | 42 attribute EventHandler onunmute;\ |
| 43 readonly attribute boolean _readonly;\ |
| 44 readonly attribute boolean remote;\ |
43 readonly attribute MediaStreamTrackState readyState;\ | 45 readonly attribute MediaStreamTrackState readyState;\ |
44 attribute EventHandler onended;\ | 46 attribute EventHandler onended;\ |
45 attribute EventHandler onoverconstrained;\ | 47 attribute EventHandler onoverconstrained;\ |
46 MediaStreamTrack clone ();\ | 48 MediaStreamTrack clone ();\ |
47 void stop ();\ | 49 void stop ();\ |
48 MediaTrackCapabilities getCapabilities ();\ | 50 MediaTrackCapabilities getCapabilities ();\ |
49 MediaTrackConstraints getConstraints ();\ | 51 MediaTrackConstraints getConstraints ();\ |
50 MediaTrackSettings getSettings ();\ | 52 MediaTrackSettings getSettings ();\ |
51 Promise<void> applyConstraints (optional MediaTrackConstraints cons
traints);\ | 53 Promise<void> applyConstraints (optional MediaTrackConstraints cons
traints);\ |
52 };"); | 54 };"); |
53 | 55 |
54 t.step(function () { | 56 t.step(function () { |
55 navigator.getUserMedia({video: true}, t.step_func(function (stream) { | 57 navigator.getUserMedia({video: true}, t.step_func(function (stream) { |
56 var videoTracks = stream.getVideoTracks(); | 58 var videoTracks = stream.getVideoTracks(); |
57 assert_equals(videoTracks.length, 1, "There is exactly one video track in th
e media stream"); | 59 assert_equals(videoTracks.length, 1, "There is exactly one video track in th
e media stream"); |
58 track = videoTracks[0]; | 60 track = videoTracks[0]; |
59 idl_array.add_objects({MediaStreamTrack: ["track"]}); | 61 idl_array.add_objects({MediaStreamTrack: ["track"]}); |
60 idl_array.test(); | 62 idl_array.test(); |
61 assert_equals(track.readyState, "live", "The track object is in live state")
; | 63 assert_equals(track.readyState, "live", "The track object is in live state")
; |
62 assert_equals(track.kind, "video", "The track object is of video kind"); | 64 assert_equals(track.kind, "video", "The track object is of video kind"); |
63 // Not clear that this is required by the spec, | 65 // Not clear that this is required by the spec, |
64 // see https://www.w3.org/Bugs/Public/show_bug.cgi?id=22212 | 66 // see https://www.w3.org/Bugs/Public/show_bug.cgi?id=22212 |
65 assert_true(track.enabled, "The track object is enabed"); | 67 assert_true(track.enabled, "The track object is enabed"); |
66 t.done(); | 68 t.done(); |
67 }), function (error) {}); | 69 }), function (error) {}); |
68 }); | 70 }); |
69 </script> | 71 </script> |
70 </body> | 72 </body> |
71 </html> | 73 </html> |
OLD | NEW |