-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
修复发送弹幕BUG #35
修复发送弹幕BUG #35
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
}; | ||
|
@@ -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`, | ||
|
@@ -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; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个分支进入的前提是已经获取到认证信息了,再调用initConfig是为了换个新的? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 哦哦,我没在Safari上测过,那就先这样吧 |
||
playingInfo = sessionInfo[0].NowPlayingItem; | ||
} | ||
showDebugInfo('获取Item信息成功: ' + (playingInfo.SeriesName || playingInfo.Name)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我看API文档那里,mode是个数字,你确定是用rtl这种字符串么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个danmaku跟dandanplay的不太一样
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
试了下确实是这样才正常
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
啊,我理解错了,danmaku.js的参数确实是字符串
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
往服务器发送的在644行
发的还是数字 但是本地播放器这个是转化成字符串