Wish [BANano] Audio player

Kiffi

Well-Known Member
Licensed User
Longtime User
just a little help for getting started:

B4X:
Sub Process_Globals
   
    Private BANano As BANano
   
End Sub

Sub AppStart(Form1 As Form, Args() As String)

    BANano.Initialize("BANanoHowler", "BANanoHowler", DateTime.Now)
   
    BANano.UseServiceWorker = False
   
    BANano.Header.Title = "BANanoHowler"

    BANano.Header.AddJavascriptFile("https://cdnjs.cloudflare.com/ajax/libs/howler/2.1.1/howler.min.js")

    BANano.Build("C:\inetpub\wwwroot\BANano\") ' <- adjust to your own needs!

    ExitApplication

End Sub

Sub BANanoHowler_Ready()

    Dim cmdPlay As BANanoElement = BANano.GetElement("body").Append($"<button id="cmdPlay">Play</play>"$).Get("#cmdPlay")

    cmdPlay.On("click", Me, "cmdplay_click")
   
End Sub

Sub cmdPlay_Click(BE As BANanoEvent)

    BANano.GetElement("#cmdPlay").SetAttr("disabled", True)
   
    Dim sound As BANanoObject
    sound.Initialize2("Howl", CreateMap("src": "http://rfcmedia.streamguys1.com/MusicPulse.mp3", "html5": True))
    sound.RunMethod("play", Null)

End Sub

Greetings ... Peter (Not responsible for the quality of the music ;))
 
Top