Skip to content

Commit

Permalink
Fix capabilities sent during switching action
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Byrne committed Apr 27, 2021
1 parent e1a6465 commit 34581e6
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions app/controller/NavigationController.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,23 +491,11 @@ SDL.NavigationController = Em.Object.create(
if (index >= 0) {
Em.Logger.log(`Switching video streaming preset to: ${preset_name}`);
SDL.SDLController.model.set('resolutionIndex', index);
const capability_to_switch = SDL.SDLController.model.resolutionsList[index];
let capabilities_to_send = {};

if (capability_to_switch.preferredResolution) {
capabilities_to_send.preferredResolution = {};
capabilities_to_send.preferredResolution.resolutionWidth =
capability_to_switch.preferredResolution.resolutionWidth;
capabilities_to_send.preferredResolution.resolutionHeight =
capability_to_switch.preferredResolution.resolutionHeight;
}

if (capability_to_switch.scale) {
capabilities_to_send.scale = capability_to_switch.scale;
}

capabilities_to_send.additionalVideoStreamingCapabilities =
SDL.SDLController.model.resolutionsList;
let capabilities_to_send = JSON.parse(JSON.stringify(SDL.SDLController.model.resolutionsList[index]));
let resolutions_list = JSON.parse(JSON.stringify(SDL.SDLController.model.resolutionsList));
// Remove new selected resolution from the additional capabilities
resolutions_list.splice(index, 1);
capabilities_to_send.additionalVideoStreamingCapabilities = resolutions_list;

const json_to_send = {
'systemCapability' : {
Expand Down

0 comments on commit 34581e6

Please sign in to comment.