Aryan Barnwal
Aryan Barnwal

Reputation: 53

Background music in Flutter

I am trying to add background music on my flutter app . I installed the audioplayer plugin but am unable to set a background music which runs on loop and i also want to pause it too . Help would be appreciated

Upvotes: 1

Views: 5049

Answers (2)

abhijat_saxena
abhijat_saxena

Reputation: 980

If you're looking for a background music for your app (not an audio player) then check out

Flutter Flame Engine 🔥

https://flame-engine.org/

apart for 2D gaming engine, it also gives you ability to play background music (configurable) and short sounds for taps.

Upvotes: 2

Bilaal Abdel Hassan
Bilaal Abdel Hassan

Reputation: 1379

You might want to check this code which uses the assets_audio_player package.

You can use the initState function to play the music on a loop.

Upvotes: 0

Related Questions