Skip to content

Commit

Permalink
see changelog.
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya committed Mar 15, 2024
1 parent 51daed2 commit 59bc73c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
6 changes: 6 additions & 0 deletions packages/plugins/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

## 1.0.10-beta.1

- playlist
- style fixed.
- show current playing index.

## 1.0.10-beta.1

- playlist
- add keyboard `l`.

Expand Down
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.10-beta.1",
"version": "1.0.10-beta.2",
"description": "oplayer's plugin",
"type": "module",
"main": "dist/index.es.js",
Expand Down
12 changes: 7 additions & 5 deletions packages/plugins/src/playlist.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@
justify-content: space-between;
background: #000;
border-bottom: 1px solid #484848;
font-size: 13px;
line-height: 38px;
padding: 0 5px 0 10px;
padding: 0.2em 0.4em;
align-items: center;
color: #fff;

> span {
font-size: 0.875em;
}
}

.playlist-head .playlist-back {
Expand All @@ -55,8 +57,8 @@
}

.playlist-head .playlist-back > svg {
width: 28px;
height: 28px;
width: 1.75em;
height: 1.75em;
fill: #fff;
pointer-events: none;
}
Expand Down
9 changes: 7 additions & 2 deletions packages/plugins/src/playlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export default class PlaylistPlugin implements PlayerPlugin {
})
.finally(() => {
this.currentIndex = idx
this._updateHeader()
this.$root.querySelector('.playlist-list-item.active')?.classList.remove('active')
$target?.classList.add('active')
setTimeout(() => {
Expand Down Expand Up @@ -263,10 +264,14 @@ export default class PlaylistPlugin implements PlayerPlugin {
)
.join('')

this._updateHeader()
this.$root.querySelector('.playlist-list')!.innerHTML = child
}

_updateHeader() {
this.$root.querySelector('.playlist-head-title')!.textContent = `${this.player.locales.get(
'PLAYLIST'
)} (${sources.length})`
this.$root.querySelector('.playlist-list')!.innerHTML = child
)} (${this.currentIndex}/${this.options.sources.length})`
}

destroy() {}
Expand Down

0 comments on commit 59bc73c

Please sign in to comment.