@raydiant/playlist-window-manager 0.22.1 → 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -87,6 +87,7 @@ var BrowserViewRenderer = /** @class */ (function () {
87
87
  view: new electron_1.BrowserView({
88
88
  webPreferences: {
89
89
  preload: path.join(__dirname, 'preload.js'),
90
+ contextIsolation: false,
90
91
  },
91
92
  }),
92
93
  bounds: bounds || __assign(__assign({}, this.mainWindow.getBounds()), { x: 0, y: 0 }),
@@ -90,6 +90,7 @@ var BrowserWindowRenderer = /** @class */ (function () {
90
90
  hasShadow: this.opts.hasShadow,
91
91
  webPreferences: {
92
92
  preload: path.join(__dirname, 'preload.js'),
93
+ contextIsolation: false,
93
94
  },
94
95
  });
95
96
  this.proxySettings = null;
@@ -118,6 +119,7 @@ var BrowserWindowRenderer = /** @class */ (function () {
118
119
  ? this.createOrGetPooledBrowserView(windowId, {
119
120
  webPreferences: {
120
121
  preload: path.join(__dirname, 'preload.js'),
122
+ contextIsolation: false,
121
123
  },
122
124
  })
123
125
  : this.createOrGetPooledBrowserWindow(windowId, {
@@ -132,6 +134,7 @@ var BrowserWindowRenderer = /** @class */ (function () {
132
134
  hasShadow: this.opts.hasShadow,
133
135
  webPreferences: {
134
136
  preload: path.join(__dirname, 'preload.js'),
137
+ contextIsolation: false,
135
138
  },
136
139
  }),
137
140
  // If we are creating a child window and renderChildWindowsAsBrowserViews is false that means
@@ -894,7 +894,7 @@ var PlaylistWindowManager = /** @class */ (function (_super) {
894
894
  };
895
895
  PlaylistWindowManager.prototype.swapWindows = function () {
896
896
  return __awaiter(this, void 0, void 0, function () {
897
- var nextPreviewPresentationId, preview, result, shouldPreload;
897
+ var nextPreviewPresentationId, preview, result, nextPresentation, shouldPreload;
898
898
  return __generator(this, function (_a) {
899
899
  switch (_a.label) {
900
900
  case 0:
@@ -910,6 +910,7 @@ var PlaylistWindowManager = /** @class */ (function (_super) {
910
910
  preview = result.preview;
911
911
  nextPreviewPresentationId = preview.presentationId;
912
912
  }
913
+ nextPresentation = this.nextPresentation;
913
914
  // Set this.currentPresentationId before removing the current window to avoid timing issues with previewCheck
914
915
  // triggering during removeCurrentWindow. Current presentation id needs to be set to the next
915
916
  // presentation before calling shouldPreload().
@@ -939,6 +940,11 @@ var PlaylistWindowManager = /** @class */ (function (_super) {
939
940
  // Swap windows.
940
941
  this.currentWindow = this.nextWindow;
941
942
  if (this.currentWindow) {
943
+ // Restore this.currentPresentation value since if this.removeCurrentWindow()
944
+ // was called then this.currentPresentation was set to null.
945
+ // This fixes an issue where publishing a playlist with single presentation results
946
+ // in two iFrames created. See CX-2602 for more details.
947
+ this.currentPresentation = nextPresentation;
942
948
  this.currentWindow.onComplete(this.handleCurrentPresentationComplete);
943
949
  this.currentWindow.onError(this.handleCurrentPresentationError);
944
950
  this.currentWindow.onEnableInterruptLock(this.handleEnableInterruptLock);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raydiant/playlist-window-manager",
3
- "version": "0.22.1",
3
+ "version": "0.23.1",
4
4
  "description": "Window manager for playlist playback.",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -22,7 +22,7 @@
22
22
  "@types/jschannel": "^1.0.1",
23
23
  "@types/jest": "^24.0.15",
24
24
  "@types/uuid": "8.3.0",
25
- "electron": "10.1.5",
25
+ "electron": "28.1.2",
26
26
  "jest": "^24.8.0",
27
27
  "ts-jest": "^24.0.2",
28
28
  "typescript": "^4.1.2"
@@ -37,6 +37,7 @@ export default class BrowserViewRenderer implements PresentationWindowRenderer {
37
37
  view: new BrowserView({
38
38
  webPreferences: {
39
39
  preload: path.join(__dirname, 'preload.js'),
40
+ contextIsolation: false,
40
41
  },
41
42
  }),
42
43
 
@@ -5,9 +5,9 @@ import {
5
5
  ipcMain,
6
6
  IpcMainEvent,
7
7
  Event,
8
- Details,
9
8
  BrowserWindowConstructorOptions,
10
9
  BrowserViewConstructorOptions,
10
+ RenderProcessGoneDetails,
11
11
  } from 'electron';
12
12
  import {
13
13
  PresentationWindowRenderer,
@@ -32,7 +32,10 @@ interface BrowserWindowRendererWindow {
32
32
  payload?: any
33
33
  ) => void;
34
34
  unresponsiveCallback: () => void;
35
- renderProcessGoneCallback: (event: Event, details: Details) => void;
35
+ renderProcessGoneCallback: (
36
+ event: Event,
37
+ details: RenderProcessGoneDetails
38
+ ) => void;
36
39
  }
37
40
 
38
41
  interface BrowserWindowRendererOptions {
@@ -64,6 +67,7 @@ export default class BrowserWindowRenderer
64
67
  hasShadow: this.opts.hasShadow,
65
68
  webPreferences: {
66
69
  preload: path.join(__dirname, 'preload.js'),
70
+ contextIsolation: false,
67
71
  },
68
72
  });
69
73
 
@@ -101,6 +105,7 @@ export default class BrowserWindowRenderer
101
105
  ? this.createOrGetPooledBrowserView(windowId, {
102
106
  webPreferences: {
103
107
  preload: path.join(__dirname, 'preload.js'),
108
+ contextIsolation: false,
104
109
  },
105
110
  })
106
111
  : this.createOrGetPooledBrowserWindow(windowId, {
@@ -115,6 +120,7 @@ export default class BrowserWindowRenderer
115
120
  hasShadow: this.opts.hasShadow,
116
121
  webPreferences: {
117
122
  preload: path.join(__dirname, 'preload.js'),
123
+ contextIsolation: false,
118
124
  },
119
125
  }),
120
126
  // If we are creating a child window and renderChildWindowsAsBrowserViews is false that means
@@ -148,7 +154,10 @@ export default class BrowserWindowRenderer
148
154
  );
149
155
  },
150
156
 
151
- renderProcessGoneCallback: (_: Event, details: Details) => {
157
+ renderProcessGoneCallback: (
158
+ _: Event,
159
+ details: RenderProcessGoneDetails
160
+ ) => {
152
161
  this.logger.error(
153
162
  `Window received 'render-process-gone' event. Reason: ${details.reason}`,
154
163
  { windowId }
@@ -698,6 +698,9 @@ export default class PlaylistWindowManager extends EventEmitter {
698
698
  nextPreviewPresentationId = preview.presentationId;
699
699
  }
700
700
 
701
+ // Save reference to next presentation since later call to
702
+ // this.removeCurrentWindow() will set this.currentPresentation to null.
703
+ const nextPresentation = this.nextPresentation;
701
704
  // Set this.currentPresentationId before removing the current window to avoid timing issues with previewCheck
702
705
  // triggering during removeCurrentWindow. Current presentation id needs to be set to the next
703
706
  // presentation before calling shouldPreload().
@@ -734,6 +737,11 @@ export default class PlaylistWindowManager extends EventEmitter {
734
737
  // Swap windows.
735
738
  this.currentWindow = this.nextWindow;
736
739
  if (this.currentWindow) {
740
+ // Restore this.currentPresentation value since if this.removeCurrentWindow()
741
+ // was called then this.currentPresentation was set to null.
742
+ // This fixes an issue where publishing a playlist with single presentation results
743
+ // in two iFrames created. See CX-2602 for more details.
744
+ this.currentPresentation = nextPresentation;
737
745
  this.currentWindow.onComplete(this.handleCurrentPresentationComplete);
738
746
  this.currentWindow.onError(this.handleCurrentPresentationError);
739
747
  this.currentWindow.onEnableInterruptLock(this.handleEnableInterruptLock);
@@ -10,4 +10,4 @@ mkdir build
10
10
  yarn build
11
11
 
12
12
  # Publish
13
- yarn publish --non-interactive --access public
13
+ yarn publish --access public