You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-08-05] [$250] [Exploratory] Video - Play button doesn't work after changing speed for a played video #91224
Version Number: 9.3.78-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#89424 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: iPhone 15 iOS 26.4.2 App Component: Chat Report View
Action Performed:
Create a chat with another user, send a video attachment
Tap the attachment preview
Let the video play till the end
Tap 3 dots menu at the right side of the playback controls
Tap Playback speed, tap 2 (the fastest).
Tap Play button
Expected Result:
The video is playing again
Actual Result:
The video is not playing, if it's finished and the speed was changed
The Play button chooses between "resume" and "replay from start" based on an isEnded React state flag — but changing the playback speed clears that flag before you tap Play, so the button resumes a video that's already parked at its end (a no-op on iOS) instead of replaying it.
The play handler only calls replayVideo() (which seeks to 0 first) when isEnded is still true, otherwise it falls through to a bare playVideo():
if(player.playing){pauseVideo();return;}if(isEnded&¤tTime>=duration){// gated on the isEnded flagallowSharedAutoPlayRef.current=true;replayVideo();// replay() seeks to 0 then playsreturn;}allowSharedAutoPlayRef.current=true;playVideo();// bare play(): no-op at end on iOS
2. Changing speed clears isEnded: the speed handler writes player.playbackRate = speed, which — per its own inline comment — resumes playback on iOS (VideoPopoverMenuContext.tsx:32-40). That momentary resume fires the playingChange listener, which sets isEnded back to false (BaseVideoPlayer.tsx:289-296):
if(isVideoPlaying&&isEnded){setIsEnded(false);}
3.isEnded is only ever re-set to true by the playToEnd event (BaseVideoPlayer.tsx:317-321), which won't fire again, so the "ended" state is lost even though currentTime is still >= duration.
Sequence: video ends → isEnded = true → user picks 2x → playbackRate write resumes playback → playingChange clears isEnded → user taps Play → isEnded is now false, so the replay branch is skipped → playVideo() on a player at its end position → nothing happens.
This also explains why the bug only reproduces after changing speed: without the speed change, isEnded stays true and Play correctly replays.
What changes do you think we should make in order to solve the problem?
Base the replay decision on the player's position, not the fragile isEnded flag. A video parked at its end should always replay, regardless of whether isEnded was cleared. In the Play handler at BaseVideoPlayer.tsx:204, change the guard so the replay branch triggers when duration > 0 && currentTime >= duration (dropping the reliance on isEnded).
What alternative solutions did you explore? (Optional)
Alternatively, avoid clearing isEnded in the playingChange listener when the play was triggered by a playbackRate write rather than a genuine user Play (e.g. guard with a ref set only during real play). The position-based guard is the smaller, more robust fix.
🔎 Possibly related
Expensify/App#91625 — Changing playback speed on video reflects on other videos' speed (also in the playback-speed handler).
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/91224) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Please re-state the problem that we are trying to solve in this issue.
In the video player, after a video has played all the way to the end, changing the playback speed and then tapping the Play button does not restart the video. The Play button appears to do nothing. This only happens when the video is already finished AND the playback speed was changed afterward; replaying a finished video works fine if the speed was not touched.
What is the root cause of that problem?
When a video reaches the end, the player records that it has finished by setting the isEnded state to true:
The Play button relies on that isEnded flag to decide whether tapping Play should replay the finished video (seek back to the start and play) instead of just calling play(). Calling play() while the playhead is already sitting at the end is a no-op, so the replay branch is what actually makes a finished video play again:
The problem is that changing the playback speed clears the isEnded flag prematurely. On iOS, assigning a new playbackRate resumes playback if the player was paused — a quirk the code already acknowledges in a comment:
Because the finished video sits paused at the end, setting the new rate makes iOS briefly resume it. That brief resume emits a playingChange event with isPlaying = true, and the playingChange listener responds by clearing isEnded back to false:
The video is still at the end (the playhead never actually moved), but the component now thinks it is not finished. So when the user taps Play, the condition isEnded && currentTime >= duration is false, the replay branch is skipped, and playVideo() is called instead — which does nothing because the playhead is already at the end. The result is that the Play button appears dead.
What changes do you think we should make in order to solve the problem?
Make the Play button detect "the video is at its end" by the playhead position rather than depending solely on the isEnded flag, since that flag can be cleared spuriously by the iOS playback-rate side effect described above.
In togglePlayCurrentVideo in src/components/VideoPlayer/BaseVideoPlayer.tsx, change the replay condition so that it replays whenever the playhead has reached the end of a loaded video, in addition to the existing isEnded check. Concretely, replay when currentTime >= duration (guarded by duration > 0 so it never triggers on an unloaded/zero-length video), OR when isEnded is set:
This branch is only reached when the player is paused (the preceding check returns early when the player is currently playing), so a paused playhead that has reached the duration unambiguously means the video is finished and should be replayed. With this change, tapping Play after a speed change correctly seeks back to the start and plays, regardless of whether isEnded was cleared. The fix is shared logic, so it covers all platforms, and it does not change behavior for the normal cases (resuming a paused mid-video still calls playVideo(); replaying a finished video without a speed change still replays).
What alternative solutions did you explore? (Optional)
An alternative is to stop the playingChange listener from clearing isEnded when the playhead is still at the end (only clear it when playback has genuinely moved away from the end). This addresses the same root cause at the source, but it is riskier: a real replay momentarily reports isPlaying = true before the seek-to-zero settles, so a naive position guard could fail to clear isEnded on a legitimate replay and leave the controls stuck in the "ended" state. Fixing the decision at the Play button is more robust because replay always seeks to the start, after which the existing listener clears isEnded normally.
Another alternative is to re-pause the player inside updatePlaybackSpeed after setting the rate when the video was not playing, to counter the iOS auto-resume. This does not fix the symptom on its own, because the brief resume still emits the playingChange(true) event that clears isEnded before the re-pause takes effect.
changed the title [-][Exploratory] Video - Play button doesn't work after changing speed for a played video[/-][+][$250] [Exploratory] Video - Play button doesn't work after changing speed for a played video[/+]on Jul 17, 2026
@dmkt9 can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, please tag me. If an Upwork job exists, please submit a proposal. https://www.upwork.com/jobs/~022078168097405253334
Activity
MelvinBot commentedon Jul 17, 2026
Proposal
What is the root cause of that problem?
The Play button chooses between "resume" and "replay from start" based on an
isEndedReact state flag — but changing the playback speed clears that flag before you tap Play, so the button resumes a video that's already parked at its end (a no-op on iOS) instead of replaying it.The play handler only calls
replayVideo()(which seeks to 0 first) whenisEndedis stilltrue, otherwise it falls through to a bareplayVideo():Evidence (App
e4ae3a2)1. Play button handler — replay is gated on
isEnded:BaseVideoPlayer.tsx:199-2112. Changing speed clears
isEnded: the speed handler writesplayer.playbackRate = speed, which — per its own inline comment — resumes playback on iOS (VideoPopoverMenuContext.tsx:32-40). That momentary resume fires theplayingChangelistener, which setsisEndedback tofalse(BaseVideoPlayer.tsx:289-296):3.
isEndedis only ever re-set totrueby theplayToEndevent (BaseVideoPlayer.tsx:317-321), which won't fire again, so the "ended" state is lost even thoughcurrentTimeis still>= duration.4.
playVideo()is a bareplay()with no seek; onlyreplayVideo()restarts (usePlaybackContextVideoRefs.ts:9-19).Sequence: video ends →
isEnded = true→ user picks 2x →playbackRatewrite resumes playback →playingChangeclearsisEnded→ user taps Play →isEndedis nowfalse, so the replay branch is skipped →playVideo()on a player at its end position → nothing happens.This also explains why the bug only reproduces after changing speed: without the speed change,
isEndedstaystrueand Play correctly replays.What changes do you think we should make in order to solve the problem?
Base the replay decision on the player's position, not the fragile
isEndedflag. A video parked at its end should always replay, regardless of whetherisEndedwas cleared. In the Play handler atBaseVideoPlayer.tsx:204, change the guard so the replay branch triggers whenduration > 0 && currentTime >= duration(dropping the reliance onisEnded).What alternative solutions did you explore? (Optional)
Alternatively, avoid clearing
isEndedin theplayingChangelistener when the play was triggered by aplaybackRatewrite rather than a genuine user Play (e.g. guard with a ref set only during real play). The position-based guard is the smaller, more robust fix.🔎 Possibly related
Expensify/App#91625— Changing playback speed on video reflects on other videos' speed (also in the playback-speed handler).Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/91224)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
wildan-m commentedon Jul 17, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
In the video player, after a video has played all the way to the end, changing the playback speed and then tapping the Play button does not restart the video. The Play button appears to do nothing. This only happens when the video is already finished AND the playback speed was changed afterward; replaying a finished video works fine if the speed was not touched.
What is the root cause of that problem?
When a video reaches the end, the player records that it has finished by setting the
isEndedstate totrue:App/src/components/VideoPlayer/BaseVideoPlayer.tsx
Lines 303 to 307 in 7363616
The Play button relies on that
isEndedflag to decide whether tapping Play should replay the finished video (seek back to the start and play) instead of just callingplay(). Callingplay()while the playhead is already sitting at the end is a no-op, so the replay branch is what actually makes a finished video play again:App/src/components/VideoPlayer/BaseVideoPlayer.tsx
Lines 185 to 197 in 7363616
The problem is that changing the playback speed clears the
isEndedflag prematurely. On iOS, assigning a newplaybackRateresumes playback if the player was paused — a quirk the code already acknowledges in a comment:App/src/components/VideoPlayerContexts/VideoPopoverMenuContext.tsx
Lines 25 to 33 in 7363616
Because the finished video sits paused at the end, setting the new rate makes iOS briefly resume it. That brief resume emits a
playingChangeevent withisPlaying = true, and theplayingChangelistener responds by clearingisEndedback tofalse:App/src/components/VideoPlayer/BaseVideoPlayer.tsx
Lines 275 to 282 in 7363616
The video is still at the end (the playhead never actually moved), but the component now thinks it is not finished. So when the user taps Play, the condition
isEnded && currentTime >= durationisfalse, the replay branch is skipped, andplayVideo()is called instead — which does nothing because the playhead is already at the end. The result is that the Play button appears dead.What changes do you think we should make in order to solve the problem?
Make the Play button detect "the video is at its end" by the playhead position rather than depending solely on the
isEndedflag, since that flag can be cleared spuriously by the iOS playback-rate side effect described above.In
togglePlayCurrentVideoinsrc/components/VideoPlayer/BaseVideoPlayer.tsx, change the replay condition so that it replays whenever the playhead has reached the end of a loaded video, in addition to the existingisEndedcheck. Concretely, replay whencurrentTime >= duration(guarded byduration > 0so it never triggers on an unloaded/zero-length video), OR whenisEndedis set:App/src/components/VideoPlayer/BaseVideoPlayer.tsx
Lines 185 to 197 in 7363616
This branch is only reached when the player is paused (the preceding check returns early when the player is currently playing), so a paused playhead that has reached the duration unambiguously means the video is finished and should be replayed. With this change, tapping Play after a speed change correctly seeks back to the start and plays, regardless of whether
isEndedwas cleared. The fix is shared logic, so it covers all platforms, and it does not change behavior for the normal cases (resuming a paused mid-video still callsplayVideo(); replaying a finished video without a speed change still replays).Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/91224-replay-finished-video-after-speed-change?expand=1
What alternative solutions did you explore? (Optional)
An alternative is to stop the
playingChangelistener from clearingisEndedwhen the playhead is still at the end (only clear it when playback has genuinely moved away from the end). This addresses the same root cause at the source, but it is riskier: a real replay momentarily reportsisPlaying = truebefore the seek-to-zero settles, so a naive position guard could fail to clearisEndedon a legitimate replay and leave the controls stuck in the "ended" state. Fixing the decision at the Play button is more robust because replay always seeks to the start, after which the existing listener clearsisEndednormally.Another alternative is to re-pause the player inside
updatePlaybackSpeedafter setting the rate when the video was not playing, to counter the iOS auto-resume. This does not fix the symptom on its own, because the brief resume still emits theplayingChange(true)event that clearsisEndedbefore the re-pause takes effect.melvin-bot commentedon Jul 17, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @dmkt9 (
External)[-][Exploratory] Video - Play button doesn't work after changing speed for a played video[/-][+][$250] [Exploratory] Video - Play button doesn't work after changing speed for a played video[/+]38 remaining items
melvin-bot commentedon Aug 4, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Aug 4, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Aug 7, 2026
Payment Summary
Contributor+: @dmkt9 paid $250 via NewDot
@dmkt9 can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, please tag me. If an Upwork job exists, please submit a proposal.
https://www.upwork.com/jobs/~022078168097405253334
^ Test case created. Thx
dmkt9 commentedon Aug 7, 2026
@mallenexpensify Thanks. I've accepted the offer
mallenexpensify commentedon Aug 8, 2026
@dmkt9 paid, summary updated above. Thx.