-
Notifications
You must be signed in to change notification settings - Fork 35.5k
Closed
Labels
upstreamIssue identified as 'upstream' component related (exists outside of VS Code)Issue identified as 'upstream' component related (exists outside of VS Code)
Description
Short: The function AudioContext.decodeAudioData()
fails in 1.36.1 but not in 1.35.1, given the same data.
- VSCode Version: 1.36.1-user and 1.37.0-insider
- OS Version: Windows 10
Steps to Reproduce:
- Create extension with the following source:
import * as vscode from 'vscode';
let webviewPanel = vscode.window.createWebviewPanel(
'extension_name',
'Webview Name',
vscode.ViewColumn.Two,
{
enableScripts: true
}
);
export function activate(extensionContext: vscode.ExtensionContext) {
let resourcePath = "vscode-resource:/path_to_some.mp3";
webviewPanel.webview.html = `
<script type="text/javascript">
const AudioContext = window.AudioContext || window.webkitAudioContext;
const audioContext = new AudioContext();
audioContext.resume();
fetch('${resourcePath}')
.then(response => {
return response.arrayBuffer();
})
.then(buffer => {
audioContext.decodeAudioData(buffer)
.then(audioBuffer => {
let audio = audioContext.createBufferSource();
audio.buffer = audioBuffer;
audio.loop = true;
let analyser = audioContext.createAnalyser();
analyser.fftSize = 512;
audio.connect(analyser);
analyser.connect(audioContext.destination);
audio.start();
})
.catch(e => {
console.error("Error: " + e.message);
});
}).
catch(e => {
console.error("Error: " + e.message);
});
render();
function render() {
requestAnimationFrame(render);
}
</script>
`;
}
export function deactivate() {
webviewPanel.dispose();
}
- When the extension is activated, a webview panel will load, which will report
VM98:25 Error: Unable to decode audio data
in the Webview Developer Tools. Also the following warning is reported:VM98:3 The Web Audio autoplay policy will be re-enabled in Chrome 70 (October 2018). Please check that your website is compatible with it. https://goo.gl/7K7WLu
- No audio plays.
- Compare with behavior of same extension in 1.35.1, where no warning or error is reported and audio plays.
Metadata
Metadata
Assignees
Labels
upstreamIssue identified as 'upstream' component related (exists outside of VS Code)Issue identified as 'upstream' component related (exists outside of VS Code)