Skip to content

Commit

Permalink
see changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya committed Mar 29, 2024
1 parent 200d1f0 commit f33c654
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 4 additions & 0 deletions packages/plugins/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## UnRelease

## 1.0.12-beta.3

- vtt thumbnails: `prefix` options

## 1.0.12-beta.2

- airplay support
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.12-beta.2",
"version": "1.0.12-beta.3",
"author": "shiyiya",
"description": "oplayer's plugin",
"homepage": "https://github.com/shiyiya/oplayer",
Expand Down
11 changes: 3 additions & 8 deletions packages/plugins/src/vttThumbnails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { $, Player } from '@oplayer/core'

type Thumbnails = {
src: string
prefix?: string
width?: number
height?: number
}
Expand Down Expand Up @@ -116,13 +117,7 @@ function plugin(player: Player, options?: Thumbnails) {
const imageProps = getPropsFromDef(vttImageDef)

cssObj.background =
'url("' +
mergeSrc(imageProps.image!) +
'") no-repeat -' +
imageProps.x +
'px -' +
imageProps.y +
'px'
'url("' + mergeSrc(imageProps.image!) + '") no-repeat -' + imageProps.x + 'px -' + imageProps.y + 'px'
cssObj.width = imageProps.w + 'px'
cssObj.height = imageProps.h + 'px'
cssObj.url = mergeSrc(imageProps.image!)
Expand All @@ -147,7 +142,7 @@ function plugin(player: Player, options?: Thumbnails) {
if (plain.startsWith('http://') && i < 7) return src + path

const fileName = plain.substring(i + 1) // 不包含 '/'
cache[path] = src.replace(fileName, path)
cache[path] = (options?.prefix || '') + src.replace(fileName, path)

return cache[path]
}
Expand Down

0 comments on commit f33c654

Please sign in to comment.