Skip to content

Commit

Permalink
支持腾讯视频
Browse files Browse the repository at this point in the history
  • Loading branch information
SSShooter committed Sep 13, 2020
1 parent 6b9db12 commit 647f19c
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 8 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,19 @@ websocket-url 默认为 `synchime.herokuapp.com`,可以直接用,但是在
- 红色按钮:断开
- 蓝色按钮:发送信息
- 紫色按钮:同步时间
- 双击对话框最小化

输入对方 ID 后点击连接即可

## TODO

- 样式优化
- i18n

## 参考链接

https://segmentfault.com/a/1190000020780854

https://www.html5rocks.com/en/tutorials/webrtc/basics/

https://www.html5rocks.com/en/tutorials/webrtc/infrastructure/
4 changes: 2 additions & 2 deletions syncHime/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"description": "nope"
},
"save": {
"message": "save",
"message": "Save",
"description": "nope"
},
"saving": {
"message": "saving",
"message": "Saving",
"description": "nope"
}
}
6 changes: 5 additions & 1 deletion syncHime/domAppend.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ document.addEventListener("DOMContentLoaded", async function () {
await waitSec(2);
document.querySelector(".iqp-player").appendChild(div);
}
if (location.href.match("qq.com")) {
await waitSec(2);
document.querySelector(".txp_video_container").appendChild(div);
}
// document.body.appendChild(div)
});

Expand All @@ -39,4 +43,4 @@ function waitSec(sec) {
resolve();
}, sec * 1000);
});
}
}
4 changes: 2 additions & 2 deletions syncHime/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@
.svg-button {
width: 16px;
background: #ffca3a;
padding: 6px;
padding: 6px !important;
border-radius: 50%;
cursor: pointer;
margin-left: 8px;
margin-left: 8px !important;
}
#send {
background: #1982c4;
Expand Down
4 changes: 4 additions & 0 deletions syncHime/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ document.addEventListener("DOMContentLoaded", async function () {
await waitSec(2);
video = document.querySelector(".iqp-player video");
}
if (location.href.match("qq.com")){
await waitSec(2);
video = document.querySelector(".txp_video_container video");
}
const messageBox = document.querySelector("#message-box");
const connectWindow = document.querySelector("#connect-window");
const start = document.querySelector("#start-button");
Expand Down
5 changes: 3 additions & 2 deletions syncHime/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "syncHime",
"description": "一个 bilibili 视频时间同步插件,附带聊天功能",
"version": "1.2",
"version": "1.3",
"homepage_url": "https://github.com/ssshooter/syncHime",
"background": {
"scripts": [
Expand All @@ -14,7 +14,8 @@
"https://www.bilibili.com/video/*",
"https://www.bilibili.com/bangumi/play/*",
"https://www.iqiyi.com/v_*",
"https://www.youtube.com/watch*"
"https://www.youtube.com/watch*",
"https://v.qq.com/x/cover/*"
],
"js": [
"socket.io.js",
Expand Down
2 changes: 1 addition & 1 deletion syncHime/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ save.onclick = (e) => {
{ websocket: url.value, connectionType: type.value },
function () {
console.log("set");
save.innerText = "已保存";
save.innerText = chrome.i18n.getMessage("saving");
setTimeout(() => {
save.innerText = chrome.i18n.getMessage("save");
}, 1000);
Expand Down

0 comments on commit 647f19c

Please sign in to comment.