Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audio not working when the app is launched from the background #822

Open
mahmoudElserafi opened this issue Feb 16, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@mahmoudElserafi
Copy link

Flutter Version

My version : 3.16.7

Lib Version

My version : ^3.1.1

Platform (Android / iOS / web) + version

Platform : Android 13

Describe the bug

audio not working when the app is launched from the background

Small code to reproduce

import 'package:assets_audio_player/assets_audio_player.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State {
  
  final AssetsAudioPlayer _assetsAudioPlayer = AssetsAudioPlayer();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: RaisedButton(
            child: Text("open"),
            onPressed: () {
                await _playerNotify.play();
            }
          ),
        ),
      ),
    );
  }
}
@mahmoudElserafi mahmoudElserafi added the bug Something isn't working label Feb 16, 2024
@mahmoudElserafi
Copy link
Author

audio now is working when the app is launched from the background and the notification controller shows, but the notification controller not showing if the app starts playing from the foreground !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants