From 605b2b7404a8cf98031639332b36c423efbbc62f Mon Sep 17 00:00:00 2001 From: Richard Thompson Date: Mon, 29 Jun 2015 14:49:08 +0100 Subject: [PATCH] Get forceBeginPlaybackToEndOfWindow from overrides section of configs --- .../tests/devices/mediaplayer/live/restartable.js | 4 ++-- .../script-tests/tests/devices/mediaplayer/live/seekable.js | 5 ++--- static/script/devices/mediaplayer/live/restartable.js | 2 +- static/script/devices/mediaplayer/live/seekable.js | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/static/script-tests/tests/devices/mediaplayer/live/restartable.js b/static/script-tests/tests/devices/mediaplayer/live/restartable.js index c23ff0c5..13faeb49 100644 --- a/static/script-tests/tests/devices/mediaplayer/live/restartable.js +++ b/static/script-tests/tests/devices/mediaplayer/live/restartable.js @@ -35,8 +35,8 @@ }; var config = {"modules":{"base":"antie/devices/browserdevice","modifiers":["antie/devices/mediaplayer/html5"]}, "input":{"map":{}},"layouts":[{"width":960,"height":540,"module":"fixtures/layouts/default","classes":["browserdevice540p"]}],"deviceConfigurationKey":"devices-html5-1"}; - var configWithForceBeginPlaybackToEndOfWindowAsTrue = {"modules":{"base":"antie/devices/browserdevice","modifiers":["antie/devices/mediaplayer/html5"]}, "input":{"map":{}},"layouts":[{"width":960,"height":540,"module":"fixtures/layouts/default","classes":["browserdevice540p"]}],"deviceConfigurationKey":"devices-html5-1", "forceBeginPlaybackToEndOfWindow": true}; - var configWithForceBeginPlaybackToEndOfWindowAsFalse = {"modules":{"base":"antie/devices/browserdevice","modifiers":["antie/devices/mediaplayer/html5"]}, "input":{"map":{}},"layouts":[{"width":960,"height":540,"module":"fixtures/layouts/default","classes":["browserdevice540p"]}],"deviceConfigurationKey":"devices-html5-1", "forceBeginPlaybackToEndOfWindow": false}; + var configWithForceBeginPlaybackToEndOfWindowAsTrue = {"modules":{"base":"antie/devices/browserdevice","modifiers":["antie/devices/mediaplayer/html5"]}, "input":{"map":{}},"layouts":[{"width":960,"height":540,"module":"fixtures/layouts/default","classes":["browserdevice540p"]}],"deviceConfigurationKey":"devices-html5-1","streaming":{"overrides":{"forceBeginPlaybackToEndOfWindow":true}}}; + var configWithForceBeginPlaybackToEndOfWindowAsFalse = {"modules":{"base":"antie/devices/browserdevice","modifiers":["antie/devices/mediaplayer/html5"]}, "input":{"map":{}},"layouts":[{"width":960,"height":540,"module":"fixtures/layouts/default","classes":["browserdevice540p"]}],"deviceConfigurationKey":"devices-html5-1","streaming":{"overrides":{"forceBeginPlaybackToEndOfWindow":false}}}; this.LivePlayerSupportLevelRestartableTest.prototype.testGetLiveSupportReturnsRestartableWithSupportLevelRestartable = function (queue) { expectAsserts(1); diff --git a/static/script-tests/tests/devices/mediaplayer/live/seekable.js b/static/script-tests/tests/devices/mediaplayer/live/seekable.js index 9e8bcd08..ee6dab1b 100644 --- a/static/script-tests/tests/devices/mediaplayer/live/seekable.js +++ b/static/script-tests/tests/devices/mediaplayer/live/seekable.js @@ -35,9 +35,8 @@ }; var config = {"modules":{"base":"antie/devices/browserdevice","modifiers":["antie/devices/mediaplayer/html5"]}, "input":{"map":{}},"layouts":[{"width":960,"height":540,"module":"fixtures/layouts/default","classes":["browserdevice540p"]}],"deviceConfigurationKey":"devices-html5-1"}; - var configWithForceBeginPlaybackToEndOfWindowAsTrue = {"modules":{"base":"antie/devices/browserdevice","modifiers":["antie/devices/mediaplayer/html5"]}, "input":{"map":{}},"layouts":[{"width":960,"height":540,"module":"fixtures/layouts/default","classes":["browserdevice540p"]}],"deviceConfigurationKey":"devices-html5-1", "forceBeginPlaybackToEndOfWindow": true}; - var configWithForceBeginPlaybackToEndOfWindowAsFalse = {"modules":{"base":"antie/devices/browserdevice","modifiers":["antie/devices/mediaplayer/html5"]}, "input":{"map":{}},"layouts":[{"width":960,"height":540,"module":"fixtures/layouts/default","classes":["browserdevice540p"]}],"deviceConfigurationKey":"devices-html5-1", "forceBeginPlaybackToEndOfWindow": false}; - + var configWithForceBeginPlaybackToEndOfWindowAsTrue = {"modules":{"base":"antie/devices/browserdevice","modifiers":["antie/devices/mediaplayer/html5"]}, "input":{"map":{}},"layouts":[{"width":960,"height":540,"module":"fixtures/layouts/default","classes":["browserdevice540p"]}],"deviceConfigurationKey":"devices-html5-1","streaming":{"overrides":{"forceBeginPlaybackToEndOfWindow":true}}}; + var configWithForceBeginPlaybackToEndOfWindowAsFalse = {"modules":{"base":"antie/devices/browserdevice","modifiers":["antie/devices/mediaplayer/html5"]}, "input":{"map":{}},"layouts":[{"width":960,"height":540,"module":"fixtures/layouts/default","classes":["browserdevice540p"]}],"deviceConfigurationKey":"devices-html5-1","streaming":{"overrides":{"forceBeginPlaybackToEndOfWindow":false}}}; this.LivePlayerSupportLevelSeekableTest.prototype.testGetLiveSupportReturnsSeekableWithSupportLevelSeekable = function (queue) { expectAsserts(1); diff --git a/static/script/devices/mediaplayer/live/restartable.js b/static/script/devices/mediaplayer/live/restartable.js index aeb76bde..749f89da 100644 --- a/static/script/devices/mediaplayer/live/restartable.js +++ b/static/script/devices/mediaplayer/live/restartable.js @@ -57,7 +57,7 @@ require.def( beginPlayback: function() { var config = RuntimeContext.getDevice().getConfig(); - if (config && config.forceBeginPlaybackToEndOfWindow) { + if (config && config.streaming && config.streaming.overrides && config.streaming.overrides.forceBeginPlaybackToEndOfWindow) { this._mediaPlayer.beginPlaybackFrom(Infinity); } else { this._mediaPlayer.beginPlayback(); diff --git a/static/script/devices/mediaplayer/live/seekable.js b/static/script/devices/mediaplayer/live/seekable.js index cc556124..e9982310 100644 --- a/static/script/devices/mediaplayer/live/seekable.js +++ b/static/script/devices/mediaplayer/live/seekable.js @@ -61,7 +61,7 @@ require.def( beginPlayback: function() { var config = RuntimeContext.getDevice().getConfig(); - if (config && config.forceBeginPlaybackToEndOfWindow) { + if (config && config.streaming && config.streaming.overrides && config.streaming.overrides.forceBeginPlaybackToEndOfWindow) { this._mediaPlayer.beginPlaybackFrom(Infinity); } else { this._mediaPlayer.beginPlayback();