Skip to content

Commit 4ac3c97

Browse files
authored
fix(UI): Only show replay button when there is a duration in the media element (#8740)
1 parent e9d32be commit 4ac3c97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/play_button.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ shaka.ui.PlayButton = class extends shaka.ui.Element {
126126
*/
127127
updateAriaLabel() {
128128
const LocIds = shaka.ui.Locales.Ids;
129-
if (this.isEnded()) {
129+
if (this.isEnded() && this.video.duration) {
130130
this.button.ariaLabel = this.localization.resolve(LocIds.REPLAY);
131131
} else {
132132
const label = this.isPaused() ? LocIds.PLAY : LocIds.PAUSE;
@@ -140,7 +140,7 @@ shaka.ui.PlayButton = class extends shaka.ui.Element {
140140
*/
141141
updateIcon() {
142142
const Icons = shaka.ui.Enums.MaterialDesignIcons;
143-
if (this.isEnded()) {
143+
if (this.isEnded() && this.video.duration) {
144144
this.button.textContent = Icons.REPLAY;
145145
} else {
146146
this.button.textContent = this.isPaused() ? Icons.PLAY : Icons.PAUSE;

0 commit comments

Comments
 (0)