Fix duration value to be floating point number
Recipe info:
- Name: Rendering Multiple Media Types on a Time-Based Canvas (a.k.a. Multimedia Canvas)
- link: https://iiif.io/api/cookbook/recipe/0489-multimedia-canvas/
Correction request
Prezi 3 says that duration values MUST be floating point numbers. In this recipe, the duration on the Canvas needs to be changed from 180 to 180.0
Best as I can see, the API does not define whether #t= values have to be floating point types.
Best as I can see, the API does not define whether #t= values have to be floating point types.
https://www.w3.org/TR/media-frags/#collected-syntax-uri
I think it's optional inside of media frags. t=123.0 might be valid, but t=123 would probably be expected.
Prezi 3 says that duration values MUST be floating point numbers. In this recipe, the duration on the Canvas needs to be changed from
180to180.0
I don't think this requirement is compatible with the JSON specification, which only describes a single type "number", which may or may not be fractional. Some serialisers, including JSON.stringify in the browser, will consider 180 and 180.0 equal and may choose 180 when serialising. From the JSON-specifications point of view they are the same value.
It's not the only reason, but I believe the validator cries Foul at a duration that isn't a floating point. See https://github.com/IIIF/cookbook-recipes/pull/442/commits/01b414d90aec164a95348a87bf5191290b802c02 for changes to the AV choice recipe that reflect this and https://github.com/IIIF/cookbook-recipes/issues/474 for a previous time I corrected some recipes for this reason (though clearly when they were written the validator didn't complain about the datatype).
This precedent citation is not to shut down the conversation, but to make a note to both of us that if we end up at a point that is not "duration needs to be written as 0.0" then there may be other recipes that need changing.