diff --git a/static/script-tests/tests/devices/mediaplayer/samsung_streaming.js b/static/script-tests/tests/devices/mediaplayer/samsung_streaming.js index ef406a90..2b427016 100644 --- a/static/script-tests/tests/devices/mediaplayer/samsung_streaming.js +++ b/static/script-tests/tests/devices/mediaplayer/samsung_streaming.js @@ -259,7 +259,7 @@ /*HLS specific tests START*/ - this.SamsungStreamingMediaPlayerTests.prototype.testPLayerOpenPluginThenHlsStartPlaybackCalledOnDeviceWhenBeginPlaybackFromCalledInStoppedState = function(queue) { + this.SamsungStreamingMediaPlayerTests.prototype.testPlayerOpenPluginThenHlsStartPlaybackCalledOnDeviceWhenBeginPlaybackFromCalledInStoppedState = function(queue) { expectAsserts(9); runMediaPlayerTest(this, queue, function(MediaPlayer) { assert(playerPlugin.Open.notCalled); @@ -276,7 +276,7 @@ assert(playerPlugin._methods.StartPlayback.calledOnce); }); }; - this.SamsungStreamingMediaPlayerTests.prototype.testPLayerOpenPluginThenHlsPlayCalledOnDeviceWhenBeginPlaybackFromCalledInStoppedState = function(queue) { + this.SamsungStreamingMediaPlayerTests.prototype.testPlayerOpenPluginThenHlsPlayCalledOnDeviceWhenBeginPlaybackFromCalledInStoppedState = function(queue) { expectAsserts(8); runMediaPlayerTest(this, queue, function(MediaPlayer) { assert(playerPlugin.Open.notCalled); @@ -518,6 +518,19 @@ assert(playerPlugin._methods.JumpForward.notCalled); }); }; + + this.SamsungStreamingMediaPlayerTests.prototype.testHlsVodGetDurationUsedInsteadOfGetPlayingRange = function (queue) { + expectAsserts(4); + runMediaPlayerTest(this, queue, function(MediaPlayer) { + this._mediaPlayer.setSource(MediaPlayer.TYPE.VIDEO, 'testURL', 'application/vnd.apple.mpegurl'); + this._mediaPlayer.beginPlaybackFrom(0); + deviceMockingHooks.sendMetadata(this._mediaPlayer, 0, { start: 0, end: 100 }); + + assert(playerPlugin._methods.GetPlayingRange.notCalled); + assert(playerPlugin._methods.GetDuration.calledOnce); + assertEquals(100, this._mediaPlayer.getDuration()); + }); + }; /*HLS specific tests END*/ this.SamsungStreamingMediaPlayerTests.prototype.testSetSourceInitPlayerFailsReturningZero = function(queue) { diff --git a/static/script/devices/mediaplayer/samsung_streaming.js b/static/script/devices/mediaplayer/samsung_streaming.js index 94e3eb34..73ff0dea 100644 --- a/static/script/devices/mediaplayer/samsung_streaming.js +++ b/static/script/devices/mediaplayer/samsung_streaming.js @@ -458,7 +458,7 @@ require.def( _updateRange: function () { var self = this; - if (this._currentPlayer === this.PlayerEmps.StreamingPlayer) { + if (this._isHlsMimeType() && this._isLiveMedia()) { var range = this._playerPlugin.Execute('GetPlayingRange').split('-'); this._range = { start: Math.floor(range[0]), @@ -469,7 +469,7 @@ require.def( setTimeout(function () { self._updatingTime = false; }, self.RANGE_UPDATE_TOLERANCE * 1000); - } else if (this._currentPlayer === this.PlayerEmps.Player) { + } else { var duration = this._playerPlugin.Execute('GetDuration')/1000; this._range = { start: 0,