Skip to content

Commit

Permalink
Use document.url.fsPath instead of document.url.path coz later is not…
Browse files Browse the repository at this point in the history
… platform-specified
  • Loading branch information
XueshiQiao authored Dec 23, 2023
1 parent 1a72bda commit 813857a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions extension/src/avprobeEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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);
Expand All @@ -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(
Expand All @@ -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));
Expand Down

0 comments on commit 813857a

Please sign in to comment.