提交 24d8d849 authored 作者: kongdywang's avatar kongdywang

安卓补全通知

上级 d685f35b
......@@ -100,17 +100,32 @@ public class SuperPlatformPlayerView implements PlatformView, MethodChannel.Meth
@Override
public void onClickFloatCloseBtn() {
mEventSink.success("onClickFloatCloseBtn");
}
@Override
public void onSuperPlayerBackAction() {
mEventSink.success("onSuperPlayerBackAction");
}
@Override
public void onClickSmallReturnBtn() {
public void onStartFloatWindowPlay() {
mEventSink.success("onStartFloatWindowPlay");
}
@Override
public void onSuperPlayerDidStart() {
mEventSink.success("onSuperPlayerDidStart");
}
@Override
public void onStartFloatWindowPlay() {
public void onSuperPlayerDidEnd() {
mEventSink.success("onSuperPlayerDidEnd");
}
@Override
public void onSuperPlayerError() {
mEventSink.success("onSuperPlayerError");
}
@Override
......
......@@ -446,7 +446,7 @@ public class SuperPlayerView extends RelativeLayout {
break;
case WINDOW:// 当前是窗口模式,返回退出播放器
if (mPlayerViewCallback != null) {
mPlayerViewCallback.onClickSmallReturnBtn();
mPlayerViewCallback.onSuperPlayerBackAction();
}
break;
case FLOAT:// 当前是悬浮窗,退出
......@@ -628,12 +628,27 @@ public class SuperPlayerView extends RelativeLayout {
/**
* 点击小播放模式的返回按钮
*/
void onClickSmallReturnBtn();
void onSuperPlayerBackAction();
/**
* 开始悬浮窗播放
*/
void onStartFloatWindowPlay();
/**
* 播放开始通知
*/
void onSuperPlayerDidStart();
/**
* 播放结束通知
*/
void onSuperPlayerDidEnd();
/**
* 播放错误通知
*/
void onSuperPlayerError();
}
public void release() {
......@@ -694,6 +709,9 @@ public class SuperPlayerView extends RelativeLayout {
if (mWatcher != null) {
mWatcher.exitLoading();
}
if(mPlayerViewCallback != null) {
mPlayerViewCallback.onSuperPlayerDidStart();
}
}
@Override
......@@ -710,6 +728,9 @@ public class SuperPlayerView extends RelativeLayout {
if (mWatcher != null) {
mWatcher.stop();
}
if(null != mPlayerViewCallback) {
mPlayerViewCallback.onSuperPlayerDidEnd();
}
}
@Override
......@@ -787,6 +808,9 @@ public class SuperPlayerView extends RelativeLayout {
@Override
public void onError(int code, String message) {
showToast(message);
if(null != mPlayerViewCallback) {
mPlayerViewCallback.onSuperPlayerError();
}
}
};
......
......@@ -18,6 +18,21 @@ class SuperPlayerPlatformViewController {
_eventHandler(event) {
if(event == null) return;
if(event is String) {
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
print(event);
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
switch(event) {
case SuperPlayerViewEvent.onStartFullScreenPlay:
break;
case SuperPlayerViewEvent.onStopFullScreenPlay:
break;
case SuperPlayerViewEvent.onSuperPlayerBackAction:
break;
}
}
_eventStreamController.add(event);
}
......
......@@ -53,8 +53,14 @@ enum TXPlayerEvent{
}
abstract class SuperPlayerViewEvent{
static const onStartFullScreenPlay = "onStartFullScreenPlay";
static const onStopFullScreenPlay = "onStopFullScreenPlay";
static const onStartFullScreenPlay = "onStartFullScreenPlay"; // 进入全屏播放
static const onStopFullScreenPlay = "onStopFullScreenPlay"; // 退出全屏播放
static const onSuperPlayerBackAction = "onSuperPlayerBackAction"; // 窗口模式触发左上角返回按钮
static const onClickFloatCloseBtn = "onClickFloatCloseBtn"; // 浮窗模式触发关闭按钮
static const onStartFloatWindowPlay = "onStartFloatWindowPlay"; // 开始进入浮窗模式
static const onSuperPlayerDidStart = "onSuperPlayerDidStart"; // 播放开始通知
static const onSuperPlayerDidEnd = "onSuperPlayerDidEnd"; // 播放结束通知
static const onSuperPlayerPause = "onSuperPlayerPause"; // 播放暂停通知
}
class SuperPlayerUrl {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论