Skip to content

Commit bc75335

Browse files
authored
fix: Remove video play event telemetry and update video element attributes for autoplay and layout handling (microsoft#239266)
1 parent 2095ace commit bc75335

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -736,17 +736,6 @@ export class GettingStartedPage extends EditorPane {
736736
this.webview.setHtml(body);
737737
}
738738
}));
739-
740-
this.stepDisposables.add(this.webview.onMessage(async e => {
741-
const message: string = e.message as string;
742-
if (message === 'playVideo') {
743-
this.telemetryService.publicLog2<GettingStartedActionEvent, GettingStartedActionClassification>('gettingStarted.ActionExecuted', {
744-
command: 'playVideo',
745-
walkthroughId: this.currentWalkthrough?.id,
746-
argument: stepId,
747-
});
748-
}
749-
}));
750739
}
751740
}
752741

src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedDetailsRenderer.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -225,19 +225,13 @@ export class GettingStartedDetailsRenderer {
225225
</head>
226226
<body>
227227
<vertically-centered>
228-
<video controls ${poster ? `poster="${poster?.toString(true)}"` : ''} muted>
228+
<video controls autoplay loop ${poster ? `poster="${poster?.toString(true)}"` : ''} muted>
229229
<source src="${path.toString(true)}" type="video/mp4">
230230
</video>
231231
</vertically-centered>
232232
</body>
233233
234234
<script nonce="${nonce}">
235-
const vscode = acquireVsCodeApi();
236-
237-
document.querySelector('video').addEventListener('play', () => {
238-
vscode.postMessage('playVideo' );
239-
});
240-
241235
let ongoingLayout = undefined;
242236
const doLayout = () => {
243237
document.querySelectorAll('vertically-centered').forEach(element => {
@@ -256,8 +250,8 @@ export class GettingStartedDetailsRenderer {
256250
layout();
257251
258252
document.querySelectorAll('video').forEach(element => {
259-
element.onload = layout;
260-
})
253+
element.addEventListener('loadeddata', layout);
254+
});
261255
</script>
262256
</html>`;
263257
}

0 commit comments

Comments
 (0)