Skip to content

Commit

Permalink
fix(ad): correct ad skip duration timing and prevent 0s display (#150)
Browse files Browse the repository at this point in the history
* fix(ad): correct ad skip duration timing and prevent 0s display
  • Loading branch information
code-lish authored Jan 12, 2025
1 parent 575bae3 commit 204f1ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/plugins/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oplayer/plugins",
"version": "1.0.15-beta.1",
"version": "1.0.15-beta.2",
"author": "shiyiya",
"description": "oplayer's plugin",
"homepage": "https://github.com/shiyiya/oplayer",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/src/ad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default ({
if (skipDuration !== undefined) {
count++

if (skipDuration - count > -1) {
if (skipDuration - count > 0) {
$skip!.innerText = player.locales.get('Can be closed after %ss', skipDuration - count)
} else {
$skip!.innerText = player.locales.get('Close')
Expand All @@ -186,7 +186,7 @@ export default ({
}
}

if (duration - count > -1) {
if (duration - count > 0) {
$duration.innerText = player.locales.get('%ss', duration - count)
} else {
destroy()
Expand Down

0 comments on commit 204f1ca

Please sign in to comment.