Skip to content

Commit

Permalink
Fix/control bar (#4314)
Browse files Browse the repository at this point in the history
* Added fix for #4291 and #4287

* Cleaned up leftover comment
  • Loading branch information
ShikiSeiren committed Nov 13, 2023
1 parent 7320c8f commit cb75b77
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/akamai/controlbar/ControlBar.js
Expand Up @@ -372,7 +372,7 @@ var ControlBar = function (dashjsMediaPlayer, displayUTCTimeCodes) {
durationDisplay.onclick = seekLive;
durationDisplay.classList.add('live-icon');
}
} else if (!isNaN(value)) {
} else if (!isNaN(value) && isFinite(value)) {
durationDisplay.textContent = displayUTCTimeCodes ? self.player.formatUTC(value) : self.player.convertToTimeCode(value);
durationDisplay.classList.remove('live-icon');
}
Expand Down
3 changes: 3 additions & 0 deletions samples/dash-if-reference-player/app/main.js
Expand Up @@ -1808,6 +1808,9 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
case 'muted':
$scope.muted = this.parseBoolean(value);
$scope.toggleMuted();
if ($scope.muted === true){
document.getElementById('muteBtn')?.click();
}
break;
case 'drmToday':
$scope.drmToday = this.parseBoolean(value);
Expand Down
5 changes: 5 additions & 0 deletions src/streaming/controllers/PlaybackController.js
Expand Up @@ -140,6 +140,7 @@ function PlaybackController() {
eventBus.on(MediaPlayerEvents.STREAM_INITIALIZING, _onStreamInitializing, instance);
eventBus.on(MediaPlayerEvents.REPRESENTATION_SWITCH, _onRepresentationSwitch, instance);
eventBus.on(MediaPlayerEvents.BUFFER_LEVEL_STATE_CHANGED, _onBufferLevelStateChanged, instance);
eventBus.on(MediaPlayerEvents.DYNAMIC_TO_STATIC, _onDynamicToStatic, instance);

if (playOnceInitialized) {
playOnceInitialized = false;
Expand Down Expand Up @@ -731,6 +732,10 @@ function PlaybackController() {
}
}

function _onDynamicToStatic() {
isDynamic = false;
}

function _updateLivePlaybackTime() {
const now = Date.now();
if (!lastLivePlaybackTime || now > lastLivePlaybackTime + LIVE_UPDATE_PLAYBACK_TIME_INTERVAL_MS) {
Expand Down

0 comments on commit cb75b77

Please sign in to comment.