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
13a9917b
Commit
13a9917b
authored
4 years ago
by
严久程
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
咨询声网接听页面外放
parent
1ed4124c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
42 deletions
+52
-42
config.gradle
config.gradle
+4
-4
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+1
-1
AudioPlayer.kt
m-audioim/src/main/java/com/ydl/audioim/player/AudioPlayer.kt
+41
-19
ConsultantAudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/consultantim/ConsultantAudioHomeActivity.kt
+4
-4
ExpertSearchActivity.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchActivity.kt
+0
-0
ExpertSearchFragment.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
+1
-3
ExpertSearchAdapter.kt
m-consultant/src/main/java/com/yidianling/consultant/adapter/ExpertSearchAdapter.kt
+1
-11
No files found.
config.gradle
View file @
13a9917b
...
...
@@ -42,8 +42,8 @@ ext {
ydlPublishVersion
=
[
// -------------- 业务模块 --------------
//第三步 若干
"m-confide"
:
"0.0.48.2
2
"
,
"m-consultant"
:
"0.0.59.
8
"
,
"m-confide"
:
"0.0.48.2
9
"
,
"m-consultant"
:
"0.0.59.
15
"
,
"m-fm"
:
"0.0.29.3"
,
"m-user"
:
"0.0.60.3"
,
"m-home"
:
"0.0.22.2"
,
...
...
@@ -75,7 +75,7 @@ ext {
"ydl-webview"
:
"0.0.38.29"
,
"ydl-media"
:
"0.0.20"
,
"ydl-pay"
:
"0.0.17"
,
"m-audioim"
:
"0.0.49.
0
"
,
"m-audioim"
:
"0.0.49.
8
"
,
"ydl-flutter-base"
:
"0.0.14.12"
,
//以下 几乎不会动
...
...
@@ -121,7 +121,7 @@ ext {
"ydl-webview"
:
"0.0.38.29"
,
"ydl-media"
:
"0.0.20"
,
"ydl-pay"
:
"0.0.17"
,
"m-audioim"
:
"0.0.49.
0
"
,
"m-audioim"
:
"0.0.49.
8
"
,
"ydl-flutter-base"
:
"0.0.10.9"
,
//以下 几乎不会动
...
...
This diff is collapsed.
Click to expand it.
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
13a9917b
...
...
@@ -190,7 +190,7 @@ class AudioHomeActivity :
LogUtil
.
e
(
"[agora]发生警告回调$warn"
)
runOnUiThread
{
when
(
warn
)
{
103
,
10
4
,
105
,
106
,
107
->
{
103
,
10
5
,
107
->
{
writeAgoraLog
(
"通话挂断:网络异常(${warn})"
)
showToast
(
"当前网络较差,请更换网络!"
)
//通话结束或挂断时,上传日志文件
...
...
This diff is collapsed.
Click to expand it.
m-audioim/src/main/java/com/ydl/audioim/player/AudioPlayer.kt
View file @
13a9917b
...
...
@@ -19,26 +19,46 @@ class AudioPlayer {
private
var
mContext
:
Context
?
=
null
private
var
audioManager
:
AudioManager
?
=
null
constructor
(
mContext
:
Context
?)
{
constructor
(
mContext
:
Context
?
,
isSpeakerphoneOn
:
Boolean
=
false
)
{
this
.
mContext
=
mContext
mPlayer
=
MediaPlayer
()
mPlayer
?.
setAudioStreamType
(
AudioManager
.
STREAM_VOICE_CALL
)
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
var
attributes
=
AudioAttributes
.
Builder
()
.
setLegacyStreamType
(
AudioManager
.
STREAM_VOICE_CALL
)
if
(
isSpeakerphoneOn
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
var
attributes
=
AudioAttributes
.
Builder
()
.
setLegacyStreamType
(
AudioManager
.
STREAM_MUSIC
)
.
build
()
mPlayer
?.
setAudioAttributes
(
attributes
)
mPlayer
?.
setAudioAttributes
(
attributes
)
}
else
{
mPlayer
?.
setAudioStreamType
(
AudioManager
.
STREAM_MUSIC
)
}
audioManager
=
mContext
!!
.
getSystemService
(
Context
.
AUDIO_SERVICE
)
as
AudioManager
?
audioManager
?.
setStreamVolume
(
AudioManager
.
STREAM_MUSIC
,
audioManager
!!
.
getStreamMaxVolume
(
AudioManager
.
STREAM_MUSIC
),
AudioManager
.
STREAM_MUSIC
)
}
else
{
mPlayer
?.
setAudioStreamType
(
AudioManager
.
STREAM_VOICE_CALL
)
}
audioManager
=
mContext
!!
.
getSystemService
(
Context
.
AUDIO_SERVICE
)
as
AudioManager
?
audioManager
?.
setStreamVolume
(
AudioManager
.
STREAM_VOICE_CALL
,
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
var
attributes
=
AudioAttributes
.
Builder
()
.
setLegacyStreamType
(
AudioManager
.
STREAM_VOICE_CALL
)
.
build
()
mPlayer
?.
setAudioAttributes
(
attributes
)
}
else
{
mPlayer
?.
setAudioStreamType
(
AudioManager
.
STREAM_VOICE_CALL
)
}
audioManager
=
mContext
!!
.
getSystemService
(
Context
.
AUDIO_SERVICE
)
as
AudioManager
?
audioManager
?.
setStreamVolume
(
AudioManager
.
STREAM_VOICE_CALL
,
audioManager
!!
.
getStreamMaxVolume
(
AudioManager
.
STREAM_VOICE_CALL
)
/
2
,
AudioManager
.
STREAM_VOICE_CALL
)
//默认听筒模式
audioManager
?.
isSpeakerphoneOn
=
false
AudioManager
.
STREAM_VOICE_CALL
)
}
audioManager
?.
isSpeakerphoneOn
=
isSpeakerphoneOn
}
...
...
@@ -48,7 +68,7 @@ class AudioPlayer {
*/
fun
setDataSource
(
id
:
Int
)
{
val
file
=
mContext
?.
resources
?.
openRawResourceFd
(
id
)
if
(
null
==
file
){
if
(
null
==
file
)
{
return
}
if
(
mPlayer
!=
null
)
{
...
...
@@ -146,11 +166,13 @@ class AudioPlayer {
*/
fun
requestFocus
()
{
try
{
val
result
=
audioManager
?.
requestAudioFocus
(
afChangeListener
,
// Use the music stream.
AudioManager
.
STREAM_VOICE_CALL
,
// Request permanent focus.
AudioManager
.
AUDIOFOCUS_GAIN
)
val
result
=
audioManager
?.
requestAudioFocus
(
afChangeListener
,
// Use the music stream.
AudioManager
.
STREAM_VOICE_CALL
,
// Request permanent focus.
AudioManager
.
AUDIOFOCUS_GAIN
)
}
catch
(
e
:
Exception
)
{
}
...
...
This diff is collapsed.
Click to expand it.
m-audioim/src/main/java/com/ydl/consultantim/ConsultantAudioHomeActivity.kt
View file @
13a9917b
...
...
@@ -263,7 +263,7 @@ class ConsultantAudioHomeActivity :
//107:打开频道请求被服务器拒绝。服务器可能没有办法处理该请求或该请求是非法的
runOnUiThread
{
when
(
warn
)
{
103
,
10
4
,
105
,
106
,
107
->
{
103
,
10
5
,
107
->
{
writeAgoraLog
(
"通话挂断:网络异常($warn)"
)
showToast
(
"当前网络较差,请更换网络!"
)
//通话结束或挂断时,上传日志文件
...
...
@@ -434,7 +434,7 @@ class ConsultantAudioHomeActivity :
wave_view
.
setInterpolator
(
AccelerateInterpolator
(
1.2f
))
//启动背景动画
wave_view
.
start
()
mPlayer
=
AudioPlayer
(
this
)
mPlayer
=
AudioPlayer
(
this
,
true
)
mPlayer
!!
.
setDataSource
(
R
.
raw
.
audioim_call_music
)
mPlayer
!!
.
start
(
isLooping
=
true
,
isSetOnCompletionListener
=
false
)
...
...
@@ -779,7 +779,7 @@ class ConsultantAudioHomeActivity :
*/
private
fun
playFinishMusic
()
{
if
(
mPlayer
==
null
)
{
mPlayer
=
AudioPlayer
(
this
)
mPlayer
=
AudioPlayer
(
this
,
true
)
}
mPlayer
!!
.
setDataSource
(
R
.
raw
.
audioim_hand_down_music
)
// mPlayer!!.switchPlayType(true)
...
...
@@ -802,7 +802,7 @@ class ConsultantAudioHomeActivity :
.
subscribe
({},
{},
{
if
(!
isConnectSuccess
)
{
writeAgoraLog
(
"通话未接通挂断:连接中的状态超过5s自动挂断"
)
showToast
(
"用户已挂断"
)
showToast
(
"用户已挂断"
)
close
(
RESULT_NOT_ANSWERED_CODE
,
""
)
}
})
...
...
This diff is collapsed.
Click to expand it.
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchActivity.kt
View file @
13a9917b
This diff is collapsed.
Click to expand it.
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
View file @
13a9917b
...
...
@@ -361,9 +361,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
v_loading
.
visibility
=
View
.
VISIBLE
v_loading
.
setViewType
(
LogoLoadingView
.
TYPE_LOADING
,
null
)
if
(
fromPageType
!=
-
1
)
{
doctorAdapter
.
setEntrance
(
fromPages
[
fromPageType
],
0
)
}
doctorAdapter
.
setEntrance
(
0
)
}
/**
...
...
This diff is collapsed.
Click to expand it.
m-consultant/src/main/java/com/yidianling/consultant/adapter/ExpertSearchAdapter.kt
View file @
13a9917b
...
...
@@ -59,11 +59,9 @@ class ExpertSearchAdapter(
var
hasMore
=
true
var
entranceName
:
String
?
=
null
var
pageIndex
:
Int
=
0
fun
setEntrance
(
entranceName
:
String
,
pageIndex
:
Int
)
{
this
.
entranceName
=
entranceName
fun
setEntrance
(
pageIndex
:
Int
)
{
this
.
pageIndex
=
pageIndex
}
...
...
@@ -465,14 +463,6 @@ class ExpertSearchAdapter(
}
else
{
ToastHelper
.
show
(
"请联系客服,专家参数错误!"
)
}
if
(!
TextUtils
.
isEmpty
(
entranceName
))
{
LogUtil
.
d
(
"entrance name: $entranceName"
)
BuryPointUtils
.
getInstance
().
createMap
()
.
put
(
"expert_entrance"
,
entranceName
?:
""
)
.
put
(
"expert_ID"
,
doctor
.
doctorId
?:
0
)
.
put
(
"expert_name"
,
doctor
.
name
?:
""
)
.
burryPoint
(
"Chat_click"
)
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
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