mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 17:51:20 -08:00
fix(dash): [PKG-DASH-MENU-01] preserve settings navigation during SDK refresh
This commit is contained in:
1 parent
30f646be97
commit
88ce836f85
21 files changed
+769
-23
No files matched your search
@@ -20,7 +20,18 @@ export default function artplayerPluginDashControl<Level extends object = Qualit
|
||||
const subscriptions: [EventName, Cleanup][] = []
|
||||
const observer = observeSDK<Level, Track>({
|
||||
active: dash => !closed && !art.isDestroy && art.dash === dash,
|
||||
refresh: update,
|
||||
refresh() {
|
||||
const dash = art.dash
|
||||
let version = revision
|
||||
const current = () => !closed && !art.isDestroy && art.dash === dash && revision === version
|
||||
const restore = quality.captureNavigation(current) || audio.captureNavigation(current)
|
||||
if (!current())
|
||||
return
|
||||
version++
|
||||
update()
|
||||
if (current())
|
||||
restore?.()
|
||||
},
|
||||
reset() {
|
||||
const version = ++revision
|
||||
clear(() => version === revision)
|
||||
|
||||
Reference in new issue
Block a user