Changeset 35755


Ignore:
Timestamp:
2021-11-30T11:03:23+13:00 (2 years ago)
Author:
cstephen
Message:

Fix audio not restarting when clicking play after it has finished

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/js/AudioPlaybackModule.js

    r35631 r35755  
    116116     */
    117117    static async play(id, startTime = -1) {
    118         await this.load(id, startTime);
     118        // Start at the beginning if we've reached the end
     119        if (this.player.duration <= this.player.currentTime && startTime < 0) {
     120            await this.load(id, 0);
     121        }
     122        else {
     123            await this.load(id, startTime);
     124        }
     125
    119126        await this.player.play();
    120127        this.store.commit("playbackStateSetIsPlaying", true);
Note: See TracChangeset for help on using the changeset viewer.