-
Notifications
You must be signed in to change notification settings - Fork 14
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
Conversation
@@ -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]; |
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.
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行
const danmakuUrl = apiPrefix + 'https://api.dandanplay.net/api/v2/comment/' + window.ede.episode_info.episodeId;
const params = {
'time': time,
'mode': mode,
'color': color,
'comment': danmakuText
};
const resp = await fetch(danmakuUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'User-Agent': navigator.userAgent,
'Authorization': 'Bearer ' + ddplayStatus.token
},
body: JSON.stringify(params)
});
发的还是数字 但是本地播放器这个是转化成字符串
if (!sessionInfo[0].NowPlayingItem) { | ||
await initConfig(); | ||
continue; | ||
} |
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.
这个分支进入的前提是已经获取到认证信息了,再调用initConfig是为了换个新的?
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.
哦哦,我没在Safari上测过,那就先这样吧
原本没正常处理mode值导致本地发的弹幕全部变成滚动,重新加载后本地还会变成两条重复弹幕