Skip to content

Commit

Permalink
🐛 不慮の停止でキューがたまりすぎるのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
ci7lus committed Dec 20, 2021
1 parent 2b5c1a7 commit 7440a3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/miraktest-dplayer/components/DPlayerWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export const DPlayerWrapper: React.VFC<{
}, [])

const isPlayingRef = useRefFromState(isPlaying)
const isSeekableRef = useRefFromState(isSeekable)

useEffect(() => {
const playerInstance = new DPlayer({
Expand Down Expand Up @@ -92,7 +93,9 @@ export const DPlayerWrapper: React.VFC<{
playerInstance.danmaku.show()

playerInstance.on("pause" as DPlayer.DPlayerEvents.pause, () => {
isPlayingRef.current && playerInstance.play()
if (isSeekableRef.current === false || isPlayingRef.current === true) {
playerInstance.play()
}
})

player.current = playerInstance
Expand Down
2 changes: 1 addition & 1 deletion src/miraktest-dplayer/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const META = {
id: _ID,
name: "DPlayer",
author: "ci7lus",
version: "0.3.1",
version: "0.3.2",
description:
"映像の上にDPlayerを表示するプラグインです。別途コメントソースが必要です。",
}
Expand Down

0 comments on commit 7440a3f

Please sign in to comment.