Skip to content

fix(videoViewport): Resolve Cine Player Faults on DisplaySet Update #4909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 4, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,27 @@ class ViewportGridService extends PubSubService {
this.setDisplaySetsForViewports([props]);
}

public async setDisplaySetsForViewports(props) {
await this.serviceImplementation._setDisplaySetsForViewports(props);
public async setDisplaySetsForViewports(viewportsToUpdate) {
const { cineService } = this.servicesManager.services;
await this.serviceImplementation._setDisplaySetsForViewports(viewportsToUpdate);
const state = this.getState();
const updatedViewports = [];

const removedViewportIds = [];

for (const viewport of props) {
// Stopping the cine of modified viewports before changing the viewports to
// avoid inconsistent state and lost references
viewportsToUpdate.forEach(viewport => {
const state = cineService.getState();
const currentCineState = state.cines?.[viewport.viewportId];
cineService.setCine({
id: viewport.viewportId,
frameRate: currentCineState?.frameRate ?? state.default.frameRate,
isPlaying: false,
});
});

for (const viewport of viewportsToUpdate) {
const updatedViewport = state.viewports.get(viewport.viewportId);

if (updatedViewport) {
Expand Down