Skip to content

Add blob() method to JS side of Blazor DotNetStreamReference #47685

@datvm

Description

@datvm

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Right now the Streams passed from .NET to Javascript through DotNetStreamReference expose two methods: stream() and arrayBuffer(). The former doesn't read the whole stream into memory but there's not much support for it (for example in my case, playing video without knowing the codec, see question on StackOverflow). The latter would load the entire stream/file into memory which is not possible for large files like videos.

I am also not aware of any method to convert a ReadableStream into Blob.

Describe the solution you'd like

Add a blob([mimeType: string]) method to the Javascript stream reference object that returns a Blob. This Blob should not load all the data into memory.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onegood first issueGood for newcomers.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions