Buildfire: Audio Player Service not creating timeUpdate events

56 Views Asked by At

https://github.com/BuildFire/sdk/wiki/BuildFire-Audio-Player-Service

in index.html:

function Player() {} //make it global
Player.instance = buildfire.services.media.audioPlayer;

in the triggering function inside player.js

let track = {};
track.title = "Given Title";
track.url = <insert url here>;
track.image = <insert img.jpg url here>;
Player.instance.play(track);

when initializing the Media Player UI in player.js:

Player.instance.onEvent ( function(e){
    console.log(e.event);
    //other code goes here
};

Right now, on the offline tester, my media player works perfectly, updating the time, and adding the changes when I pause or play. Unfortunately, when I move it to the online tester and the actual app, my phone, and my client's phone don't receive the "timeUpdate" event. And I'm confirming that, with the code above, I DO get "play" and "pause" events, but not the "timeUpdate" event.

Can anyone confirm if this happens for them too, or if there are any fixes?

1

There are 1 best solutions below

2
On

I think the problem you're having is not with the code, but the server where the audio is hosted. Try hosting the audio on a s3 or other cloud storage bucket instead of bundling it into the app (sorry can't comment yet)