diff --git a/contrib/akamai/controlbar/ControlBar.js b/contrib/akamai/controlbar/ControlBar.js index 844787c1aa..e500ce615d 100644 --- a/contrib/akamai/controlbar/ControlBar.js +++ b/contrib/akamai/controlbar/ControlBar.js @@ -182,7 +182,7 @@ var ControlBar = function (dashjsMediaPlayer, displayUTCTimeCodes) { }; var _onPlayStart = function (/*e*/) { - setTime(displayUTCTimeCodes ? self.player.timeAsUtc() : self.player.timeInDvrWindow()); + setTime(displayUTCTimeCodes ? self.player.timeAsUTC() : self.player.timeInDvrWindow()); updateDuration(); togglePlayPauseBtnState(); if (seekbarBufferInterval) { @@ -193,7 +193,7 @@ var ControlBar = function (dashjsMediaPlayer, displayUTCTimeCodes) { var _onPlayTimeUpdate = function (/*e*/) { updateDuration(); if (!seeking) { - setTime(displayUTCTimeCodes ? player.timeAsUtc() : player.timeInDvrWindow()); + setTime(displayUTCTimeCodes ? player.timeAsUTC() : player.timeInDvrWindow()); if (seekbarPlay) { seekbarPlay.style.width = Math.max((player.timeInDvrWindow() / player.duration() * 100), 0) + '%'; } diff --git a/index.d.ts b/index.d.ts index ea6e3f7067..41827d0357 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1450,7 +1450,7 @@ declare namespace dashjs { duration(): number; - timeAsUtc(): number; + timeAsUTC(): number; getActiveStream(): Stream | null; diff --git a/samples/live-streaming/availability-time-offset.html b/samples/live-streaming/availability-time-offset.html index 11a8644b96..b364ff1e9c 100644 --- a/samples/live-streaming/availability-time-offset.html +++ b/samples/live-streaming/availability-time-offset.html @@ -33,7 +33,7 @@ document.querySelector('#sec').innerHTML = (seconds < 10 ? '0' : '') + seconds; var minutes = d.getMinutes(); document.querySelector('#min').innerHTML = (minutes < 10 ? '0' : '') + minutes + ':'; - document.querySelector('#videoDelay').innerHTML = Math.round((d.getTime() / 1000) - Number(player.timeAsUtc())); + document.querySelector('#videoDelay').innerHTML = Math.round((d.getTime() / 1000) - Number(player.timeAsUTC())); document.querySelector('#videoBuffer').innerHTML = player.getBufferLength() + 's'; } }, 1000); diff --git a/samples/live-streaming/live-delay-comparison-custom-manifest.html b/samples/live-streaming/live-delay-comparison-custom-manifest.html index b072539487..a569762c6f 100644 --- a/samples/live-streaming/live-delay-comparison-custom-manifest.html +++ b/samples/live-streaming/live-delay-comparison-custom-manifest.html @@ -22,7 +22,7 @@ document.querySelector('#sec').innerHTML = (seconds < 10 ? '0' : '') + seconds; var minutes = d.getMinutes(); document.querySelector('#min').innerHTML = (minutes < 10 ? '0' : '') + minutes + ':'; - document.querySelector('#videoDelay').innerHTML = Math.round((d.getTime() / 1000) - Number(player.timeAsUtc())); + document.querySelector('#videoDelay').innerHTML = Math.round((d.getTime() / 1000) - Number(player.timeAsUTC())); document.querySelector('#videoBuffer').innerHTML = player.getBufferLength() + 's'; } }, 1000); diff --git a/samples/live-streaming/live-delay-comparison-using-fragmentCount.html b/samples/live-streaming/live-delay-comparison-using-fragmentCount.html index 97946024f0..8eb7d3ea4a 100644 --- a/samples/live-streaming/live-delay-comparison-using-fragmentCount.html +++ b/samples/live-streaming/live-delay-comparison-using-fragmentCount.html @@ -57,7 +57,7 @@ document.querySelector('#min').innerHTML = (minutes < 10 ? '0' : '') + minutes + ':'; for (var i = 1; i < 7; i++) { var p = eval('player' + i); - document.querySelector('#video' + i + 'delay').innerHTML = Math.round((d.getTime() / 1000) - Number(p.timeAsUtc())); + document.querySelector('#video' + i + 'delay').innerHTML = Math.round((d.getTime() / 1000) - Number(p.timeAsUTC())); document.querySelector('#video' + i + 'buffer').innerHTML = p.getBufferLength() + 's'; } diff --git a/samples/live-streaming/live-delay-comparison-using-setLiveDelay.html b/samples/live-streaming/live-delay-comparison-using-setLiveDelay.html index 68821efb58..cb2fbba3bc 100644 --- a/samples/live-streaming/live-delay-comparison-using-setLiveDelay.html +++ b/samples/live-streaming/live-delay-comparison-using-setLiveDelay.html @@ -57,7 +57,7 @@ document.querySelector('#min').innerHTML = (minutes < 10 ? '0' : '') + minutes + ':'; for (var i = 1; i < 7; i++) { var p = eval('player' + i); - document.querySelector('#video' + i + 'delay').innerHTML = Math.round((d.getTime() / 1000) - Number(p.timeAsUtc())); + document.querySelector('#video' + i + 'delay').innerHTML = Math.round((d.getTime() / 1000) - Number(p.timeAsUTC())); document.querySelector('#video' + i + 'buffer').innerHTML = p.getBufferLength() + 's'; } diff --git a/samples/live-streaming/synchronized-live-playback.html b/samples/live-streaming/synchronized-live-playback.html index 3112d7048b..46186cdd0d 100644 --- a/samples/live-streaming/synchronized-live-playback.html +++ b/samples/live-streaming/synchronized-live-playback.html @@ -46,7 +46,7 @@ document.querySelector('#min').innerHTML = (minutes < 10 ? '0' : '') + minutes + ':'; for (var i = 1; i < 3; i++) { var p = eval('player' + i); - document.querySelector('#video' + i + 'delay').innerHTML = Math.round((d.getTime() / 1000) - Number(p.timeAsUtc())); + document.querySelector('#video' + i + 'delay').innerHTML = Math.round((d.getTime() / 1000) - Number(p.timeAsUTC())); document.querySelector('#video' + i + 'buffer').innerHTML = p.getBufferLength() + 's'; } diff --git a/src/streaming/MediaPlayer.js b/src/streaming/MediaPlayer.js index ff47df5999..df4f6d630c 100644 --- a/src/streaming/MediaPlayer.js +++ b/src/streaming/MediaPlayer.js @@ -1038,7 +1038,7 @@ function MediaPlayer() { * @memberof module:MediaPlayer * @instance */ - function timeAsUtc() { + function timeAsUTC() { if (!playbackInitialized) { throw PLAYBACK_NOT_INITIALIZED_ERROR; } @@ -2833,7 +2833,7 @@ function MediaPlayer() { setVolume, setXHRWithCredentialsForType, time, - timeAsUtc, + timeAsUTC, timeInDvrWindow, trigger, triggerSteeringRequest, diff --git a/test/unit/test/streaming/streaming.MediaPlayer.js b/test/unit/test/streaming/streaming.MediaPlayer.js index 5b41c084ae..3b8a09493b 100644 --- a/test/unit/test/streaming/streaming.MediaPlayer.js +++ b/test/unit/test/streaming/streaming.MediaPlayer.js @@ -186,8 +186,8 @@ describe('MediaPlayer', function () { expect(player.duration).to.throw(PLAYBACK_NOT_INITIALIZED_ERROR); }); - it('Method timeAsUtc should throw an exception', function () { - expect(player.timeAsUtc).to.throw(PLAYBACK_NOT_INITIALIZED_ERROR); + it('Method timeAsUTC should throw an exception', function () { + expect(player.timeAsUTC).to.throw(PLAYBACK_NOT_INITIALIZED_ERROR); }); it('Method getDvrWindow should throw an exception', function () { @@ -457,8 +457,8 @@ describe('MediaPlayer', function () { expect(dvrWindow.size).to.be.equal(30); }); - it('timeAsUtc should return time() VoD content', function () { - let time = player.timeAsUtc(); + it('timeAsUTC should return time() VoD content', function () { + let time = player.timeAsUTC(); expect(time).to.be.NaN });