-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: replay button broken for native playback #8142
Conversation
Codecov Report
@@ Coverage Diff @@
## main #8142 +/- ##
==========================================
+ Coverage 82.00% 82.03% +0.03%
==========================================
Files 110 110
Lines 7339 7343 +4
Branches 1770 1773 +3
==========================================
+ Hits 6018 6024 +6
+ Misses 1321 1319 -2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
This seems like it probably should happen in |
Also, I'm really sad that it's needed. I think Video.js used to have it a long time ago but was removed because we thought it wasn't needed anymore. |
@gkatsev It actually works like this, Safari doesn't seem to have a problem with the play call, tested on mac and iOS. That said, I agree it would fit better in the actual play function. This will need some refactoring anyway due to what @mister-ben mentioned. |
I moved everything over to |
* fix: replay button broken for native playback * remove debug logging * move fix to player * comment * add unit test * add native browser stubs * reset stubs and test currentTime
* fix: replay button broken for native playback * remove debug logging * move fix to player * comment * add unit test * add native browser stubs * reset stubs and test currentTime
Description
During native playback in Safari (desktop or iOS) if the user reaches the end of content in fullscreen, the replay button will no longer function with a single click. Meaning, the button will work and change state to
playing
however the video does not restart. It seems to be an issue with the content not ending correctly as theended
event is firing, howevervideo.ended
is returningfalse
. Since it's native, we don't have the option of callingendOfStream
on the mediaSource.Specific Changes proposed
If we detect native playback from the
tech
and the play toggle is still in the replay state, we can manually do a seek to 0 and call play.Requirements Checklist