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

Javascript's number overflow for timescale 10000000 (PlayReady/SmoothStreaming default) #1667

Closed
agelun opened this issue Nov 15, 2018 · 4 comments
Labels
status: archived Archived and locked; will not be updated status: bad content Caused by invalid, broken, or unsupported content type: docs Improvements or fixes to documentation
Milestone

Comments

@agelun
Copy link

agelun commented Nov 15, 2018

Have you read the FAQ and checked for duplicate open issues?:
Yes

What version of Shaka Player are you using?:
commit 1831ce9

Can you reproduce the issue with our latest release version?:
Yes

Can you reproduce the issue with the latest code from master?:
Yes

Are you using the demo app or your own custom app?:
Demo app

What browser and OS are you using?:
Chrome, LG WebOS SmartTV, Samsung Tizen SmartTV

What did you do?
Trying to play content with timescale = 10,000,000 (10 millions) and chunk template with "$Time$" placeholder.

It's a "default timescale" for SmoothStreaming and it is required by several legacy TV models (Samsung Tizen 2015, for example).

The problem is caused by:

  1. JS number overflow for SegmentTemplate+SegmentTimeline content
  2. (theoretically – not tested, found in sources) error with rounding "seconds * timescale" values for SegmentTemplate (without timeline) content.

What did you expect to happen?
Play content normally

What actually happened?
Shaka generates invalid chunk name -> 404 from the server.

@agelun agelun changed the title Javascript's number overflow for timescale 1000000 (PlayReady/SmoothStreaming default) Javascript's number overflow for timescale 10000000 (PlayReady/SmoothStreaming default) Nov 15, 2018
agelun pushed a commit to smartlabstv/shaka-player that referenced this issue Nov 15, 2018
@agelun
Copy link
Author

agelun commented Nov 15, 2018

Example fix based on https://github.com/peterolson/BigInteger.js attached.

@joeyparrish
Copy link
Member

I'm sorry, but we are not going to add a BigInteger library to support extremely large timescales. This additional dependency would not be optional and would increase the size of Shaka Player by ~20%.

I know this is probably disappointing to hear, but we won't support content that creates Numbers too large to be exact integers in JavaScript (2^53). Please fix your timescale to something more reasonable.

@joeyparrish joeyparrish added type: docs Improvements or fixes to documentation status: bad content Caused by invalid, broken, or unsupported content and removed needs triage labels Nov 15, 2018
@joeyparrish
Copy link
Member

We will update our README and FAQ to document this. I apologize for the inconvenience.

@shaka-bot shaka-bot added this to the v2.5 milestone Nov 15, 2018
@chrisfillmore
Copy link
Contributor

This may be interesting to all parties: https://github.com/tc39/proposal-bigint

@shaka-project shaka-project locked and limited conversation to collaborators Jan 14, 2019
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated status: bad content Caused by invalid, broken, or unsupported content type: docs Improvements or fixes to documentation
Projects
None yet
Development

No branches or pull requests

4 participants