We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Given the following JavaScript
export function createAudio(src) { return new Audio(src); }
I can load it in, create an Audio instance, and start it playing like this
Audio
@page "/" @inject IJSRuntime JSRuntime; <button @onclick=@Play>Play</button> JSObjectReference AudioLib; JSObjectReference Audio; protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); AudioLib = await JSRuntime.InvokeAsync<JSObjectReference>("import", "/Audio.js"); Audio = await AudioLib.InvokeAsync<JSObjectReference>("createAudio", "/ElementsSong.ogg"); } protected void Play() { _ = Audio.InvokeVoidAsync("play"); }
However, I cannot get the currentTime of the Audio like this
currentTime
CurrentTime = await Audio.InvokeAsync<decimal>("currentTime");
Instead I have to do something like this to convert the p
export function createAudio(src) { let result = new Audio(src); result.getCurrentTime = () => result.currentTime; return result; }
The text was updated successfully, but these errors were encountered:
Dup of #25756.
Sorry, something went wrong.
No branches or pull requests
Given the following JavaScript
I can load it in, create an
Audio
instance, and start it playing like thisHowever, I cannot get the
currentTime
of theAudio
like thisInstead I have to do something like this to convert the p
The text was updated successfully, but these errors were encountered: