Skip to content

Howler Plugin on Android 5.1 #52

@karneaud

Description

@karneaud

I created a Howler Plugin

PLAYGROUND.Howl = function(app) {
  app.loadAudio = function(audio, opts) {
    this.loader.add();
    let url = this.getPath("sounds").concat(audio,".", this.preferedAudioFormat || '.mp3' )
    this.audio = new Howl({
      src: [ url ],
      format: [ this.preferedAudioFormat || "mp3" ],
      autoplay: false,
      loop: false,
      preload: true
    })

    this.audio.once('load', () => {
      window.console.re.log('loaded')
      this.loader.success.call(this.loader)
    } )
    this.audio.load()
  }
}

PLAYGROUND.Howl.plugin = true

but when I try to run the plugin using

new PLAYGROUND.Application({
  smoothing: true,
  loaded: false,
  preferedAudioFormat: "mp3",
  create() {
    /* things to preload */
    this.loadImage("rejects","orientation")
    this.loadAudio("UR-FullExtreme-Voice") // Audio file
    this.loadData("cuepoints")
  },

then on a State....

create: function() {
    ....

    this.soundId = this.app.audio.play()
  ...

it works on the following IE10 Mobile, iOS7, macOS Safari & Opera

But does not play( well it says its playing but I hear no volume) on Android 5.1 browser

I thought maybe I needed to do a click event so I on the state

create: function(){
....
 var a = document.body;
    a.addEventListener('touchstart', () => {
    //  window.alert('ok')
      window.console.re.log('clicked');
      try {
        this.soundId = this.app.audio.play()
      } catch (e) {
        console.re.log(e)
      } finally {
        console.re.log(this.app.audio.playing(this.soundId));
      }
    })

Which I tried triggering the click event both programmatically and manually

But no go. Can you give me some advice here on how to workaround this Android 5.1 bug....?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions