Android Question Webview and auto play sound

kohlenach

Member
Hi,
I have a small test php script which auto plays a sound when i open it. In chrome browser this autoplay sound works
after I added in the setup/website setting/ton allowed for this domain.

PHP:
<?php

echo("Hello, World 2!");
$audio_file = "https://mydomain.de/sound.wav";

echo '<audio autoplay="true" style="display:none;">
         <source src="'.$audio_file.'" type="audio/wav">
      </audio>';

?>


When I open the site in a webview, there is no sound. General sound works, I tried youtube.

B4X:
    Activity.LoadLayout("Layout")
    
    Dim webview1 As WebView
    webview1.initialize("wv")
    
    Activity.addview(webview1,0%x,0%x,100%x,100%y)
    webview1.loadurl("https://mydomain.de/test_sound.php")

It looks like a permission problem. Can somebody help me. Thanks.

rgs
Jürgen
 

aeric

Expert
Licensed User
Longtime User

 
Upvote 0

kohlenach

Member
My example was only to explain the basic problem.
Its a webpage, which refresh every 15sec , showing data from a database table, and if new data arrives there should be a sound.

What I want is fullscreen and sound, but
Chrome can do it, but has no fullscreen on android. Opera mini has fullscreen but no sound. Its a mess.
So I thought to build a small app. Looks like I stuck here too.:(
 
Upvote 0
Top