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;\ | |
45 readonly attribute MediaStreamTrackState readyState;\ | 43 readonly attribute MediaStreamTrackState readyState;\ |
46 attribute EventHandler onended;\ | 44 attribute EventHandler onended;\ |
47 attribute EventHandler onoverconstrained;\ | 45 attribute EventHandler onoverconstrained;\ |
48 MediaStreamTrack clone ();\ | 46 MediaStreamTrack clone ();\ |
49 void stop ();\ | 47 void stop ();\ |
50 MediaTrackCapabilities getCapabilities ();\ | 48 MediaTrackCapabilities getCapabilities ();\ |
51 MediaTrackConstraints getConstraints ();\ | 49 MediaTrackConstraints getConstraints ();\ |
52 MediaTrackSettings getSettings ();\ | 50 MediaTrackSettings getSettings ();\ |
53 Promise<void> applyConstraints (optional MediaTrackConstraints cons
traints);\ | 51 Promise<void> applyConstraints (optional MediaTrackConstraints cons
traints);\ |
54 };"); | 52 };"); |
55 | 53 |
56 t.step(function () { | 54 t.step(function () { |
57 navigator.getUserMedia({video: true}, t.step_func(function (stream) { | 55 navigator.getUserMedia({video: true}, t.step_func(function (stream) { |
58 var videoTracks = stream.getVideoTracks(); | 56 var videoTracks = stream.getVideoTracks(); |
59 assert_equals(videoTracks.length, 1, "There is exactly one video track in th
e media stream"); | 57 assert_equals(videoTracks.length, 1, "There is exactly one video track in th
e media stream"); |
60 track = videoTracks[0]; | 58 track = videoTracks[0]; |
61 idl_array.add_objects({MediaStreamTrack: ["track"]}); | 59 idl_array.add_objects({MediaStreamTrack: ["track"]}); |
62 idl_array.test(); | 60 idl_array.test(); |
63 assert_equals(track.readyState, "live", "The track object is in live state")
; | 61 assert_equals(track.readyState, "live", "The track object is in live state")
; |
64 assert_equals(track.kind, "video", "The track object is of video kind"); | 62 assert_equals(track.kind, "video", "The track object is of video kind"); |
65 // Not clear that this is required by the spec, | 63 // Not clear that this is required by the spec, |
66 // see https://www.w3.org/Bugs/Public/show_bug.cgi?id=22212 | 64 // see https://www.w3.org/Bugs/Public/show_bug.cgi?id=22212 |
67 assert_true(track.enabled, "The track object is enabed"); | 65 assert_true(track.enabled, "The track object is enabed"); |
68 t.done(); | 66 t.done(); |
69 }), function (error) {}); | 67 }), function (error) {}); |
70 }); | 68 }); |
71 </script> | 69 </script> |
72 </body> | 70 </body> |
73 </html> | 71 </html> |
OLD | NEW |