WebAPI/WebMMS: Difference between revisions

Line 5: Line 5:
The API proposal below exposes the SMIL document as a DOM tree and the attachments as Blobs (or, rather, an extension thereof, akin to how File is an extension of Blob). On a User Agent capable of rendring SMIL, the web application may simply render the DOM right away. On other User Agents, it may use XSLT or some other method to convert SMIL to HTML.
The API proposal below exposes the SMIL document as a DOM tree and the attachments as Blobs (or, rather, an extension thereof, akin to how File is an extension of Blob). On a User Agent capable of rendring SMIL, the web application may simply render the DOM right away. On other User Agents, it may use XSLT or some other method to convert SMIL to HTML.


To read the attachments, the web application may use the FileReader API. XXX TODO explain uri attribute; might be useful as a general blob feature, e.g. gallery storing pix in indexedDB, etc.
To read the attachments, the web application may use the FileReader API. However, it's not that useful or efficient to have image/audio/video data in memory (e.g. as a typed array). For display purposes the web application just needs a URI that resolves to the data, so that it can point to it in a <video>, <audio>, <img> element. In the simplest case this could be a data: URI, but for large data it might just want to stream the data directly from a file on the disk. (This would be a generally useful feature to provide for all blobs, e.g. when storing multimedia data in IndexedDB.)


= API =
= API =
canmove, Confirmed users
725

edits