GithubHelp home page GithubHelp logo

Comments (5)

tarunsamanta2k20 avatar tarunsamanta2k20 commented on June 14, 2024

I'm interested to work on it. But I wanna know more about the issue.

from robosats.

Reckless-Satoshi avatar Reckless-Satoshi commented on June 14, 2024

Hey @tarunsamanta2k20 ,

Our mobile app (in /mobile) is a simple Webview wrapper of our web app. The index.html, main.js and static files (including the sounds) are bundled within our Android APK (in /mobile/html/Web.bundle). On our webapp, on the browser, sounds like this:

const audio = {
chat: new Audio(`/static/assets/sounds/chat-open.mp3`),
takerFound: new Audio(`/static/assets/sounds/taker-found.mp3`),
ding: new Audio(`/static/assets/sounds/locked-invoice.mp3`),
successful: new Audio(`/static/assets/sounds/successful.mp3`),
};

And then

if (message.sound != null) {
message.sound.play();
}

It would be great to find a solution so the Audio works in both: web browser, and Webview (loading the local file). It is likely that sounds do not play in Webview simply because the path to the files is different when they have to be read locally from /mobile/html/Web.bundle (they would likely be file:///), we usually just use the condition window.NativeRobosats != undefined ? ... to have a different behavior when the webapp is running within the webview. This might be a straight forward 1 line fix, but maybe not the ideal solution. Instead, playing sounds and notifications from outside the webview (e.g., passing a message to the react-native wrapper by building new frontend/src/services/systemClient method) might be a more elegant solution that can be expanded into a join solution for this task and #619 . In fact, this will allow playing notification sounds even with the app in the background I think.

Let me know if you want to give it a try :D

from robosats.

tarunsamanta2k20 avatar tarunsamanta2k20 commented on June 14, 2024

@Reckless-Satoshi I want to give it a try, but wanna know in which interface sound is not working, a web browser or Android app?

from robosats.

Reckless-Satoshi avatar Reckless-Satoshi commented on June 14, 2024

which interface sound is not working, a web browser or Android app?

Android App. I kept digging into it to be more clear and ended up fixing the sounds (commit f6601922b80ab339484b ). Given that the sound does now work on the Android app, I think it is better to focus on the notifications task #619 and close this issue. Would you like to take a look at that task? We do definitely need a hand with it! :D

from robosats.

Reckless-Satoshi avatar Reckless-Satoshi commented on June 14, 2024

Closing as sounds do now work (only if the app is open or recently open).

from robosats.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.