Skip to content

Commit

Permalink
cherry-pick(release-1.11): use old screencast protocol calls for Mac …
Browse files Browse the repository at this point in the history
…10.14 (#6442)

Cherry-pick #6440, SHA aab602c

References #6439
  • Loading branch information
aslushnikov committed May 6, 2021
1 parent 9cf59c9 commit f496c65
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/server/webkit/wkPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import * as jpeg from 'jpeg-js';
import path from 'path';
import * as png from 'pngjs';
import { splitErrorMessage } from '../../utils/stackTrace';
import { hostPlatform } from '../../utils/registry';
import { assert, createGuid, debugAssert, headersArrayToObject, headersObjectToArray } from '../../utils/utils';
import * as accessibility from '../accessibility';
import * as dialog from '../dialog';
Expand Down Expand Up @@ -737,7 +738,8 @@ export class WKPage implements PageDelegate {

async _startScreencast(options: types.PageScreencastOptions): Promise<void> {
assert(!this._recordingVideoFile);
const { screencastId } = await this._pageProxySession.send('Screencast.startVideo', {
const START_VIDEO_PROTOCOL_COMMAND = hostPlatform === 'mac10.14' ? 'Screencast.start' : 'Screencast.startVideo';
const { screencastId } = await this._pageProxySession.send(START_VIDEO_PROTOCOL_COMMAND as any, {
file: options.outputFile,
width: options.width,
height: options.height,
Expand All @@ -749,7 +751,8 @@ export class WKPage implements PageDelegate {
async _stopScreencast(): Promise<void> {
if (!this._recordingVideoFile)
return;
await this._pageProxySession.sendMayFail('Screencast.stopVideo');
const STOP_VIDEO_PROTOCOL_COMMAND = hostPlatform === 'mac10.14' ? 'Screencast.stop' : 'Screencast.stopVideo';
await this._pageProxySession.sendMayFail(STOP_VIDEO_PROTOCOL_COMMAND as any);
this._recordingVideoFile = null;
}

Expand Down

0 comments on commit f496c65

Please sign in to comment.