inway / flutter_ringtone_player

Simple Flutter plugin to play ringtone, alarm & notification sounds
MIT License
92 stars 57 forks source link

RingTone is not playing - Use of stream types is deprecated #9

Closed carlfost closed 1 year ago

carlfost commented 4 years ago

My ringtone is not working in the webrtc project. The ringtone example worked, but when added to the webrtc project, it does not ring. My minSDK level is 21. The setStreamType() uses SDK < 21.

Here is a part of the messages from the debug/console screen: D/Ringtone(31862): Default File Path RINGTONE : /oem/OP/MPCS_US/media/audio/ringtones/00_Metro_Jingle.ogg, NOTIFICATION : /system/media/audio/notifications/Crystal.ogg, ALARM : /system/media/audio/alarms/Life_Is_Good_Alarm.ogg W/Ringtone(31862): Use of stream types is deprecated for operations other than volume control W/Ringtone(31862): See the documentation of setStreamType() for what to use instead with android.media.AudioAttributes to qualify your playback use case I/MediaPlayerNative(31862): constructor I/MediaPlayerNative(31862): setListener D/MediaPlayerEX(31862): EventHandlerEx D/RingtoneManagerEx(31862): getActualDefaultRingtoneUri type is 1 uriString iscontent://media/internal/audio/media/216 I/MediaPlayerNative(31862): attachNewPlayer V/PlayerBase(31862): updateAppOpsPlayAudio: unmuting player, vol=1.0/1.0 I/MediaPlayerNative(31862): MediaPlayer::setVolume(1.000000, 1.000000) I/MediaPlayerNative(31862): MediaPlayer::setAuxEffectSendLevel(0.000000) W/MediaPlayer(31862): Use of stream types is deprecated for operations other than volume control W/MediaPlayer(31862): See the documentation of setAudioStreamType() for what to use instead with android.media.AudioAttributes to qualify your playback use case V/PlayerBase(31862): updateAppOpsPlayAudio: unmuting player, vol=1.0/1.0 I/MediaPlayerNative(31862): MediaPlayer::setVolume(1.000000, 1.000000) I/MediaPlayerNative(31862): MediaPlayer::setAuxEffectSendLevel(0.000000) I/MediaPlayerNative(31862): MediaPlayer::setVolume(1.000000, 1.000000) I/MediaPlayerNative(31862): MediaPlayer::setLooping I/MediaPlayerNative(31862): setVideoSurfaceTexture I/MediaPlayerNative(31862): prepare I/MediaPlayerNative(31862): message received msg=200, ext1=1, ext2=9120 W/MediaPlayerNative(31862): info/warning (1, 9120) I/MediaPlayerNative(31862): message received msg=1, ext1=0, ext2=0 I/MediaPlayerNative(31862): MediaPlayer::notify() prepared I/flutter (31862): CANDIDATE LIST I/flutter (31862): {"candidate":"candidate:842163049 1 udp 1685987071 69.235.60.201 54734 typ srflx raddr 192.168.1.68 rport 54734 generation 0 ufrag 6rIB network-id 4 network-cost 10","sdpMid":"video","sdpMlineIndex":1} I/MediaPlayerNative(31862): invoke 68 D/Ringtone(31862): Successfully created local player D/AudioManager(31862): getStreamVolume() streamType= 2 Request Package= com.outafire.church_events I/MediaPlayer(31862): create HiFiDBObserver E/MediaPlayer(31862): Hi-Fi DAC Settings DB Error I/MediaPlayerNative(31862): start I/MediaPlayerNative(31862): invoke 68 I/MediaPlayerNative(31862): message received msg=6, ext1=0, ext2=0

Please help me with the possible cause of this issue. Thanks.

github-actions[bot] commented 1 year ago

This issue has stalled.

github-actions[bot] commented 1 year ago

This issue has been closed due to inactivity.