客户端播放音乐时,多次推送给客户端

This commit is contained in:
wulin 2023-10-28 22:24:41 +08:00
parent 9d8bc48c35
commit 18647a3951
2 changed files with 4 additions and 1 deletions

View File

@ -76,6 +76,7 @@ public class MusicActionCommand extends ActionCommand implements IActionCommand
log.info("推送Box播放音乐"); log.info("推送Box播放音乐");
BoxSession boxSession = baseWebSocketService.getBoxSessionWithSn(baseSession.getSn()); BoxSession boxSession = baseWebSocketService.getBoxSessionWithSn(baseSession.getSn());
if(boxSession != null){ if(boxSession != null){
baseWebSocketService.sendMsg(boxSession, resp);
//记录音乐状态 //记录音乐状态
if(resp.getMusic().getPlay().equals(PlayEnum.STOP.getCode())){ if(resp.getMusic().getPlay().equals(PlayEnum.STOP.getCode())){
//去掉内存中音乐同步对象 //去掉内存中音乐同步对象

View File

@ -303,10 +303,12 @@ public class BaseWebSocketService {
} }
return; return;
} }
} }else{
sendMsg(baseSession, JSONObject.toJSONString(baseMessageResp)); sendMsg(baseSession, JSONObject.toJSONString(baseMessageResp));
} }
}
/** /**
* 分批按顺序发送超长ONE_MAX_TEXT文本音频 * 分批按顺序发送超长ONE_MAX_TEXT文本音频
* @param baseSession * @param baseSession