mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1170051 - Fix issues with screen shares not correctly laying out on Loop standalone UI - remove the video dimensions from the cache when the share is stopped. r=mikedeboer
This commit is contained in:
parent
28dbc47eef
commit
589401875c
@ -571,7 +571,19 @@ loop.store.ActiveRoomStore = (function() {
|
||||
* Used to note the current state of receiving screenshare data.
|
||||
*/
|
||||
receivingScreenShare: function(actionData) {
|
||||
this.setStoreState({receivingScreenShare: actionData.receiving});
|
||||
if (!actionData.receiving &&
|
||||
this.getStoreState().remoteVideoDimensions.screen) {
|
||||
// Remove the remote video dimensions for type screen as we're not
|
||||
// getting the share anymore.
|
||||
var newDimensions = _.extend(this.getStoreState().remoteVideoDimensions);
|
||||
delete newDimensions.screen;
|
||||
this.setStoreState({
|
||||
receivingScreenShare: actionData.receiving,
|
||||
remoteVideoDimensions: newDimensions
|
||||
});
|
||||
} else {
|
||||
this.setStoreState({receivingScreenShare: actionData.receiving});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -337,6 +337,13 @@ loop.shared.mixins = (function() {
|
||||
cache[videoType].aspectRatio = this.getAspectRatio(cache[videoType]);
|
||||
}
|
||||
}, this);
|
||||
// Remove any streams that are no longer being published.
|
||||
cacheKeys.forEach(function(videoType) {
|
||||
if (!(videoType in newDimensions)) {
|
||||
delete cache[videoType];
|
||||
changed = true;
|
||||
}
|
||||
});
|
||||
return changed;
|
||||
},
|
||||
|
||||
|
@ -1018,6 +1018,23 @@ describe("loop.store.ActiveRoomStore", function () {
|
||||
|
||||
expect(store.getStoreState().receivingScreenShare).eql(true);
|
||||
});
|
||||
|
||||
it("should delete the screen remote video dimensions if screen sharing is not active", function() {
|
||||
store.setStoreState({
|
||||
remoteVideoDimensions: {
|
||||
screen: {fake: 10},
|
||||
camera: {fake: 20}
|
||||
}
|
||||
});
|
||||
|
||||
store.receivingScreenShare(new sharedActions.ReceivingScreenShare({
|
||||
receiving: false
|
||||
}));
|
||||
|
||||
expect(store.getStoreState().remoteVideoDimensions).eql({
|
||||
camera: {fake: 20}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("#startScreenShare", function() {
|
||||
|
@ -465,11 +465,9 @@ describe("loop.shared.mixins", function() {
|
||||
}
|
||||
};
|
||||
|
||||
beforeEach(function() {
|
||||
view.updateVideoDimensions(localVideoDimensions, remoteVideoDimensions);
|
||||
});
|
||||
|
||||
it("should register video dimension updates correctly", function() {
|
||||
view.updateVideoDimensions(localVideoDimensions, remoteVideoDimensions);
|
||||
|
||||
expect(view._videoDimensionsCache.local.camera.width)
|
||||
.eql(localVideoDimensions.camera.width);
|
||||
expect(view._videoDimensionsCache.local.camera.height)
|
||||
@ -485,7 +483,16 @@ describe("loop.shared.mixins", function() {
|
||||
.eql(0.32857142857142857);
|
||||
});
|
||||
|
||||
it("should unregister video dimension updates correctly", function() {
|
||||
view.updateVideoDimensions(localVideoDimensions, {});
|
||||
|
||||
expect("camera" in view._videoDimensionsCache.local).eql(true);
|
||||
expect("camera" in view._videoDimensionsCache.remote).eql(false);
|
||||
});
|
||||
|
||||
it("should not populate the cache on another component instance", function() {
|
||||
view.updateVideoDimensions(localVideoDimensions, remoteVideoDimensions);
|
||||
|
||||
var view2 =
|
||||
TestUtils.renderIntoDocument(React.createElement(TestComp));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user