From 813857a3dbbb5743a2efb07478b944393a2832b9 Mon Sep 17 00:00:00 2001 From: xueshi Date: Sat, 23 Dec 2023 16:56:19 +0800 Subject: [PATCH] Use document.url.fsPath instead of document.url.path coz later is not platform-specified --- extension/src/avprobeEditor.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extension/src/avprobeEditor.ts b/extension/src/avprobeEditor.ts index e94d840..8824db6 100644 --- a/extension/src/avprobeEditor.ts +++ b/extension/src/avprobeEditor.ts @@ -233,7 +233,7 @@ export class AVProbeEditorProvider implements const styleTableUri = webview.asWebviewUri( vscode.Uri.joinPath(this._context.extensionUri, 'media', 'table.css')); - const filePath = document.uri.path; + //const filePath = document.uri.path; const dependencyNameList: string[] = [ 'index.css', @@ -296,10 +296,10 @@ export class AVProbeEditorProvider implements private onMessage( document: AVFileDocument, message: any, webviewPanel: vscode.WebviewPanel) { + // get file size of the media file + const filePath = document.uri.fsPath; switch (message.type) { case 'ready': { - // get file size of the media file - const filePath = document.uri.path; vscode.workspace.fs.stat(document.uri).then((stat) => { const fileSize = stat.size; console.log('fileSize: ', fileSize); @@ -325,7 +325,7 @@ export class AVProbeEditorProvider implements return; } case 'probe': { - FFProbe.probeMediaInfo(document.uri.path) + FFProbe.probeMediaInfo(filePath) .then((info) => { console.log('probeMediaInfo: ', info); this.postMessage( @@ -345,7 +345,7 @@ export class AVProbeEditorProvider implements } else { // nop, select all streams for default } - FFProbe.probeMediaInfoWithCustomArgs(document.uri.path, args) + FFProbe.probeMediaInfoWithCustomArgs(filePath, args) .then((info) => { console.log('probeMediaInfo: ', info); this.postMessage(webviewPanel, 'packets', JSON.stringify(info));