Skip to content

Commit

Permalink
Update ede.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Xarth-Mai authored and Izumiko committed Feb 23, 2024
1 parent 1906cfc commit c70f762
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ede.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@
const currentTime = _media.currentTime;
const mode = parseInt(document.querySelector('input[name="danmakuMode"]:checked').value);
sendDanmaku(danmakuText, currentTime, mode);
// 清空输入框的值
document.getElementById('danmakuText').value = '';
modal.style.display = 'none';
modal.removeEventListener('keydown', event => event.stopPropagation(), true);
};
Expand Down Expand Up @@ -661,9 +663,10 @@
const json = await resp.json();
if (json.errorCode == 0) {
const colorStr = `000000${color.toString(16)}`.slice(-6);
const modemap = { 6: 'ltr', 1: 'rtl', 5: 'top', 4: 'bottom' }[mode];
const comment = {
text: danmakuText,
mode: mode,
mode: modemap,
time: time,
style: {
font: `${window.ede.fontSize}px sans-serif`,
Expand Down Expand Up @@ -808,6 +811,10 @@
await new Promise((resolve) => setTimeout(resolve, 200));
let sessionUrl = baseUrl + '/Sessions?ControllableByUserId=' + userId + '&deviceId=' + deviceId;
let sessionInfo = await getSessionInfo(sessionUrl, authorization);
if (!sessionInfo[0].NowPlayingItem) {
await initConfig();
continue;
}
playingInfo = sessionInfo[0].NowPlayingItem;
}
showDebugInfo('获取Item信息成功: ' + (playingInfo.SeriesName || playingInfo.Name));
Expand Down

0 comments on commit c70f762

Please sign in to comment.