Skip to content

Commit

Permalink
fix: button caption to display replay
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddie-Thuo committed Mar 14, 2021
1 parent ce7f152 commit c88df99
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mp4-video-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class MP4VideoPlayer extends PolymerElement {
/* Used the populate the tooltip captions based on the current state of the player */
_tooltipCaptions: {
type: Object,
computed: '_computeTooltipCaptions(playing, muted, fullscreen)'
computed: '_computeTooltipCaptions(playing, muted, fullscreen, ended)'
},
/* Toggle the Picture-in-Picture feature based on browser compatibility */
_enablePIP: {
Expand Down Expand Up @@ -349,7 +349,7 @@ class MP4VideoPlayer extends PolymerElement {
* @return {Object} captions for lower track controls
* @private
*/
_computeTooltipCaptions(playing, muted, fullscreen) {
_computeTooltipCaptions(playing, muted, fullscreen, ended) {
const captions = {
playButton: 'Play',
volumeButton: 'Volume',
Expand All @@ -365,6 +365,11 @@ class MP4VideoPlayer extends PolymerElement {
if (fullscreen) {
captions.fullscreenButton = 'Exit Fullscreen';
}
if (!playing) {
if (ended) {
captions.playButton = 'Replay';
}
}
return captions;
}

Expand Down

0 comments on commit c88df99

Please sign in to comment.