Merge branch 'preview'

This commit is contained in:
the1812 2021-02-17 22:58:31 +08:00
commit 65b2d5ff37
9 changed files with 15 additions and 12 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -68,7 +68,7 @@
"danmaku-send-bar.min.css": "186013DAAC3E9E8C0B408CFA3D5C3F5BF702F25D435A386B384ECF3B5FBBBE18",
"danmaku-send-bar.min.js": "EACF3DFFD0CA5D3096B70DED1BEA81DBF35F3E0F831DDACFC9D3F2F4A50237F1",
"dark.min.css": "1CE3307FD898C79D389C4619734484088C791350280B9E035C03FBF75472D270",
"dark.user.css": "3342080D183482B378D06B3F95027222A096EF43ADD2672A02808B818A37813E",
"dark.user.css": "9AA1A7715E8E29CCEA9825661FE6BE47BF1977455B8CAD8A72F2D80E75F120C3",
"dark-color-scheme.min.js": "C83A38770DCEC5842E49617B07FFF97BCD6691982AFE40788ADC6A449C6474CB",
"dark-important.min.css": "5902E037E040A6C364391FE27885A118A8FD8B30A4B5E8C737C5FE5CFFB67F42",
"dark-navbar.min.css": "7FAD547E326B768904B3739C978DF86FFDDD5E5064FB8F490710D197CCC3018B",
@ -266,7 +266,7 @@
"video-info.min.js": "A81B4F409A75D818DF23C41A3F2D95E77BD0520DB6C03712F0FE30EAECDF4FBE",
"video-list.vue.min.js": "B227A114DD6A0D300524DF9BDBD2E870869DE6841F07749415C5E63184674BA0",
"video-speed-common.min.js": "1F8A81026E35390558C8D11EBCDC5455319D83B65EF16F54FD2AD4335E40CFD6",
"video-speed-controller.min.js": "B40EAFBC9D6A4F904A31AB73E5567EB09F70724B38E34F2C44F532E09A5BDE31",
"video-speed-controller.min.js": "7FF01EACAA1E4925EC8161B63085FB843C94CEADCF4E207F40D6CAEEEDD2CFAD",
"video-story.min.js": "DC3811422EE8696E12408E3CA6AD2E3D7068AAC1B0E3577A40C5613BAD5C6467",
"view-cover.min.js": "436B4D6408F375E822BA12CE31FF82CA7ECDF565A2D74AD26FF39DDA342C2C13",
"volume-overdrive.min.js": "10FDFBC393D785195039FD7A66E5E5D3E62BC0E7AC142DC8074CA84A226A48EE",

Binary file not shown.

View File

@ -3,7 +3,7 @@
@namespace Bilibili-Evolved
@homepageURL https://github.com/the1812/Bilibili-Evolved
@updateURL https://cdn.jsdelivr.net/gh/the1812/Bilibili-Evolved@preview/min/dark.user.css
@version 947.14.0
@version 947.30.0
@license MIT
@author Grant Howard (https://github.com/the1812), Coulomb-G (https://github.com/Coulomb-G)
==/UserStyle== */

File diff suppressed because one or more lines are too long

View File

@ -119,6 +119,10 @@ export class VideoSpeedController {
const { calcOrder } = await import("./video-speed-common")
// 有必要传递之前的 nativeSpeedVal跨分 P 时原生倍数将保持一样
const controller = await VideoSpeedController.getInstance(sharedSpeed)
containerElement = controller.containerElement
if (containerElement.classList.contains("extended")) {
return
}
if (settings.extendVideoSpeed) {
controller._menuListElement.prepend(...await getExtraSpeedMenuItemElements())
// 为所有原生倍速菜单项设置 Order
@ -143,8 +147,6 @@ export class VideoSpeedController {
})
}
controller.observe();
// 理论上这里的 controller 一定是非缓存的(换 P 的时候 containerElement 是会发生改变的),因此不用担心重复注册事件监听
({ containerElement } = controller)
containerElement.addEventListener("changed", ({ detail: { speed, isNativeSpeed } }: CustomEvent) => {
sharedSpeed = speed
if (isNativeSpeed) {
@ -155,6 +157,7 @@ export class VideoSpeedController {
setTimeout(() => {
controller.setVideoSpeed((settings.useDefaultVideoSpeed && settings.rememberVideoSpeed && VideoSpeedController.getRememberSpeed()) || VideoSpeedController.fallbackVideoSpeed || sharedSpeed)
}, 100)
containerElement.classList.add("extended")
})
})