Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

HTML element <audio> not working in OSWeb > 2.1.0

Hi,

I developed a task which has an inline_html page with an <audio> element in OSWeb 2.0.1.0, and it works as intended. However, after I updated OSWeb to 2.1.0, it stopped working. I also tried the latest release of OSWeb, version 2.1.0.2.

I downgraded to 2.0.1.0, and it works fine again.

Comments

  • Hi,

    I have the same problem. Just to add more information, I found that actually no audio object methods no longer works as intended. For instance, a simple code like the one below (which check the user's sound) now returns an error: Uncaught TypeError: mySound.play is not a function

    <img id="check_sound" onClick="mySound.play();"></img>
    
    <script>
    var mySound = pool['mySound.mp3'].data;
    </script>
    

    This was not the case in earlier versions of OSWeb and downgrading makes it work again as signaled by SpacePenguins.

  • Hi again,

    I think I managed to find why audio tags are no longer functioning in OSWeb 2.1. In OSWeb 2.0.x, audio files have the audio type in the file pool. In OSWeb 2.1, audio files have the audioBuffer type, which explains why classic audio tags/methods are not functioning. Compare below the data type for the same file for both versions of OSWeb.

    OSWeb 2.0.x:

    OSWeb 2.1:

    I am not really familiar with the audioBuffer type but I found a work-around to play audio files, thank to this page on Mozilla's web docs. Everything can be done with a bit of javascript and the specific methods for the audioBuffer type, see below. The main idea is to create an audio source, then link the audio file to the audio source and finally link the audio source to the browser audio "manager".

    // Tell the browser that we intend to play audio files
    const audio_context = new (windo.AudioContext || window.webkitAudioContext)();
    const test_sound = pool["whathever_sound.wav"].data;
    
    // Functions
    function playSound(mySound) {
      // Create an audio source
      var source = audio_context.createBufferSource();
      // Tell the source which sound to play
      source.buffer = mySound;
      // Connect the audio source to the destination (source --> audio_context --> speakers)
      source.connect(audio_context.destination);
      // Play the audio source
      source.start(0);
    }
    
    playSound(test_sound)
    

    I've attached a minimal working example that works with OSWeb 2.1 (not tested with OSWeb 2.0.x). I hope this can help you.

  • I just tested the latest version of OSweb, 2.1.2.0 and the <audio> element dose not work in this version either.

  • Hi @SpacePenguins & @Silk,

    It canm be done with eveything inside an inline_HTML object. I've tested the following task with OSWeb 2.1.2.0 and again after updating to 2.2.1.1, using Chrome and using Edge in Windows. Worked without any issue. Not sure all browsers would run it, though (remains to be tested...).

    Hope this helps,

    Fab.

    Buy Me A Coffee

  • Hi @Fab @SpacePenguins @Silk ,

    Just as a little background to this. Indeed, as of OSWeb 2.1, the (newer) WebAudio API is used instead of the (classic) <audio> tags. The reason for this is that <audio> tags didn't work reliably on Safari and all iOS browsers, apparently because these implement certain security policies differently. (I'm not 100% sure about that, but it caused issues in any case.)

    — Sebastiaan

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games