[whatwg] Stream API Feedback
Lachlan Hunt
lachlan.hunt at lachy.id.au
Mon Mar 14 09:59:00 PDT 2011
Hi,
There are a few issues with the recently added media streaming API.
The IDL for GeneratedStream should indicate that it inherits from the
Stream interface.
The API includes both readystatechange event, as well as independent
events for play, paused and ended. This redundancy is unnecessary. This
is also inconsistent with the design of the HTMLMediaElement API, which
does not include a readystatechange event in favour on separate events only.
The API does not provide any way for the author to indicate a preferred
camera. Some devices include multiple cameras, particularly phones with
front and rear facing cameras, and some use cases are better suited to
one or the other.
For example, an augmented reality application that takes advantage of
geolocation and device orientation in order to overlay the video stream
with things (e.g. push pins to identify points of interest, like on
Google Street View). Such an application would be better suited for
working with the rear facing camera. But with a video conferencing
application, the front facing camera would be more suitable.
It might therefore be useful for the author to provide a hint to this
effect, which would allow the UA to more intelligently select the
default camera for the user.
There are some use cases for which it would be useful to know the
precise orientation of the camera, such as augmented reality
applications. The camera orientation may be independent of the device's
orientation, and so the existing device orientation API may not be
sufficient.
In the simple case, the front and rear cameras face in opposite
directions, and so if an augmented reality application was built
assuming it was using the rear camera, but the user instead granted
access to the front camera, the calculations would be 180˚ out.
Some devices may also provide cameras that may allow the camera to be
rotated independently of the device itself, and so camera orientation
information would need to allow for this. I don't know the best way to
provide this, and there likely to be issues about whether the camera
orientation should be relative to the device itself, or relative to
fixed Earth coordinates (North, East, Up), like the existing device
orientation API.
--
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/
More information about the whatwg
mailing list