Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
This specification defines a mechanism to pick and search media (image, video, audio) contents along with related metadata from media galleries.
This specification uses Web Intents to find and locate the registered galleries.
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 was published by the Device APIs Working Group as an Editor's Draft. 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 an Editor's 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 contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
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 section is non-normative.
The Gallery API defines a high-level interface for accessing media gallery located on the device. A media gallery is a collection of media objects such as video, audio and image.
To achieve the simplicity in the browser level context, this specification defines only the read-only functionalities.
The following code shows how to work with the gallery API.
Example of a image gallery service. The code registers a pick action for image pick service:
<html> <head> <meta charset='utf-8' /> <title>Image Gallery Service</title> <intent action=”http://webintents.org/pick” type=”image/*” href=”http://example.org/ImageService/” title=”Example Image Service” /> </head>
A web application start a Web Intent request to pick images from registered galleries.
// Client-ends request media service using Web Intents pick action // The request of image pick service var intent = new Intent({ action: "http://webintents.org/pick", type: "image/*", extras: { filter: { name: "Seoul" }, multiple: true } }); navigator.startActivity(intent, galleryResponse); function galleryResponse(data) { // Parse data encoded in an array of objects }
Example of a video gallery service. The code registers a pick action for video pick service:
<html> <head> <meta charset='utf-8' /> <title>Video Gallery Service</title> <intent action=”http://webintents.org/pick” type=”video/*” href=”http://example.org/VideoService/” title=”Example Video Service” /> </head>
A web application start a Web Intent request to pick videos from registered galleries.
// Client-ends request media service using Web Intents pick action // The request of video pick service var intent = new Intent({ action: "http://webintents.org/pick", type: "video/*", extras: { filter: { name: "Family" }, multiple: true } }); navigator.startActivity(intent, galleryResponse); function galleryResponse(data) { // Parse data encoded in an array of objects }
Example of a audio gallery service. The code registers a pick action for audio pick service:
<html> <head> <meta charset='utf-8' /> <title>Audio Gallery Service</title> <intent action=”http://webintents.org/pick” type=”audio/*” href=”http://example.org/AudioService/” title=”Example Audio Service” /> </head>
A web application start a Web Intent request to pick audios from registered galleries.
// Client-ends request media service using Web Intents pick action // The request of audio pick service var intent = new Intent({ action: "http://webintents.org/pick", type: "audio/*", extras: { filter: { name: "Love" }, multiple: true } }); navigator.startActivity(intent, galleryResponse); function galleryResponse(data) { // Parse data encoded in an array of objects }
Mediaobject (ImageObject, VideoObject and AudioObject) in schema.org might be used as type in case Web Intents specification adopts it.
Callback gets an array of objects, data, describing the content. Objects in data, in addition to other metadata fields, have either a url or a content field that would contain a Blob (i.e. the media content.)
MediaObject
dictionaryThe MediaObject
dictionary exposes an object to deliver media contents and related metadata from web galleries and local galleries.
The metadata of the media contens and the search filters are to be defined.
dictionary MediaObject { readonly attribute any content; };
MediaObject
Memberscontent
of type any, readonlyThis section is only for dicussion and will be deleted.
Advantage: it makes integrating with popular services like Flickr, Youtube, SoundCloud a lot easier.
The Gallery API:
This is a list of features that have been discussed with respect to this version of the API but for which it has been decided that if they are included it will be in a future revision.
Many thanks to Robin Berjon for making our lives so much easier with his cool tool.
No informative references.