Skip to content

Commit

Permalink
修改使用artplayer进行播放,支持hlv和m3u8格式播放
Browse files Browse the repository at this point in the history
支持使用阿里云盘进行解码播放
调用暂停的时候,进行保存进度操作
  • Loading branch information
zxcvbnmzsedr committed Dec 23, 2024
1 parent 0f2865c commit d5f9c53
Show file tree
Hide file tree
Showing 9 changed files with 184 additions and 205 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
一个基于 Alist 的在线课程视频播放器插件,支持课程目录浏览、视频播放和进度记录等功能。

受够了使用emby看课程,所以自己写一个。

## 功能特点

- 🎯 课程目录树形展示
Expand All @@ -17,7 +18,7 @@
- Vue 3
- TypeScript
- Alist API
- xgplayer
- artplayer

## 快速开始

Expand Down Expand Up @@ -65,10 +66,8 @@ npm run build

## 运行效果


[在线预览](https://www.ztianzeng.com/alist-course-plugin/)


![截图](docs/config.png)

![截图](docs/list.png)
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"artplayer": "^5.2.1",
"axios": "^1.7.9",
"element-plus": "^2.9.1",
"flv.js": "^1.6.2",
"hls.js": "^1.5.18",
"natural-orderby": "^5.0.0",
"pinia": "^2.2.6",
"video.js": "^8.21.0",
"vite": "6.0.3",
"vue": "^3.5.13",
"vue-router": "^4.4.5",
"vue-tree-chart": "^1.2.9",
"xgplayer": "^3.0.20"
"vue-tree-chart": "^1.2.9"
},
"devDependencies": {
"@tsconfig/node22": "^22.0.0",
Expand Down
155 changes: 43 additions & 112 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions src/api/alist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ export const getFileInfo = async (path: string) => {
}
}

export const getOtherVideoPreview = async (path: string) => {
try {
const response = await alistApi.post('/api/fs/other', {
path,
method: 'video_preview',
password: ''
})
return response.data
} catch (error) {
console.error('获取文件信息失败:', error)
throw error
}
}

// 获取下载链接
export const getDownloadUrl = async (path: string) => {
try {
Expand Down
Loading

0 comments on commit d5f9c53

Please sign in to comment.