rxlabz / audioplayer

A flutter plugin to play audio files iOS / Android / MacOS / Web ( Swift/Java )

Home Page:https://pub.dartlang.org/packages/audioplayer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot play file online

glennmichaelmejias opened this issue · comments

W/MediaPlayer(13348): Use of stream types is deprecated for operations other than volume control
W/MediaPlayer(13348): See the documentation of setAudioStreamType() for what to use instead with android.media.AudioAttributes to qualify your playback use case
V/MediaHTTPService(13348): MediaHTTPService(android.media.MediaHTTPService@1757eac): Cookies: null
V/MediaHTTPService(13348): makeHTTPConnection: CookieManager created: java.net.CookieManager@a78775
V/MediaHTTPService(13348): makeHTTPConnection(android.media.MediaHTTPService@1757eac): cookieHandler: java.net.CookieManager@a78775 Cookies: null
I/DpmTcmClient(13348): RegisterTcmMonitor from: $Proxy0
D/NetworkSecurityConfig(13348): No Network Security Config specified, using platform default
E/MediaPlayerNative(13348): error (1, -2147483648)
E/MediaPlayer(13348): Error (1,-2147483648)

I am also facing the same issue.

 W/MediaPlayer: Use of stream types is deprecated for operations other than volume control
 W/MediaPlayer: See the documentation of setAudioStreamType() for what to use instead with android.media.AudioAttributes to qualify your playback use case

Solution:

W/MediaPlayer(13348): Use of stream types is deprecated for operations other than volume control
W/MediaPlayer(13348): See the documentation of setAudioStreamType() for what to use instead with android.media.AudioAttributes to qualify your playback use case
V/MediaHTTPService(13348): MediaHTTPService(android.media.MediaHTTPService@1757eac): Cookies: null
V/MediaHTTPService(13348): makeHTTPConnection: CookieManager created: java.net.CookieManager@a78775
V/MediaHTTPService(13348): makeHTTPConnection(android.media.MediaHTTPService@1757eac): cookieHandler: java.net.CookieManager@a78775 Cookies: null
I/DpmTcmClient(13348): RegisterTcmMonitor from: $Proxy0
D/NetworkSecurityConfig(13348): No Network Security Config specified, using platform default
E/MediaPlayerNative(13348): error (1, -2147483648)
E/MediaPlayer(13348): Error (1,-2147483648)

Solution:

  1. Open Android manifest.xml
  2. Create file network_security_config inside resource/xml with content:

File network_security_config.xml:
<?xml version="1.0" encoding="utf-8"?> <network-security-config> <base-config cleartextTrafficPermitted="true"> <trust-anchors> <certificates src="system" /> </trust-anchors> </base-config> </network-security-config>

  1. Add: android:networkSecurityConfig="@xml/network_security_config"

Screen Shot 2020-02-07 at 17 34 07

  1. Flutter clean
  2. Flutter run