Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(error-display): update display on consecutive errors (videojs#8485)
When consecutive errors occur, the `ErrorDisplay` component is not updated with the new error message. This results in an inconsistent state between the `player.error` and `player.errorDisplay.contentEl().textContent`. | | player.error() | player.errorDisplay.content() | player.errorDisplay.contentEl().textContent | | ----------------------- | -------------- | ----------------------------- | ------------------------------------------- | | player.error('Error 1') | Error 1 ✔️ | Error 1 ✔️ | Error 1 ✔️ | | player.error('Error 2') | Error 2 ✔️ | Error 2 ✔️ | Error 1 ❌ | An example of a use case where updating the error message is useful is : - user tries to play media 1 but the media doestn't exist - user tries to play media 2 but the media is not compatible - call the `close` function before each call to the `open` function. - if errorDisplay is not **open**, the `close` function does nothing - if errorDisplay is **open**, the `close` function executes and triggers the close events, then the open function executes and triggers the open events, ensuring that the content is updated.
- Loading branch information