Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: player.duration() should return NaN if duration is not known (#4443
) player.duration() currently returns 0 if the duration is not known, when it should return NaN. The problem is that if NaN is passed to player.duration() as an argument, we set the duration to 0. If player.cache_.duration was set to NaN by other means, player.duration() would still return 0. Modify the player duration() method so that it will 1.) set the cached duration to NaN if it is passed in as an argument, and 2.) return the proper value when called without an argument.
- Loading branch information