Skip to content

Commit b1dbe05

Browse files
committed
fix(ios): duration is now in ms like android
1 parent 4ca172b commit b1dbe05

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/audio/player.ios.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ export class TNSPlayer extends Observable {
6464

6565
public get duration() {
6666
if (this._player) {
67-
return this._player.duration;
67+
return Math.round(this._player.duration * 1000);
6868
} else {
6969
return 0;
7070
}
7171
}
7272

7373
get currentTime(): number {
74-
return this._player ? this._player.currentTime : 0;
74+
return this._player ? Math.round(this._player.currentTime * 1000) : 0;
7575
}
7676

7777
public setAudioFocusManager(manager: any) {}
@@ -290,7 +290,7 @@ export class TNSPlayer extends Observable {
290290

291291
public async getAudioTrackDuration() {
292292
try {
293-
const duration = this._player ? this._player.duration : 0;
293+
const duration = this._player ? Math.round(this._player.duration * 1000) : 0;
294294
return duration;
295295
} catch (ex) {
296296
if (this.errorCallback) {

0 commit comments

Comments
 (0)