Abstract

The
HTML
Media
Capture
specification
defines
an
HTML
form
extension
that
facilitates
user
access
to
a
device's
media
capture
mechanism
,
such
as
a
camera,
or
microphone,
from
within
a
file
upload
control.

Status
of
This
Document

This
section
describes
the
status
of
this
document
at
the
time
of
its
publication.
Other
documents
may
supersede
this
document.
A
list
of
current
W3C
publications
and
the
latest
revision
of
this
technical
report
can
be
found
in
the
W3C
technical
reports
index
at
http://www.w3.org/TR/.

Since
the
File
API
reference
informative,
as
previous
CR
publication
of
this
specification
the
referenced
Security
Considerations
and
Privacy
considerations
section
is
informative
in
that
document
(
diff
).
The
Device
APIs
Working
Group
expects
has
been
revised
and
made
non-normative,
based
on
testability
and
implementer
feedback.
Due
to
request
that
the
Director
advance
this
document
to
Proposed
Recommendation
once
change
in
normative
requirements
the
Working
Group
has
verified
two
interoperable
deployed
implementations
of
each
feature.
The
Device
APIs
Working
Group
does
not
have
an
estimate
specification
is
returning
to
Last
Call
for
review
of
when
this
will
be
achieved.
No
features
have
been
marked
as
"at
risk".
change.
For
a
detailed
view
of
the
changes
see
the
diff
.

This
document
was
published
by
the
Device
APIs
Working
Group
as
a
Candidate
Recommendation.
Last
Call
Working
Draft.
This
document
is
intended
to
become
a
W3C
Recommendation.
If
you
wish
to
make
comments
regarding
this
document,
please
send
them
to
public-device-apis@w3.org
(
subscribe
,
archives
).
W3C
publishes
a
Candidate
Recommendation
to
indicate
that
the
document
is
believed
to
be
stable
and
to
encourage
implementation
by
the
developer
community.
This
Candidate
Recommendation
is
expected
to
advance
to
Proposed
Recommendation
no
earlier
than
18
The
Last
Call
period
ends
24
July
2013.
2014.
All
comments
are
welcome.

Publication
as
a
Candidate
Recommendation
Last
Call
Working
Draft
does
not
imply
endorsement
by
the
W3C
Membership.
This
is
a
draft
document
and
may
be
updated,
replaced
or
obsoleted
by
other
documents
at
any
time.
It
is
inappropriate
to
cite
this
document
as
other
than
work
in
progress.

This
is
a
Last
Call
Working
Draft
and
thus
the
Working
Group
has
determined
that
this
document
has
satisfied
the
relevant
technical
requirements
and
is
sufficiently
stable
to
advance
through
the
Technical
Recommendation
process.

This
extension
is
specifically
designed
to
be
simple
and
declarative,
and
covers
a
subset
of
the
media
capture
functionality
of
the
web
platform.
Specifically,
the
extension
does
not
provide
detailed
author
control
over
capture.
Use
cases
requiring
more
file-grained
author
control
may
be
met
by
using
another
specification,
Media
Capture
and
Streams
[
GETUSERMEDIA
].
For
example,
access
to
real-time
media
streams
from
the
hosting
device
is
out
of
scope
for
this
specification.

2.
Conformance

As
well
as
sections
marked
as
non-normative,
all
authoring
guidelines,
diagrams,
examples,
and
notes
in
this
specification
are
non-normative.
Everything
else
in
this
specification
is
normative.

The
key
words
MUST
,
MUST
NOT
,
REQUIRED
,
SHOULD
,
SHOULD
NOT
,
RECOMMENDED
,
MAY
,
and
OPTIONAL
in
this
specification
are
to
be
interpreted
as
described
in
[
RFC2119
].

This
specification
defines
conformance
criteria
that
apply
to
a
single
product:
the
user
agent
that
implements
the
interfaces
that
it
contains.

Implementations
that
use
ECMAScript
to
implement
the
APIs
defined
in
this
specification
must
implement
them
in
a
manner
consistent
with
the
ECMAScript
Bindings
defined
in
the
Web
IDL
specification
[
WEBIDL
],
as
this
specification
uses
that
specification
and
terminology.

3.
Terminology

In
this
specification,
the
term
capture
control
type
refers
to
a
specialized
type
of
a
file
picker
control
that
is
optimized,
for
the
user,
for
directly
capturing
media
of
a
MIME
type
specified
by
the
accept
attribute,
using
a
media
capture
mechanism
.

The
term
media
capture
mechanism
refers
to
a
device's
local
media
capture
device,
such
as
a
camera
or
microphone.

4.
Security
and
privacy
considerations

The
user
agent
SHOULD
NOT
This
section
is
non-normative.
enable
any
device
for
media
capture,
such
as
a

A
User
Agent
implementation
of
this
specification
is
advised
to
seek
user
consent
before
initiating
capture
of
content
by
microphone
or
camera,
until
a
camera.
This
may
be
necessary
to
meet
regulatory,
legal
and
best
practice
requirements
related
to
the
privacy
of
user
interaction
giving
implicit
consent
data.
In
addition,
the
User
Agent
implementation
is
completed.
A
user
agent
SHOULD
also
advised
to
provide
an
indication
to
the
user
when
such
an
input
device
is
enabled
and
make
it
possible
for
the
user
to
terminate
such
capture.
Similarly,
the
User
Agent
is
advised
to
offer
user
agent
SHOULD
control,
such
as
to
allow
the
user:
user
to:

to
select
the
exact
media
capture
device
to
be
used
if
there
exists
exist
multiple
devices
of
the
same
type
(e.g.
a
front-facing
camera
in
addition
to
a
primary
camera).

to
disable
sound
capture
when
in
the
video
capture
mode.

This
specification
builds
upon
the
security
and
privacy
protections
provided
by
the
<input
type="file">
[
HTML5
]
and
the
[
FILE-API
]
specifications;
in
particular,
it
is
expected
that
any
offer
to
start
capturing
content
from
the
user’s
device
would
require
a
specific
user
interaction
on
an
HTML
element
that
is
entirely
controlled
by
the
user
agent.

Implementors
SHOULD
should
take
care
of
to
prevent
additional
leakage
of
privacy-sensitive
data
from
captured
media.
For
instance,
embedding
the
user’s
location
in
a
the
metadata
of
captured
media
metadata
(e.g.
EXIF)
might
transmit
more
private
data
than
the
user
might
be
is
expecting.

A.
Examples

This
section
is
non-normative.

The
following
examples
demonstrate
how
to
give
hints
that
it
is
preferred
for
the
user
to
capture
media
of
a
specific
MIME
type
using
the
media
capture
capabilities
of
the
hosting
device.
Both
a
simple
declarative
example
using
an
HTML
form,
as
well
as
a
more
advanced
example
including
scripting,
are
presented.

To
take
a
picture
using
the
device's
local
still
image
capture
device,
such
as
a
camera,
and
upload
the
picture
taken
using
an
HTML
form:

When
an
input
element's
accept
attribute
is
set
to
image/*
and
the
capture
attribute
is
specified
as
in
the
Example
1
or
Example
4
,
the
file
picker
may
render
as
presented
on
the
right
side.
When
the
attribute
is
not
specified,
the
file
picker
may
render
as
represented
on
the
left
side.