Hi LucasMs:
Take a look to this sample.
https://www.b4x.com/android/forum/t...ring-with-jsignature-and-webviewextras.96451/
I have no time right now to test (I'm at work, shhh), but I've added your code after my code in Button2_Click.
Sub Button2_Click
WebViewExtras1.ExecuteJavascript("$('#signature').jSignature('reset');")
Label1.Text = "Base30"
ImageView1.Bitmap = Null
Dim url As String
url = "https://interactive-examples.mdn.mozilla.net/media/examples/t-rex-roar.mp3"
Dim jscript As StringBuilder
jscript.Initialize
jscript.Append($"var audio = new Audio('${url}');"$)
jscript.Append(CRLF)
jscript.Append("audio.play();")
Log(jscript.ToString)
WebView
I've added in the html the javascript function:
function play(){
var audio = document.getElementById("audio");
audio.play();
}
And in the html part: (to test if the mp3 format was a problem)
<audio id="audio" src="http://dev.interactive-creation-works.net/1/1.ogg" ></audio>
I've added to Button1_Click:
Javascript="B4A.CallSub('Play', True, "")"
WebViewExtras1.ExecuteJavascript(Javascript)
Well, If I press buttons, it doesn't sound, but if I sign, press the "Undo last stroke" and then press button2, it sounds the mp3. So it seems what is working is your code. Your turn to test and know why
.
I attach the project.