Skip to content

fix(media-preview): support untitled audio documents - #336411

Open
Abhishek Tripathi (Abhi-05-git) wants to merge 1 commit into
microsoft:mainfrom
Abhi-05-git:fix/audio-preview-safari
Open

Abhishek Tripathi (Abhi-05-git) wants to merge 1 commit into
microsoft:mainfrom
Abhi-05-git:fix/audio-preview-safari

Conversation

@Abhi-05-git

Copy link
Copy Markdown

Description

Fixes support for opening and previewing untitled audio documents in the Media Preview extension.

Previously, AudioPreviewProvider did not preserve the contents of untitled documents when VS Code created the custom document. As a result, the audio preview could not reliably access the in-memory data for an untitled audio document.

This change updates the custom document lifecycle to carry the untitled document data through to the audio preview.

Changes

  • Added AudioPreviewDocument extending vscode.CustomDocument.
  • Added untitledDocumentData to preserve in-memory audio content.
  • Updated openCustomDocument to receive and store CustomDocumentOpenContext.
  • Passed untitledDocumentData from the custom document into AudioPreview.
  • Updated the resolveCustomEditor typing to use the new AudioPreviewDocument.
  • Preserved the existing document URI and dispose lifecycle.

Technical Details

The implementation uses VS Code's CustomDocumentOpenContext.untitledDocumentData to retain the contents of untitled audio documents.

This allows AudioPreview to receive the in-memory Uint8Array data directly instead of relying only on a URI, which is important for documents that have not been saved to disk.

Validation

  • ESLint passed for the modified file.
  • The change was committed and pushed successfully.

Related

This addresses the handling of untitled audio documents in the Media Preview extension.

Copilot AI balanced review requested due to automatic review settings September 16, 2026 12:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Abhi-05-git

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants