Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

fix: LSDV-5460: Paragraph is sync with audio and isn't automatically pausing anymore #1519

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 4 additions & 20 deletions src/tags/object/Paragraphs/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,26 +238,11 @@ const PlayableAndSyncable = types.model()

if (!audio) return;

if (!isFF(FF_LSDV_E_278)) {
const indices = self.regionIndicesByTime(time);

// if we left current region's time, reset
if (!indices.includes(self.playingId)) {
self.stopNow();
self.reset();
return;
}
}

// so we are changing time inside current region only
audio.currentTime = time;
if (audio.paused && playing) {
if (isFF(FF_LSDV_E_278)) {
self.play();
} else {
self.play(self.playingId);
}
} else if (isFF(FF_LSDV_E_278)) {
self.play();
} else {
self.trackPlayingId();
}
},
Expand Down Expand Up @@ -364,7 +349,7 @@ const PlayableAndSyncable = types.model()
},

play(idx) {
if (isFF(FF_LSDV_E_278) && !isDefined(idx)) {
if (!isDefined(idx)) {
self.playAny();
return;
}
Expand All @@ -390,8 +375,7 @@ const PlayableAndSyncable = types.model()
self.playing = true;
self.playingId = idx;
self.triggerSync('play');
if (isFF(FF_LSDV_E_278)) self.trackPlayingId();
else self.stopAtTheEnd();
self.trackPlayingId();
},
}))
.actions(self => ({
Expand Down
Loading