Files
shaka-player/lib
Martin Stark 47ea45d360 fix: avoid calling new Date(null * 1000) (#8963)
If the manifest has no PDT or PST it will currently result in calling
`new Date(null * 1000)`, equivalent to `new Date(0)`, which results in
an unexpected start time date. I believe a better behaviour in this
scenario is to simply return null, since I believe startTime resolving
to null here should be considered a valid case that shouldn't need to be
asserted against.

A manifest does not necessarily have a PDT or PST if it is a basic live
or VOD manifest. The caller of the function may not know this before
calling `getPresentationStartTimeAsDate`.

There is no good way of checking ahead of calling
`player.getPresentationStartTimeAsDate` if calling the method is valid
or not.

`startTime` being `null` here seems like a valid scenario to me. It
should not result in a erroneous call to `new Date` with `null` and
instead just return `null` and log a warning.
2025-08-07 11:05:03 -07:00
..
2025-05-29 12:41:30 +02:00