Skip to content

Commit f496c65

Browse files
authored
cherry-pick(release-1.11): use old screencast protocol calls for Mac 10.14 (microsoft#6442)
Cherry-pick microsoft#6440, SHA aab602c References microsoft#6439
1 parent 9cf59c9 commit f496c65

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/server/webkit/wkPage.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import * as jpeg from 'jpeg-js';
1919
import path from 'path';
2020
import * as png from 'pngjs';
2121
import { splitErrorMessage } from '../../utils/stackTrace';
22+
import { hostPlatform } from '../../utils/registry';
2223
import { assert, createGuid, debugAssert, headersArrayToObject, headersObjectToArray } from '../../utils/utils';
2324
import * as accessibility from '../accessibility';
2425
import * as dialog from '../dialog';
@@ -737,7 +738,8 @@ export class WKPage implements PageDelegate {
737738

738739
async _startScreencast(options: types.PageScreencastOptions): Promise<void> {
739740
assert(!this._recordingVideoFile);
740-
const { screencastId } = await this._pageProxySession.send('Screencast.startVideo', {
741+
const START_VIDEO_PROTOCOL_COMMAND = hostPlatform === 'mac10.14' ? 'Screencast.start' : 'Screencast.startVideo';
742+
const { screencastId } = await this._pageProxySession.send(START_VIDEO_PROTOCOL_COMMAND as any, {
741743
file: options.outputFile,
742744
width: options.width,
743745
height: options.height,
@@ -749,7 +751,8 @@ export class WKPage implements PageDelegate {
749751
async _stopScreencast(): Promise<void> {
750752
if (!this._recordingVideoFile)
751753
return;
752-
await this._pageProxySession.sendMayFail('Screencast.stopVideo');
754+
const STOP_VIDEO_PROTOCOL_COMMAND = hostPlatform === 'mac10.14' ? 'Screencast.stop' : 'Screencast.stopVideo';
755+
await this._pageProxySession.sendMayFail(STOP_VIDEO_PROTOCOL_COMMAND as any);
753756
this._recordingVideoFile = null;
754757
}
755758

0 commit comments

Comments
 (0)