After refreshing the page, or once, the html sound does not work, while the base64 string is available inside the src tag

I use html audio element to play sound in mvc 4 and srcpopulate dynamically .:

@using (Ajax.BeginForm("Index", "Parameter", new { @class = "form-horizontal col-md-12", @enctype = "multipart/form-data" }, new AjaxOptions
    {
        HttpMethod = "POST",
        UpdateTargetId = "messageid",
        InsertionMode = InsertionMode.Replace,
    }))
        {   <audio style="width:80%" id="56-audio" src="data:audio/mp3;base64,SUQzAwAAAAAfdlRFTkMAAAATA..(base64 string)" preload="auto" controls="controls"></audio> 
}

when I refresh the page, its impressions are empty, as shown below, and the value is available in the tag src.

showing blank after page refresh

so is there any solution not to show an empty element audio.

+4
source share

Source: https://habr.com/ru/post/1622325/


All Articles