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

Can't stop audio when i move to next screen #610

Closed
mvn-hainguyen-dn opened this issue Apr 7, 2021 · 5 comments · Fixed by #622
Closed

Can't stop audio when i move to next screen #610

mvn-hainguyen-dn opened this issue Apr 7, 2021 · 5 comments · Fixed by #622

Comments

@mvn-hainguyen-dn
Copy link

mvn-hainguyen-dn commented Apr 7, 2021

I'm using this script <audio controls><source src='https://luta247.s3-ap-southeast-1.amazonaws.com/audios/605178e87091428979bb9d99_track1_audio.mp3' type='audio/ogg'></audio> to play audio. But when i move to next screen or move app to background , it still play!
This is my doctor -v:

[✓] Flutter (Channel stable, 2.0.3, on Mac OS X 10.14.6 18G5033 darwin-x64, locale en-US)
    • Flutter version 2.0.3 at /Users/mba0327/Documents/flutter/flutter
    • Framework revision 4d7946a68d (3 weeks ago), 2021-03-18 17:24:33 -0700
    • Engine revision 3459eb2436
    • Dart version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/mba0327/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✗] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] Connected device (2 available)
    • SM A500H (mobile) • 072156aa • android-arm    • Android 6.0.1 (API 23)
    • Chrome (web)      • chrome   • web-javascript • Google Chrome 89.0.4389.114


my device: Samsung galaxy A5

@mvn-hainguyen-dn mvn-hainguyen-dn changed the title Can't to stop audio when i move to next screen or move app to background Can't stop audio when i move to next screen or move app to background Apr 7, 2021
@mvn-hainguyen-dn mvn-hainguyen-dn changed the title Can't stop audio when i move to next screen or move app to background Can't stop audio when i move to next screen Apr 7, 2021
@tneotia
Copy link
Collaborator

tneotia commented Apr 7, 2021

Hm this is related to #274, but we closed that since we weren't able to reproduce it. I'm beginning to wonder if this is device specific.

Could you please edit your post with flutter doctor -v and your device details? Thanks!

For reference, I've tested the plugin in both debug and release on a Galaxy S8, Galaxy S10, Galaxy Note 20 Ultra, and a Galaxy Tab A. None have experienced this.

@mvn-hainguyen-dn
Copy link
Author

Thank you so much!

@tneotia
Copy link
Collaborator

tneotia commented Apr 13, 2021

Hi @mvn-hainguyen-dn, I created a PR above, if you could test that branch to see if its fixed that would be great, since I can't reproduce it on my devices.

You'll need to adjust the code a bit to add the dispose() method for the Html, see the updated README file for that branch for the recommended usage to help you.

@mvn-hainguyen-dn
Copy link
Author

My problem has been solved!

@tneotia
Copy link
Collaborator

tneotia commented Apr 14, 2021

Awesome, I'll update on the PR that the fix works. Thanks for checking it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants