Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duration value to be floating point number #571

Open
triplingual opened this issue Jan 2, 2025 · 3 comments
Open

Fix duration value to be floating point number #571

triplingual opened this issue Jan 2, 2025 · 3 comments

Comments

@triplingual
Copy link
Contributor

Recipe info:

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

@triplingual
Copy link
Contributor Author

Best as I can see, the API does not define whether #t= values have to be floating point types.

@stephenwf
Copy link
Contributor

stephenwf commented Jan 2, 2025

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 180 to 180.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.

@triplingual
Copy link
Contributor Author

It's not the only reason, but I believe the validator cries Foul at a duration that isn't a floating point. See 01b414d for changes to the AV choice recipe that reflect this and #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs triage
Development

No branches or pull requests

2 participants