Skip to content

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

Closed

Description

@agelun

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.

Activity

  1. changed the title [-]Javascript's number overflow for timescale 1000000 (PlayReady/SmoothStreaming default)[/-] [+]Javascript's number overflow for timescale 10000000 (PlayReady/SmoothStreaming default)[/+] on Nov 15, 2018
  2. added a commit that references this issue on Nov 15, 2018
    f37578b
  3. agelun commented on Nov 15, 2018

    @agelun
    Author

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

  4. joeyparrish commented on Nov 15, 2018

    @joeyparrish
    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.

  5. joeyparrish commented on Nov 15, 2018

    @joeyparrish
    Member

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

  6. added this to the v2.5 milestone on Nov 15, 2018
  7. chrisfillmore commented on Nov 22, 2018

    @chrisfillmore
    Contributor

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

  8. locked and limited conversation to collaborators on Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: archivedArchived and locked; will not be updatedstatus: bad contentCaused by invalid, broken, or unsupported content

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions