Commit c8432b98 by konghaorui

补充声网登录代码

parent caec909a
...@@ -45,13 +45,13 @@ ext { ...@@ -45,13 +45,13 @@ ext {
"m-confide" : "0.0.22", "m-confide" : "0.0.22",
"m-consultant" : "0.0.39", "m-consultant" : "0.0.39",
"m-course" : "0.0.25", "m-course" : "0.0.25",
"m-fm" : "0.0.17", "m-fm" : "0.0.20",
"m-muse" : "0.0.14", "m-muse" : "0.0.14",
"m-tests" : "0.0.11", "m-tests" : "0.0.11",
"m-user" : "0.0.32", "m-user" : "0.0.32",
//-------------- 业务模块 API 层 -------------- //-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.1", "m-audioim-api" : "0.0.2",
"m-confide-api" : "0.0.1", "m-confide-api" : "0.0.1",
"m-consultant-api": "0.0.3", "m-consultant-api": "0.0.3",
"m-course-api" : "0.0.2", "m-course-api" : "0.0.2",
...@@ -67,7 +67,7 @@ ext { ...@@ -67,7 +67,7 @@ ext {
"ydl-webview" : "0.0.27", "ydl-webview" : "0.0.27",
"ydl-media" : "0.0.13", "ydl-media" : "0.0.13",
"ydl-pay" : "0.0.10", "ydl-pay" : "0.0.10",
"m-audioim" : "0.0.16", "m-audioim" : "0.0.18",
//以下 几乎不会动 //以下 几乎不会动
"router" : "0.0.1", "router" : "0.0.1",
"ydl-net" : "0.0.2", "ydl-net" : "0.0.2",
...@@ -86,7 +86,7 @@ ext { ...@@ -86,7 +86,7 @@ ext {
"m-tests" : "0.0.4", "m-tests" : "0.0.4",
"m-user" : "0.0.25", "m-user" : "0.0.25",
//-------------- 业务模块 API 层 -------------- //-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.1", "m-audioim-api" : "0.0.2",
"m-confide-api" : "0.0.1", "m-confide-api" : "0.0.1",
"m-consultant-api": "0.0.3", "m-consultant-api": "0.0.3",
"m-course-api" : "0.0.2", "m-course-api" : "0.0.2",
...@@ -261,6 +261,7 @@ ext { ...@@ -261,6 +261,7 @@ ext {
"ydl-m-muse-api" : "com.ydl:m-muse-api:${ydlCompileVersion["m-muse-api"]}", "ydl-m-muse-api" : "com.ydl:m-muse-api:${ydlCompileVersion["m-muse-api"]}",
"ydl-m-fm-api" : "com.ydl:m-fm-api:${ydlCompileVersion["m-fm-api"]}", "ydl-m-fm-api" : "com.ydl:m-fm-api:${ydlCompileVersion["m-fm-api"]}",
"ydl-m-tests-api" : "com.ydl:m-tests-api:${ydlCompileVersion["m-tests-api"]}", "ydl-m-tests-api" : "com.ydl:m-tests-api:${ydlCompileVersion["m-tests-api"]}",
"ydl-m-audioim-api" : "com.ydl:m-audioim-api:${ydlCompileVersion["m-audioim-api"]}",
] ]
} }
...@@ -77,8 +77,10 @@ dependencies { ...@@ -77,8 +77,10 @@ dependencies {
//开发时使用 //开发时使用
api project(':ydl-platform') api project(':ydl-platform')
api project(':ydl-webview') api project(':ydl-webview')
implementation modularPublication('com.ydl:m-audioim-api')
}else { }else {
//发布时使用 //发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-audioim-api"]
api rootProject.ext.dependencies["ydl-webview"] api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) { api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true transitive = true
......
...@@ -6,7 +6,7 @@ modular { ...@@ -6,7 +6,7 @@ modular {
//发布信息 module/api 通用 //发布信息 module/api 通用
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-audioim-api" artifactId = "m-audioim-api"
version = "0.0.1" //version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖 // API 层打包时需要引入的依赖
apiDependencies { apiDependencies {
implementation "com.google.code.gson:gson:2.8.2" implementation "com.google.code.gson:gson:2.8.2"
......
package com.ydl.audioim package com.ydl.audioim
import android.content.Context
import com.ydl.audioim.api.AudioImApi import com.ydl.audioim.api.AudioImApi
/** /**
...@@ -7,6 +8,10 @@ import com.ydl.audioim.api.AudioImApi ...@@ -7,6 +8,10 @@ import com.ydl.audioim.api.AudioImApi
*/ */
class AudioImImpl: AudioImApi { class AudioImImpl: AudioImApi {
override fun init(context: Context?) {
}
override fun loginAgora(userId: String?) { override fun loginAgora(userId: String?) {
YDLavManager.instances.login(userId) YDLavManager.instances.login(userId)
} }
......
package com.ydl.audioim.api package com.ydl.audioim.api
import com.alibaba.android.arouter.facade.template.IProvider
/** /**
* 对外api接口 * 对外api接口
*/ */
interface AudioImApi { interface AudioImApi : IProvider {
/** /**
* 登录声网Im * 登录声网Im
......
...@@ -26,7 +26,6 @@ import com.ydl.media.audio.AudioPlayer; ...@@ -26,7 +26,6 @@ import com.ydl.media.audio.AudioPlayer;
import com.ydl.media.audio.OnPlayerEventListener; import com.ydl.media.audio.OnPlayerEventListener;
import com.ydl.media.audio.model.Music; import com.ydl.media.audio.model.Music;
import com.ydl.media.view.PlayerFloatHelper; import com.ydl.media.view.PlayerFloatHelper;
import com.ydl.media.view.PlayerFloatView;
import com.ydl.ydl_image.module.GlideApp; import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydl_image.transform.GlideCircleRingTransform; import com.ydl.ydl_image.transform.GlideCircleRingTransform;
import com.ydl.ydlcommon.base.BaseActivity; import com.ydl.ydlcommon.base.BaseActivity;
...@@ -62,7 +61,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers; ...@@ -62,7 +61,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
* Created by softrice on 15/12/11. * Created by softrice on 15/12/11.
*/ */
@Route(path = "/fm/detail") @Route(path = "/fm/detail")
public class FMDetailActivity extends BaseActivity implements View.OnClickListener, OnPlayerEventListener, PlayerFloatView.FloatViewPlayListener { public class FMDetailActivity extends BaseActivity implements View.OnClickListener, OnPlayerEventListener{
int id; int id;
boolean isSplash; boolean isSplash;
...@@ -227,7 +226,6 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen ...@@ -227,7 +226,6 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
init(); init();
initSurfaceView(); initSurfaceView();
initImg(); initImg();
PlayerFloatHelper.Companion.addClickListener(this);
} }
@SuppressLint("WrongConstant") @SuppressLint("WrongConstant")
...@@ -592,7 +590,6 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen ...@@ -592,7 +590,6 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
EventBus.getDefault().unregister(this); EventBus.getDefault().unregister(this);
AudioPlayer.Companion.get().removeOnPlayEventListener(this); AudioPlayer.Companion.get().removeOnPlayEventListener(this);
PlayerFloatHelper.Companion.removeClickListener(this);
} }
@Override @Override
...@@ -602,12 +599,14 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen ...@@ -602,12 +599,14 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
@Override @Override
public void onPlayerStart() { public void onPlayerStart() {
iv_play.setImageResource(R.drawable.fm_stop_2);
fmSurfaceView.playTimer();
} }
@Override @Override
public void onPlayerPause() { public void onPlayerPause() {
iv_play.setImageResource(R.drawable.fm_play_2);
fmSurfaceView.stopTimer();
} }
@Override @Override
...@@ -640,21 +639,4 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen ...@@ -640,21 +639,4 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
updateAnimateStatus(); updateAnimateStatus();
getFMDetail(fmDetail.getNext_id(), true); getFMDetail(fmDetail.getNext_id(), true);
} }
@Override
public void onPauseClick() {
iv_play.setImageResource(R.drawable.fm_play_2);
fmSurfaceView.stopTimer();
}
@Override
public void onStartClick() {
iv_play.setImageResource(R.drawable.fm_stop_2);
fmSurfaceView.playTimer();
}
@Override
public void onPlayFinish() {
}
} }
...@@ -84,9 +84,11 @@ dependencies { ...@@ -84,9 +84,11 @@ dependencies {
api project(':ydl-webview') api project(':ydl-webview')
api project(':ydl-platform') api project(':ydl-platform')
implementation modularPublication('com.ydl:m-user-api') implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-audioim-api')
}else { }else {
//发布时使用 //发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"] compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-audioim-api"]
api rootProject.ext.dependencies["ydl-webview"] api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) { api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true transitive = true
......
...@@ -36,22 +36,12 @@ object LoginUtils { ...@@ -36,22 +36,12 @@ object LoginUtils {
loginIm(userInfo) loginIm(userInfo)
//设置极光注册id //设置极光注册id
LoginHelper.setChannelId() LoginHelper.setChannelId()
//设置声网登录
UserIn.getAvImApi().loginAgora(userInfo?.uid)
val loginEvent = UserLoginEvent("login", userInfo?.uid!!) val loginEvent = UserLoginEvent("login", userInfo?.uid!!)
EventBus.getDefault().post(loginEvent) EventBus.getDefault().post(loginEvent)
BuryPointUtils.bindUid(userInfo?.uid ?: "") BuryPointUtils.bindUid(userInfo?.uid ?: "")
// val channelId = JPushUtils.getRegistrationID()
// UserHttpImpl.getInstance().channelId(ChannelIdParam(channelId))
// .compose(RxUtils.resultData())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(Consumer {
// if (it["upload_log"] == "1") {
// LogHelper.getInstance().uploadLog(false)
// }
// }, object : ThrowableConsumer() {
// override fun accept(msg: String) {
// // ToastHelper.show(msg)
// }
// })
} }
private fun loginIm(userInfo: UserResponseBean?) { private fun loginIm(userInfo: UserResponseBean?) {
......
...@@ -3,6 +3,8 @@ package com.yidianling.user.route ...@@ -3,6 +3,8 @@ package com.yidianling.user.route
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import com.ydl.audioim.api.AudioImApi
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.router.RouterManager import com.yidianling.router.RouterManager
import com.yidianling.router.im.IMLoginInfo import com.yidianling.router.im.IMLoginInfo
import com.yidianling.router.im.IMRequestCallback import com.yidianling.router.im.IMRequestCallback
...@@ -57,5 +59,9 @@ object UserIn { ...@@ -57,5 +59,9 @@ object UserIn {
fun clearImData() { fun clearImData() {
RouterManager.getImRouter().clear() RouterManager.getImRouter().clear()
} }
// 获取 声网 api
fun getAvImApi(): AudioImApi{
return ModularServiceManager.provide(AudioImApi::class.java)
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment