直播结束,悬浮窗
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.yunbao.live.views;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
@@ -46,12 +47,15 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void builderFloat(Activity mContext, String url) {
|
||||
public void builderFloat(Activity mContext, String url,String tag) {
|
||||
if (TextUtils.isEmpty(tag)){
|
||||
tag = TAG;
|
||||
}
|
||||
liveOnInvokeView = new LiveOnInvokeView();
|
||||
this.mContext = mContext;
|
||||
this.url = url;
|
||||
EasyFloat.with(mContext)
|
||||
.setTag(TAG)
|
||||
.setTag(tag)
|
||||
.setLayout(R.layout.view_flaot_live, liveOnInvokeView)
|
||||
.setShowPattern(ShowPattern.CURRENT_ACTIVITY)
|
||||
.setGravity(Gravity.END | Gravity.CENTER_VERTICAL, 0, 200)
|
||||
@@ -88,15 +92,20 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
|
||||
if (callback != null) {
|
||||
callback.invoke(aBoolean);
|
||||
}
|
||||
builder.dismiss(new Function0<Unit>() {
|
||||
@Override
|
||||
public Unit invoke() {
|
||||
if (mPlayer != null && mPlayer.isPlaying() == 1) {
|
||||
mPlayer.stopPlay();
|
||||
}
|
||||
return null;
|
||||
builder.dismiss(() -> {
|
||||
if (mPlayer != null && mPlayer.isPlaying() == 1) {
|
||||
mPlayer.stopPlay();
|
||||
}
|
||||
return null;
|
||||
});
|
||||
builder.hide(view12 -> {
|
||||
if (mPlayer != null && mPlayer.isPlaying() == 1) {
|
||||
mPlayer.pauseAudio();
|
||||
mPlayer.pauseVideo();
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
return null;
|
||||
});
|
||||
return null;
|
||||
|
||||
@@ -384,7 +384,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
mContext.finish();
|
||||
} else {
|
||||
EventBus.getDefault()
|
||||
.post(new LiveFloatEvent()
|
||||
.postSticky(new LiveFloatEvent()
|
||||
.setmLiveBean(mLiveBean)
|
||||
.setmLiveSDK(mLiveSDK)
|
||||
.setmLiveType(mLiveType)
|
||||
@@ -400,7 +400,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
@Override
|
||||
public void onCancel() {
|
||||
EventBus.getDefault()
|
||||
.post(new LiveFloatEvent()
|
||||
.postSticky(new LiveFloatEvent()
|
||||
.setmLiveBean(mLiveBean)
|
||||
.setmLiveSDK(mLiveSDK)
|
||||
.setmLiveType(mLiveType)
|
||||
|
||||
Reference in New Issue
Block a user