Skip to content

Commit

Permalink
fix: fix onProgress callback not firing during iOS live streams (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecozoic authored and cookpete committed Nov 16, 2018
1 parent ee03a06 commit 99375a9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/players/FilePlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,13 @@ export class FilePlayer extends Component {
}
getDuration () {
if (!this.player) return null
return this.player.duration
const { duration, seekable } = this.player
// on iOS, live streams return Infinity for the duration
// so instead we use the end of the seekable timerange
if (duration === Infinity && seekable.length > 0) {
return seekable.end(seekable.length - 1)
}
return duration
}
getCurrentTime () {
if (!this.player) return null
Expand Down

0 comments on commit 99375a9

Please sign in to comment.