Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
903b4414
Commit
903b4414
authored
Apr 16, 2021
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 戴耳机接听来电时,通过耳机播放铃声 m-im 升级到18.51
parent
2b3ed756
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
config.gradle
config.gradle
+2
-2
AVChatSoundPlayer.java
m-im/src/main/java/com/yidianling/avchatkit/controll/AVChatSoundPlayer.java
+8
-3
No files found.
config.gradle
View file @
903b4414
...
@@ -10,7 +10,7 @@ ext {
...
@@ -10,7 +10,7 @@ ext {
"m-fm"
:
"0.0.30.03"
,
"m-fm"
:
"0.0.30.03"
,
"m-user"
:
"0.0.61.30"
,
"m-user"
:
"0.0.61.30"
,
"m-home"
:
"0.0.22.60"
,
"m-home"
:
"0.0.22.60"
,
"m-im"
:
"0.0.18.
49
"
,
"m-im"
:
"0.0.18.
51
"
,
"m-dynamic"
:
"0.0.7.21"
,
"m-dynamic"
:
"0.0.7.21"
,
"m-article"
:
"0.0.0.8"
,
"m-article"
:
"0.0.0.8"
,
...
@@ -93,7 +93,7 @@ ext {
...
@@ -93,7 +93,7 @@ ext {
"m-fm"
:
"0.0.30.01"
,
"m-fm"
:
"0.0.30.01"
,
"m-user"
:
"0.0.61.18"
,
"m-user"
:
"0.0.61.18"
,
"m-home"
:
"0.0.22.54"
,
"m-home"
:
"0.0.22.54"
,
"m-im"
:
"0.0.18.
40
"
,
"m-im"
:
"0.0.18.
51
"
,
"m-dynamic"
:
"0.0.7.19"
,
"m-dynamic"
:
"0.0.7.19"
,
"m-article"
:
"0.0.0.6"
,
"m-article"
:
"0.0.0.6"
,
...
...
m-im/src/main/java/com/yidianling/avchatkit/controll/AVChatSoundPlayer.java
View file @
903b4414
...
@@ -8,8 +8,8 @@ import android.media.AudioManager;
...
@@ -8,8 +8,8 @@ import android.media.AudioManager;
import
android.media.SoundPool
;
import
android.media.SoundPool
;
import
com.yidianling.avchatkit.AVChatKit
;
import
com.yidianling.avchatkit.AVChatKit
;
import
com.yidianling.im.R
;
import
com.yidianling.avchatkit.common.log.LogUtil
;
import
com.yidianling.avchatkit.common.log.LogUtil
;
import
com.yidianling.im.R
;
/**
/**
* SoundPool 铃声尽量不要超过1M
* SoundPool 铃声尽量不要超过1M
...
@@ -24,7 +24,8 @@ public class AVChatSoundPlayer {
...
@@ -24,7 +24,8 @@ public class AVChatSoundPlayer {
NO_RESPONSE
,
NO_RESPONSE
,
PEER_BUSY
,
PEER_BUSY
,
PEER_REJECT
,
PEER_REJECT
,
RING
,;
RING
,
;
}
}
private
Context
context
;
private
Context
context
;
...
@@ -81,6 +82,8 @@ public class AVChatSoundPlayer {
...
@@ -81,6 +82,8 @@ public class AVChatSoundPlayer {
ringId
=
R
.
raw
.
im_avchat_ring
;
ringId
=
R
.
raw
.
im_avchat_ring
;
loop
=
true
;
loop
=
true
;
break
;
break
;
default
:
break
;
}
}
if
(
ringId
!=
0
)
{
if
(
ringId
!=
0
)
{
...
@@ -116,12 +119,13 @@ public class AVChatSoundPlayer {
...
@@ -116,12 +119,13 @@ public class AVChatSoundPlayer {
private
void
initSoundPool
()
{
private
void
initSoundPool
()
{
stop
();
stop
();
if
(
soundPool
==
null
)
{
if
(
soundPool
==
null
)
{
soundPool
=
new
SoundPool
(
1
,
AudioManager
.
STREAM_
RING
,
0
);
soundPool
=
new
SoundPool
(
1
,
AudioManager
.
STREAM_
MUSIC
,
0
);
soundPool
.
setOnLoadCompleteListener
(
onLoadCompleteListener
);
soundPool
.
setOnLoadCompleteListener
(
onLoadCompleteListener
);
audioManager
=
(
AudioManager
)
context
.
getSystemService
(
Context
.
AUDIO_SERVICE
);
audioManager
=
(
AudioManager
)
context
.
getSystemService
(
Context
.
AUDIO_SERVICE
);
ringMode
=
audioManager
.
getRingerMode
();
ringMode
=
audioManager
.
getRingerMode
();
}
}
audioManager
.
requestAudioFocus
(
null
,
AudioManager
.
STREAM_MUSIC
,
AudioManager
.
AUDIOFOCUS_GAIN
);
registerVolumeReceiver
(
true
);
registerVolumeReceiver
(
true
);
}
}
...
@@ -149,6 +153,7 @@ public class AVChatSoundPlayer {
...
@@ -149,6 +153,7 @@ public class AVChatSoundPlayer {
context
.
registerReceiver
(
ringModeChangeReceiver
,
filter
);
context
.
registerReceiver
(
ringModeChangeReceiver
,
filter
);
}
else
{
}
else
{
context
.
unregisterReceiver
(
ringModeChangeReceiver
);
context
.
unregisterReceiver
(
ringModeChangeReceiver
);
audioManager
.
unloadSoundEffects
();
isRingModeRegister
=
false
;
isRingModeRegister
=
false
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment