mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-28 12:36:35 +00:00
Handle infinity for now
This commit is contained in:
parent
373d613e19
commit
82506df2dd
1 changed files with 3 additions and 1 deletions
|
|
@ -129,7 +129,9 @@ export default class ElementSource {
|
|||
|
||||
getDuration() {
|
||||
const { duration } = this._audio;
|
||||
return isNaN(duration) ? 0 : duration;
|
||||
// Safari on iOS currently has a strange behavior where it reports
|
||||
// the duration as infinity. For now, 0 is better even though it's still wrong.
|
||||
return isNaN(duration) || duration === Infinity ? 0 : duration;
|
||||
}
|
||||
|
||||
getTimeElapsed() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue