Pick Media Intent (original) (raw)

Abstract

The Pick Media Intent defines a Web Intent [WEBINTENTS] that enables access to a user's media gallery from inside a Web application. It defines both an Intent action/type pair that selects this operation, and the format of the media data that is returned by services implementing this specification.

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/.

This document recasts the previous pure JavaScript APIs version as an API built using Web Intents, while refining the metadata format based on related media data definitions and practical web-based media services.

This document was published by the Device APIs Working Group as a First Public 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). All feedback is welcome.

Publication as a 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 document was produced by a group operating under the 5 February 2004 W3C Patent Policy.W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes containsEssential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

Table of Contents

1. Introduction

This section is non-normative.

On account of a number of media applications and services accessed from various devices, users tend to maintain their media data in multiple sources including local storage of devices and web-based media galleries. For instance, users upload subset of their photos to several different social media galleries with different metadata. For another example, users collect their favourite audio and video resources in several different media galleries which provide inconsistent metadata attributes one another.

Note

A terminology, media object, is used hereunder to denote media data that contain a media content and its related metadata. (See Media dictionary)

This specification enables a Web application to have access to a selected subset of user's media objects, obtained from arbitrary services not known to the Web application. The interactions, brokered using Web Intents [WEBINTENTS] are designed in order to maximise the user's security and privacy. Media objects may be sourced from a plurality of sources — both online and local to the user's device — so long as those sources are registered as Intent services with the user agent. It defines a common media object format which services use to provide data to Web applications in a consistent and interoperable manner.

For a Pick Media Intent request, user permission can be naturally asked by a necessary user authentication process that a service implementer may provide. Also, users can determine the result media objects to bring to the client with the searching and selecting functionalities that a service implementer may provide.

A set of Security and Privacy Considerations are presented for the discretion of both implementers of Pick Media Intent services and recipients of media data (i.e. Web applications).

The following code illustrates how to obtain media object from a user's media gallery:

Example 1

var intent = new Intent({ action: "http://webintents.org/pick", type: "http://w3.org/type/media", extras: { search: "olympic", filters: ["title", "description", "author", "tags"], limit: 100 }}); navigator.startActivity(intent, mediaOK, mediaFail);

function mediaOK (mediaObjectArray) { // iterate over the array of media objects to do something useful with them } function mediaFail (err) { // display an error to the user }

When the above code is run, the user would typically be prompted by her user agent to select a service able to pick media objects (there may be several such services, if she has multiple media galleries). Upon selecting a service, she will be presented with an interface enabling her to choose what media objects are returned to the Web application. Upon completing her choice, an array of the media objects would be returned to the Web application in the mediaOK callback.

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].

There is only one single conformance requirement placed upon the user agent product: a user agent must support Web Intents [WEBINTENTS].

The conformance criteria in this specification apply to a single product: theMedia service which exposes a Web Intent service that handles Pick Media Intents as defined in this specification.

The data returned by the Media service is described in this specification using [WEBIDL]. When this data is provided using JavaScript, then the Media service must do so in a manner consistent with the ECMAScript Bindings defined in the Web IDL specification.

3. Security and Privacy Considerations

This section is non-normative.

The Intent defined in this specification can be used to find media objects from user's media galleries. The media objects, in the form of photos, videos, voice recordings with related metadata, may contain user's private information. The distribution of this information could potentially compromise the user's privacy. A conforming implementation of this specification should provide a mechanism that protects the user's privacy and this mechanism should ensure that no such information is retrievable without the user's express permission.

3.3 Additional implementation considerations

Further to the requirements listed in the previous section, implementers of a user agents are also advised to consider the following aspects that can negatively affect the privacy of their users: in certain cases, users can inadvertently grant permission to disclose their media objects to Web sites. In other cases, the content hosted at a certain URL changes in such a way that the previously granted permissions no longer apply as far as the user is concerned. Or the users might simply change their minds.

Predicting or preventing these situations is inherently difficult. Mitigation and in-depth defensive measures are a user agent's responsibility and not prescribed by this specification. However, in designing these measures, implementers are advised to enable user awareness of information sharing, and to provide easy access to user interfaces that enable revocation of permissions that Web applications have to access this Intent.

4. Intent Description

The action for this Intent is http://webintents.org/pick.

The type for this Intent is http://w3.org/type/media.

When a media service is matched for delivery using these action and type, it_must_ respond in one of two ways:

5. Data Format

Upon successful invocation, the media service must return an array of Media dictionaries.

5.2 The MediaContent dictionary

The MediaContent dictionary describes a media content reference in detail.

dictionary MediaContent { DOMString uri; Blob? blob; };

5.2.1 Dictionary MediaContent Members

blob of type Blob, nullable

The optional property to contain the media content in Blob format.

uri of type DOMString

The URI to the content of the media resource. This attribute is a mandatory property.

B. References