WebThingsIO / api

Web Thing API Specification
http://iot.mozilla.org/wot/
Other
164 stars 24 forks source link

Binary Properties #108

Closed benfrancis closed 5 years ago

benfrancis commented 6 years ago

As a developer I want to provide a URL to a binary file or stream as the value of a property so that I can have properties like images, audio or video.

This could be achieved by making the href of a property into a links array as per #73, similar to what was suggested in https://github.com/w3c/wot-thing-description/issues/223#issuecomment-422018047 e.g.

...
  "properties": {
    "image": {
      "links" [{
        "href": "/things/lamp/properties/image",
        "mediaType": "image/jpeg"
      }]
    },
  }
...

This could also allow for other binary encoded data as per #41

jaller94 commented 6 years ago

I guess the array could be useful to provide the same content in various file formats and resolutions. I assume that this will most often be used for video, audio and image content. A video/image could have an visual_size or resolution (which might be ambiguous as audio can also have a resolution). For a video/audio a bitrate might be more interesting.

It’s great to consider that this would also work for documents which could offer various file formats like HTML, application/pdf, application/rdf+xml or application/vnd.oasis.opendocument.textapplication/vnd.oasis.opendocument.text. This could be useful for a WebThing that generates reports or fancy log files.