Compare commits

...

39 Commits

Author SHA1 Message Date
hunlongyu
1dbd07faae 🎈 优化视频自适应大小 2020-06-13 10:24:11 +08:00
Hunlongyu
4dec62aa9c Merge pull request #101 from WinterSoHot/master
fix(Play.vue):播放界面自适应窗口
2020-06-13 10:19:41 +08:00
Dongxian Gu
1f781ae92d fix(Play.vue):播放界面自适应窗口 2020-06-12 23:17:56 +08:00
hunlongyu
4717299ae6 🤣 新增分享演示 2020-06-05 23:24:18 +08:00
hunlongyu
8d40cbd5fc 😶 移除测试代码 2020-06-05 11:14:49 +08:00
hunlongyu
4c8fa08166 🙄 解决 Mac 下 dock 栏不显示图标问题 2020-06-05 11:09:52 +08:00
hunlongyu
ac513fbce6 🙄 解决 Mac 下 dock 栏不显示图标问题 2020-06-05 11:09:19 +08:00
hunlongyu
9321d3a5d9 Merge branch 'master' of https://github.com/Hunlongyu/ZY-Player 2020-06-05 10:26:41 +08:00
hunlongyu
0f2776fb1c 😁 移除测试代码 2020-06-05 10:26:37 +08:00
Hunlongyu
b577ce12c1 Merge pull request #77 from zhangweiii/master
修复Mac下dock栏不显示图标
2020-06-05 10:25:16 +08:00
zhangweiii
fa4c4e22fd 修复Mac下dock栏不显示图标 2020-06-04 10:53:02 +08:00
hunlongyu
a93d4042ba 🎢 修复 Mac 电脑无法完全退出的BUG 2020-06-02 10:54:17 +08:00
hunlongyu
09bd9d8401 😊 成功测试打包32位安装包 2020-06-01 18:14:31 +08:00
hunlongyu
588e52c330 😌 尝试v1 2020-06-01 17:00:58 +08:00
hunlongyu
6c4e110bb8 😫 再次尝试x86 2020-06-01 16:59:38 +08:00
hunlongyu
54857b8501 🥱 尝试x86 2020-06-01 16:52:39 +08:00
hunlongyu
a8a6fa2185 😶 白天写BUG, 晚上改BUG 2020-05-31 22:34:30 +08:00
hunlongyu
0e571efd6f 😑 日常写BUG, 改BUG 2020-05-31 13:40:34 +08:00
hunlongyu
79adbd1f81 😑 日常写BUG, 改BUG 2020-05-30 16:14:26 +08:00
hunlongyu
214a267ba5 😥 紧急修复bug 2020-05-29 14:29:53 +08:00
hunlongyu
7aee9b9fbe 😅 解决收藏夹点击播放,没有历史记录的问题 2020-05-29 11:52:09 +08:00
hunlongyu
010b488340 😋 修复精简模式下切换视频无法保留历史记录的问题 2020-05-27 09:49:56 +08:00
hunlongyu
03c32d8ee2 😥 修改说明文字 2020-05-25 22:32:38 +08:00
hunlongyu
203d2c19fd 😂 Mini 窗口支持倍速快捷键 2020-05-25 22:31:10 +08:00
hunlongyu
0ed25643fc 😅 升级依赖 2020-05-25 22:04:18 +08:00
hunlongyu
ba99e65bcb 😅 新增快捷键视频倍速 2020-05-25 22:00:23 +08:00
hunlongyu
169b28ab33 💦 播放速度 2020-05-25 18:23:03 +08:00
hunlongyu
cbcffd7587 😣x86 fail 2020-05-24 14:57:39 +08:00
hunlongyu
fc26c04666 🤨 x86 2020-05-24 14:29:20 +08:00
hunlongyu
e2cda9a100 😃 优化样式 2020-05-24 14:11:14 +08:00
hunlongyu
ffe432d19e 🧡 新增友情链接 2020-05-21 14:27:39 +08:00
hunlongyu
ae31e9ba74 💦 更新挂掉的图片 2020-05-20 14:29:33 +08:00
hunlongyu
24f78563b6 ☯ 新增快捷键说明 2020-05-20 14:00:56 +08:00
hunlongyu
8c0e35e766 🎎 新增全局监听 2020-05-20 11:39:46 +08:00
hunlongyu
f94d00e36c 😂 官网链接 2020-05-18 09:47:11 +08:00
hunlongyu
c0c4d9ad88 🎊 更新Readme 2020-05-18 09:42:42 +08:00
hunlongyu
3afa38beb7 🎉 正式版v1.0.0发布 2020-05-18 09:26:08 +08:00
hunlongyu
68fe961791 😱 修复bug 2020-05-13 13:41:53 +08:00
hunlongyu
3d7a686ca7 😥 重置后,关闭软件. 2020-05-13 13:33:50 +08:00
19 changed files with 450 additions and 10305 deletions

View File

@@ -24,4 +24,4 @@ jobs:
yarn release
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

35
.github/workflows/x86.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: release-build
on:
push:
tags:
- x86 *
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: |
yarn
yarn dist
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: dist_electron
path: dist_electron/*.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,5 +1,9 @@
<p align="center">
<img src="https://i.loli.net/2020/05/07/9kLvPnWVCp7538c.png" >
<img width="128" src="https://i.loli.net/2020/05/07/9kLvPnWVCp7538c.png" >
</p>
<p align="center">
<a href="http://zyplayer.fun/" target="_blank">官网</a>
<a href="https://github.com/Hunlongyu/ZY-Player/issues" target="_blank">反馈</a>
</p>
<p align="center">
<img src="https://forthebadge.com/images/badges/built-with-love.svg">
@@ -18,30 +22,67 @@
<p>
## ZY Player
## ZY Player 资源播放器
1. 全平台支持. Windows, Mac, Linux
2. 12个视频源. 未来更新更多的视频源
3. 新增历史播放记录, 并记录播放进度
4. 新增分享功能. 一键分享海报图片
5. 新增精简模式. 支持修改透明度
6. 收藏夹同步更新视频追剧
7. 支持演员名称搜索
8. 更详细的视频分类
9. 后台自动更新
10. 全新布局配色
11. 新增多语言
12. 全局快捷键
13. 下载功能
14. ...
### 新版内测
觉得软件不错的, 点击右上角 star 收藏关注一波呀~
新版本: v0.9.x 已开发完, 现进行内测, [点击查看内测公告](https://github.com/Hunlongyu/ZY-Player/issues/24)
> Tips: 资源加载不出来时, 点击列表下方链接, 浏览器打开一下网站. 原理是需要通过网站的人机检测.
[点击这里可以查看开发计划](https://github.com/Hunlongyu/ZY-Player/projects/3).
#### 全局快捷键:
大家有什么新的需求建议欢迎踊跃提出[点击这里提意见](https://github.com/Hunlongyu/ZY-Player/issues/14)
觉得软件不错的, 请点击 star 收藏一波呀~
<img height="30" src="https://i.loli.net/2020/05/09/cNnvGobekWEqfjZ.jpg">
| 快捷键 | 说明 | 主界面 | 小窗口 |
| :----------------------: | ---------- | :----: | :----: |
| `⌘ + →``Ctrl + →` | 下一集 | √ | √ |
| `⌘ + ←``Ctrl + ←` | 上一集 | √ | √ |
| `⌘ + ↑``Ctrl + ↑` | 减少透明度 | | √ |
| `⌘ + ↓``Ctrl + ↓` | 增加透明度 | | √ |
| `Shift + ↑` | 增加倍速 + 0.25 | √ | √ |
| `Shift + ↓` | 减少倍速 - 0.25 | √ | √ |
#### 下载:
1. [Github -- 官方下载](https://github.com/Hunlongyu/ZY-Player/releases)
1. [Github -- 官方下载(最新版)](https://github.com/Hunlongyu/ZY-Player/releases)
2. [蓝奏云 -- 快速下载](https://www.lanzous.com/b04s6a3re) 密码:95px
2. [蓝奏云 -- 快速下载(老版本)](https://www.lanzous.com/b04s6a3re) 密码:95px
3. 适用于32位操作系统的x86软件,在蓝奏云网盘里, 后缀名: ZY Player * 32位.exe
#### 截图:
![001.png](https://i.loli.net/2020/04/28/T3YZvStwNQJ5aHy.png)
![003.png](https://i.loli.net/2020/04/28/2xYw9nIyWSZ5Rsr.png)
![002.png](https://i.loli.net/2020/04/28/sxnY28hgFcpUrb9.png)
0. 分享 ⇣ ↓
![share.gif](https://i.loli.net/2020/06/05/hbJwBXlx194umcO.gif)
1. 浏览 ⇣ ↓
![01浏览.png](https://i.loli.net/2020/05/18/MshDLnXq2CTpoBy.png)
2. 搜索 ⇣ ↓
![02搜索.png](https://i.loli.net/2020/05/20/QgJqDkcjpeiRvBb.png)
3. 详情 ⇣ ↓
![03详情.png](https://i.loli.net/2020/05/18/s7gUj6unEfyYb4Z.png)
4. 播放 ⇣ ↓
![04播放.png](https://i.loli.net/2020/05/18/WqgnOw3mHd6e5uU.png)
5. 收藏 ⇣ ↓
![05收藏.png](https://i.loli.net/2020/05/18/bhIgeGMTPWmrdYi.png)
6. 白色主题皮肤 ⇣ ↓
![06白色.png](https://i.loli.net/2020/05/18/UgiVZ89dhkuxDBI.png)
7. 绿色主题皮肤 ⇣ ↓
![07绿色.png](https://i.loli.net/2020/05/18/4d2UnFRECm7vyJQ.png)
8. 粉色色主题皮肤 ⇣ ↓
![08粉色.png](https://i.loli.net/2020/05/18/PLlEfzd8mSC9vMW.png)
### 重要:
所有资源来自网上, 该软件不参与任何制作, 上传, 储存, 下载等内容. 该软件仅供学习参考, 请于安装后24小时内删除.

View File

@@ -233,7 +233,7 @@
<h4>友情链接</h4>
<ul>
<li><i class="bx bx-chevron-right"></i> <a target="_blank" href="#">Home</a></li>
<li><i class="bx bx-chevron-right"></i> <a target="_blank" href="https://github.com/Hunlongyu/ZY-Player">Github</a></li>
<li><i class="bx bx-chevron-right"></i> <a target="_blank" href="https://www.ghpym.com/zyplayer.html">果核剥壳</a></li>
</ul>
</div>

View File

@@ -1,6 +1,6 @@
{
"name": "zy",
"version": "0.9.35",
"version": "1.0.20",
"private": true,
"author": {
"name": "Hunlongyu",
@@ -16,25 +16,26 @@
"postinstall": "electron-builder install-app-deps",
"postuninstall": "electron-builder install-app-deps",
"electron:generate-icons": "electron-icon-builder --input=./public/icon.png --output=build --flatten",
"release": "vue-cli-service electron:build -p always"
"release": "vue-cli-service electron:build -p always",
"dist": "vue-cli-service electron:build --win --ia32"
},
"main": "background.js",
"dependencies": {
"axios": "^0.19.2",
"core-js": "^3.6.5",
"dexie": "^2.0.4",
"electron-updater": "^4.2.5",
"element-ui": "^2.13.1",
"electron-updater": "^4.3.1",
"element-ui": "^2.13.2",
"html2canvas": "^1.0.0-rc.5",
"leancloud-storage": "^4.5.3",
"macaddress": "^0.2.9",
"macaddress": "^0.5.1",
"modern-normalize": "^0.6.0",
"qrcode.vue": "^1.7.0",
"vue": "^2.6.11",
"vue-i18n": "^8.17.0",
"vuex": "^3.1.3",
"xgplayer": "^2.6.20",
"xgplayer-hls.js": "^2.2.0"
"vue-i18n": "^8.17.7",
"vuex": "^3.4.0",
"xgplayer": "^2.7.1",
"xgplayer-hls.js": "^2.2.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.3.0",
@@ -44,7 +45,7 @@
"@vue/eslint-config-standard": "^5.1.2",
"babel-eslint": "^10.1.0",
"babel-plugin-component": "^1.1.1",
"electron": "^8.2.5",
"electron": "^9.0.0",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",

View File

@@ -93,7 +93,7 @@
width: 120px;
}
&.operate{
width: 120px;
width: 170px;
}
}
}
@@ -133,7 +133,7 @@
width: 120px;
}
&.operate{
width: 120px;
width: 170px;
}
}
}
@@ -151,6 +151,9 @@
padding-left: 10px;
font-size: 12px;
}
.btn{
cursor: pointer;
}
}
}

View File

@@ -8,21 +8,20 @@ import {
import path from 'path'
import { autoUpdater } from 'electron-updater'
const isDevelopment = process.env.NODE_ENV !== 'production'
const globalShortcut = require('electron').globalShortcut
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let win
let mini
// Scheme must be registered before the app is ready
protocol.registerSchemesAsPrivileged([{ scheme: 'app', privileges: { secure: true, standard: true } }])
function createWindow () {
function createWindow() {
win = new BrowserWindow({
width: 1080,
height: 720,
frame: false,
resizable: false,
resizable: true,
transparent: true,
webPreferences: {
webSecurity: false,
@@ -45,7 +44,7 @@ function createWindow () {
})
}
function createMini () {
function createMini() {
mini = new BrowserWindow({
width: 550,
minWidth: 260,
@@ -75,12 +74,18 @@ function createMini () {
})
}
if (process.platform === 'darwin') {
app.dock.show()
}
app.allowRendererProcessReuse = true
app.commandLine.appendSwitch('disable-features', 'OutOfBlinkCors')
if (process.platform === 'Linux') {
app.disableHardwareAcceleration()
}
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
app.quit()
})
app.on('activate', () => {
@@ -128,6 +133,48 @@ if (!gotTheLock) {
// 创建 win, 加载应用的其余部分, etc...
app.on('ready', () => {
globalShortcut.register('CommandOrControl+right', function () {
if (win) {
win.webContents.send('next', 0)
}
if (mini) {
mini.webContents.send('next', 0)
}
})
globalShortcut.register('CommandOrControl+left', function () {
if (win) {
win.webContents.send('prev', 0)
}
if (mini) {
mini.webContents.send('prev', 0)
}
})
globalShortcut.register('CommandOrControl+up', function () {
if (mini) {
mini.webContents.send('up', 0)
}
})
globalShortcut.register('CommandOrControl+down', function () {
if (mini) {
mini.webContents.send('down', 0)
}
})
globalShortcut.register('shift+up', function () {
if (win) {
win.webContents.send('playbackRateUp', 0)
}
if (mini) {
mini.webContents.send('playbackRateUp', 0)
}
})
globalShortcut.register('shift+down', function () {
if (win) {
win.webContents.send('playbackRateDown', 0)
}
if (mini) {
mini.webContents.send('playbackRateDown', 0)
}
})
if (!process.env.WEBPACK_DEV_SERVER_URL) {
createProtocol('app')
}

View File

@@ -136,10 +136,10 @@ export default {
left: 0;
bottom: 0;
width: 100%;
height: 680px;
height: calc(100% - 40px);
z-index: 999;
.detail-content{
height: 680px;
height: calc(100% - 10px);
padding: 0 60px;
position: relative;
.detail-header{
@@ -157,14 +157,14 @@ export default {
}
}
.detail-body{
height: 630px;
height: calc(100% - 50px);
overflow-y: auto;
.info{
display: flex;
justify-content: flex-start;
align-items: flex-start;
flex-wrap: wrap;
width: 955px;
width: 100%;
padding: 10px;
border: 1px solid;
border-radius: 2px;
@@ -256,7 +256,7 @@ export default {
.desc{
border: 1px solid;
padding: 10px;
width: 955px;
width: 100%;
margin-bottom: 10px;
border-radius: 2px;
font-size: 14px;
@@ -265,7 +265,7 @@ export default {
.m3u8_urls, .mp4_urls{
border: 1px solid;
padding: 10px;
width: 955px;
width: 100%;
margin-bottom: 10px;
border-radius: 2px;
.title{
@@ -295,10 +295,11 @@ export default {
}
}
.detail-mask{
width: 980px;
height: 600px;
position: absolute;
top: 50px;
left: 0;
width: 100%;
height: calc(100% - 50px);
display: flex;
justify-content: center;
align-items: center;

View File

@@ -59,6 +59,7 @@
<span class="btn" @click.stop="playEvent(i)">{{$t('play')}}</span>
<span class="btn" @click.stop="starEvent(i)">{{$t('star')}}</span>
<span class="btn" @click.stop="shareEvent(i)">{{$t('share')}}</span>
<span class="btn" @click.stop="downloadEvent(i)">{{$t('download')}}</span>
</span>
</li>
</ul>
@@ -68,6 +69,7 @@
</div>
<div class="tFooter">
<span class="tFooter-span">今日更新: {{ tb.update }} </span>
<span class="tFooter-span btn" @click="goWebsite">加载不出来,点这里</span>
<el-pagination small :page-size="tb.size" :total="tb.total" :current-page="tb.page" @current-change="tbPageChange" layout="total, prev, pager, next, jumper"></el-pagination>
</div>
</div>
@@ -80,6 +82,8 @@ import { sites, getSite } from '../lib/site/sites'
import tools from '../lib/site/tools'
import video from '../lib/dexie/video'
import setting from '../lib/dexie/setting'
import { shell } from 'electron'
const { clipboard } = require('electron')
export default {
name: 'film',
data () {
@@ -261,6 +265,33 @@ export default {
v: e
}
},
downloadEvent (e) {
tools.detail_get(e.site, e.detail).then(res => {
if (res.mp4_urls.length > 0) {
const urls = [...res.mp4_urls]
let txt = `${e.name}\n`
for (const i of urls) {
const name = i.split('$')[0]
const url = encodeURI(i.split('$')[1])
txt += (name + ': ' + url + '\n')
}
clipboard.writeText(txt)
this.$m.success('〖MP4〗: ' + this.$t('copy_success'))
return false
}
if (res.m3u8_urls.length > 0) {
const urls = [...res.m3u8_urls]
let txt = `${e.name}\n`
for (const i of urls) {
const name = i.split('$')[0]
const url = encodeURI(i.split('$')[1])
txt += (name + ': ' + url + '\n')
}
clipboard.writeText(txt)
this.$m.success('〖M3U8〗: ' + this.$t('copy_success'))
}
})
},
tbPageChange (e) {
this.tb.loading = true
this.tb.page = e
@@ -268,6 +299,9 @@ export default {
this.tb.list = res.list
this.tb.loading = false
})
},
goWebsite () {
shell.openExternal(this.site.url)
}
},
created () {
@@ -277,7 +311,7 @@ export default {
</script>
<style lang="scss" scoped>
.film{
height: 670px;
height: calc(100% - 40px);
width: 100%;
display: flex;
flex-direction: column;
@@ -323,7 +357,7 @@ export default {
}
}
.middle{
height: 620px;
height: calc(100% - 40px);
width: 100%;
margin-top: 10px;
padding-bottom: 0px;

View File

@@ -1,7 +1,8 @@
<template>
<div class="play">
<div class="box">
<div class="title">{{name}}</div>
<div class="title" v-if="length === 1">{{name}}</div>
<div class="title" v-if="length > 1"> {{(video.index + 1)}} {{name}}</div>
<div class="xgBox">
<div id="xg"></div>
</div>
@@ -124,8 +125,8 @@ export default {
id: 'xg',
lang: 'zh-cn',
url: '',
width: 900,
height: 500,
width: '100%',
height: '100%',
autoplay: false,
videoInit: true,
screenShot: true,
@@ -136,6 +137,7 @@ export default {
playbackRate: [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 3, 4, 5]
},
name: '',
length: 0,
timer: null,
scroll: false,
more: true,
@@ -199,37 +201,49 @@ export default {
methods: {
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE']),
getUrls () {
this.name = ''
this.mask = true
if (this.timer !== null) {
clearInterval(this.timer)
this.timer = null
}
if (this.xg) {
this.xg.pause()
}
this.changeVideo()
tools.detail_get(this.video.site, this.video.detail).then(res => {
this.name = this.video.name
this.right.listData = res.m3u8_urls
if (res.m3u8_urls.length > 1) {
const m3 = res.m3u8_urls
const arr = []
for (const i of m3) {
arr.push(i.split('$')[1])
}
this.xg.src = arr[this.video.index]
this.showNext = true
} else {
const link = res.m3u8_urls[this.video.index]
const src = link.split('$')[1]
this.xg.src = src
this.showNext = false
if (this.xg.hasStart) {
this.xg.pause()
}
const currentTime = this.video.currentTime
if (currentTime !== '') {
}
const index = this.video.index
let time = 0
history.find({ detail: this.video.detail }).then(item => {
if (item) {
if (item.index === index) {
time = item.currentTime
}
}
this.playVideo(index, time)
})
},
playVideo (index, time) {
tools.detail_get(this.video.site, this.video.detail).then(res => {
this.name = res.name
this.right.listData = res.m3u8_urls
const m = res.m3u8_urls
const arr = []
for (const i of m) {
arr.push(i.split('$')[1])
}
this.length = arr.length
this.xg.src = arr[index]
this.showNext = this.length > 1
if (time !== 0) {
this.xg.play()
this.xg.once('playing', () => {
this.xg.currentTime = currentTime
this.xg.currentTime = time
})
} else {
this.xg.play()
@@ -250,7 +264,6 @@ export default {
changeVideo () {
this.checkStar()
this.checkTop()
this.name = ''
},
checkStar () {
video.find({ detail: this.video.detail }).then(res => {
@@ -269,6 +282,7 @@ export default {
},
onPlayVideo () {
this.more = true
this.changeVideo()
const h = { ...this.video }
history.find({ detail: h.detail }).then(res => {
if (res) {
@@ -292,6 +306,14 @@ export default {
history.update(res.id, h)
}
})
video.find({ detail: d }).then(res => {
if (res) {
const h = { ...this.video }
delete h.id
delete h.currentTime
video.update(res.id, h)
}
})
}, 10000)
},
closeEvent () {
@@ -299,15 +321,21 @@ export default {
this.right.type = ''
},
nextEvent () {
const v = { ...this.video }
const i = v.index + 1
if (i < this.right.listData.length) {
this.video.currentTime = 0
if (this.video.index < this.right.listData.length - 1) {
this.video.index++
this.video.currentTime = 0
} else {
this.$m.warning(this.$t('last_video'))
}
},
prevEvent () {
if (this.video.index > 0) {
this.video.index--
this.video.currentTime = 0
} else {
this.$m.warning(this.$t('first_video'))
}
},
listEvent () {
if (this.right.type === 'list') {
this.right.show = false
@@ -381,10 +409,16 @@ export default {
})
},
listItemEvent (n) {
this.video.currentTime = 0
this.video.index = n
this.right.show = false
this.right.type = ''
history.find({ detail: this.video.detail }).then(item => {
if (item) {
item.currentTime = 0
item.index = n
history.update(item.id, item)
}
this.video.index = n
this.right.show = false
this.right.type = ''
})
},
historyItemEvent (e) {
this.video = e
@@ -397,6 +431,14 @@ export default {
this.right.historyData = e.reverse()
})
})
},
playbackRateEvent (e) {
let rate = this.xg.playbackRate
if (rate > 0.25) {
rate = rate + e
this.xg.playbackRate = rate
this.$m.success(this.$t('rate') + rate)
}
}
},
mounted () {
@@ -404,13 +446,41 @@ export default {
history.all().then(res => {
this.right.historyData = res
})
ipc.on('next', () => {
if (this.xg) {
if (this.xg.hasStart) {
this.nextEvent()
}
}
})
ipc.on('prev', () => {
if (this.xg) {
if (this.xg.hasStart) {
this.prevEvent()
}
}
})
ipc.on('playbackRateUp', () => {
if (this.xg) {
if (this.xg.hasStart) {
this.playbackRateEvent(0.25)
}
}
})
ipc.on('playbackRateDown', () => {
if (this.xg) {
if (this.xg.hasStart) {
this.playbackRateEvent(-0.25)
}
}
})
}
}
</script>
<style lang="scss" scoped>
.play{
position: relative;
height: 660px;
height: calc(100% - 40px);
width: 100%;
display: flex;
justify-content: center;
@@ -431,8 +501,9 @@ export default {
align-items: center;
}
.xgBox{
width: 900px;
width: 100%;
height: 500px;
flex: 1;
}
.more{
width: 100%;

View File

@@ -75,6 +75,7 @@ import db from '../lib/dexie/index'
import '../lib/cloud/index.js'
import { shell } from 'electron'
import pkg from '../../package.json'
const ipc = require('electron').ipcRenderer
export default {
name: 'setting',
data () {
@@ -157,6 +158,7 @@ export default {
clearDBEvent () {
db.delete().then(res => {
this.$m.success(this.$t('set_success'))
ipc.send('close')
})
}
},
@@ -172,7 +174,7 @@ export default {
</script>
<style lang="scss" scoped>
.setting{
height: 660px;
height: calc(100% - 40px);
width: 100%;
padding: 20px 0;
.setting-box{

View File

@@ -32,7 +32,7 @@ export default {
name: '',
png: ''
},
value: 'https://www.baidu.com',
value: '',
loading: true
}
},

View File

@@ -6,7 +6,7 @@
<span class="type">{{$t('type')}}</span>
<span class="time">{{$t('time')}}</span>
<span class="from">{{$t('from')}}</span>
<span class="operate" style="width: 170px">{{$t('operate')}}</span>
<span class="operate" style="width: 220px">{{$t('operate')}}</span>
</div>
<div class="tBody zy-scroll">
<ul v-show="!loading">
@@ -15,11 +15,12 @@
<span class="type">{{i.type}}</span>
<span class="time">{{i.time}}</span>
<span class="from">{{i.site | ftSite}}</span>
<span class="operate" style="width: 170px">
<span class="operate" style="width: 220px">
<span class="btn" @click.stop="playEvent(i)">{{$t('play')}}</span>
<span class="btn" @click.stop="deleteEvent(i)">{{$t('delete')}}</span>
<span class="btn" @click.stop="shareEvent(i)">{{$t('share')}}</span>
<span class="btn" @click.stop="updateEvent(i)">{{$t('sync')}}</span>
<span class="btn" @click.stop="downloadEvent(i)">{{$t('download')}}</span>
</span>
</li>
</ul>
@@ -38,6 +39,7 @@ import { mapMutations } from 'vuex'
import tools from '../lib/site/tools'
import video from '../lib/dexie/video'
import { sites, getSite } from '../lib/site/sites'
const { clipboard } = require('electron')
export default {
name: 'star',
data () {
@@ -136,6 +138,33 @@ export default {
}
})
},
downloadEvent (e) {
tools.detail_get(e.site, e.detail).then(res => {
if (res.mp4_urls.length > 0) {
const urls = [...res.mp4_urls]
let txt = `${e.name}\n`
for (const i of urls) {
const name = i.split('$')[0]
const url = encodeURI(i.split('$')[1])
txt += (name + ': ' + url + '\n')
}
clipboard.writeText(txt)
this.$m.success('〖MP4〗: ' + this.$t('copy_success'))
return false
}
if (res.m3u8_urls.length > 0) {
const urls = [...res.m3u8_urls]
let txt = `${e.name}\n`
for (const i of urls) {
const name = i.split('$')[0]
const url = encodeURI(i.split('$')[1])
txt += (name + ': ' + url + '\n')
}
clipboard.writeText(txt)
this.$m.success('〖M3U8〗: ' + this.$t('copy_success'))
}
})
},
getAllStar () {
video.all().then(res => {
this.data = res.reverse()
@@ -150,7 +179,7 @@ export default {
</script>
<style lang="scss" scoped>
.star{
height: 660px;
height: calc(100% - 40px);
width: 100%;
display: flex;
flex-direction: column;

View File

@@ -1,32 +1,44 @@
import setting from '../dexie/setting'
const os = require('os')
const macadress = require('macaddress')
const macaddress = require('macaddress')
const AV = require('leancloud-storage')
setting.find().then(res => {
const cloud = res.cloud
if (!cloud) {
macadress.one((err, mac) => {
if (err) {
return false
}
const system = os.hostname() + ' ' + os.type() + ' ' + os.arch()
AV.init({
appId: 'X6TRIcMjgOG7EJ0t1l5r9In1-gzGzoHsz',
appKey: 'JmkGF9UqkWGQNYDcJ2g1QV1b',
serverURL: 'https://x6tricmj.lc-cn-n1-shared.com'
})
macaddress.one((err, mac) => {
if (err) {
return false
}
AV.init({
appId: 'X6TRIcMjgOG7EJ0t1l5r9In1-gzGzoHsz',
appKey: 'JmkGF9UqkWGQNYDcJ2g1QV1b',
serverURL: 'https://x6tricmj.lc-cn-n1-shared.com'
})
const system = os.hostname() + ' ' + os.type() + ' ' + os.arch()
const query = new AV.Query('ZYPlayer')
query.equalTo('os', system)
query.equalTo('mac', mac)
query.find().then(res => {
// 存储新用户数据
if (res.length === 0) {
const ZYPlayer = AV.Object.extend('ZYPlayer')
const zyPlayer = new ZYPlayer()
zyPlayer.set('os', system)
zyPlayer.set('mac', mac)
zyPlayer.save().then(e => {
const id = e.id
res.cloud = true
res.cloudKey = id
setting.update(res)
})
})
}
zyPlayer.set('times', 1)
zyPlayer.save()
return false
}
// 统计启动次数
if (res.length === 1) {
const id = res[0].id
const times = AV.Object.createWithoutData('ZYPlayer', id)
times.increment('times', 1)
times.save()
return false
}
// 清除冗余数据
if (res.length > 1) {
const arr = res
arr.shift()
AV.Object.destroyAll(arr)
}
})
})

View File

@@ -36,6 +36,7 @@
"delete_success": "Delete successful.",
"delete_failed": "Delete failed.",
"star_success": "Collection success.",
"first_video": "This is the first episode.",
"last_video": "This is the last episode.",
"qr_tips": "Long click recognition.",
"zy_tips": "Prohibit the dissemination of illegal resources.",
@@ -46,5 +47,6 @@
"async_success": "Synchronization succeeded, update found.",
"no_history": "No history data.",
"clearDB": "Reset software",
"clearTips": "Click to clear the database and close the software"
"clearTips": "Click to clear the database and close the software",
"rate": "The current video speed is: "
}

View File

@@ -29,13 +29,14 @@
"sync": "同步",
"total": "条数据",
"website": "官网",
"issues": "内测反馈",
"issues": "反馈",
"theme": "主题",
"donate": "捐赠",
"set_success": "设置成功。",
"delete_success": "删除成功。",
"delete_failed": "删除失败。",
"star_success": "收藏成功。",
"first_video": "这已经是第一集了。",
"last_video": "这已经是最后一集了。",
"qr_tips": "长按二维码,识别播放。",
"zy_tips": "『ZY Player』技术支持严禁传播违法资源。",
@@ -46,5 +47,6 @@
"async_success": "同步成功, 查询到更新。",
"no_history": "无历史记录",
"clearDB": "重置软件",
"clearTips": "软件没有问题,请勿重置软件,否则数据丢失概不负责.点击即清空数据库,并关闭软件."
"clearTips": "软件没有问题,请勿重置软件,否则数据丢失概不负责.点击即清空数据库,并关闭软件.",
"rate": "当前视频播放倍速为:"
}

View File

@@ -92,6 +92,7 @@ export default {
this.xg.on('ended', () => {
if (this.d.m3u8_urls.length > 1 && (this.d.m3u8_urls.length - 1 > this.index)) {
this.video.currentTime = 0
this.video.index++
this.index++
let src = this.d.m3u8_urls[this.index]
src = src.split('$')[1]
@@ -122,6 +123,7 @@ export default {
if (res) {
const v = res
v.currentTime = this.xg.currentTime
v.index = this.index
const id = v.id
delete v.id
history.update(id, v)
@@ -130,6 +132,9 @@ export default {
}, 10000)
},
prevEvent () {
if (this.index === 0) {
return false
}
history.find({ detail: this.video.detail }).then(res => {
const v = res
v.index--
@@ -144,6 +149,9 @@ export default {
})
},
nextEvent () {
if (this.index >= this.d.m3u8_urls.length - 1) {
return false
}
history.find({ detail: this.video.detail }).then(res => {
const v = res
v.index++
@@ -156,6 +164,13 @@ export default {
this.index++
})
})
},
playbackRateEvent (e) {
let rate = this.xg.playbackRate
if (rate > 0.25) {
rate = rate + e
this.xg.playbackRate = rate
}
}
},
created () {
@@ -163,6 +178,46 @@ export default {
},
mounted () {
this.xg = new Hls(this.config)
ipc.on('next', () => {
if (this.xg) {
if (this.xg.hasStart) {
this.nextEvent()
}
}
})
ipc.on('prev', () => {
if (this.xg) {
if (this.xg.hasStart) {
this.prevEvent()
}
}
})
ipc.on('up', () => {
if (this.opacity <= 95) {
this.opacity = this.opacity + 5
this.opacityChange(this.opacity)
}
})
ipc.on('down', () => {
if (this.opacity >= 10) {
this.opacity = this.opacity - 5
this.opacityChange(this.opacity)
}
})
ipc.on('playbackRateUp', () => {
if (this.xg) {
if (this.xg.hasStart) {
this.playbackRateEvent(0.25)
}
}
})
ipc.on('playbackRateDown', () => {
if (this.xg) {
if (this.xg.hasStart) {
this.playbackRateEvent(-0.25)
}
}
})
}
}
</script>

View File

@@ -13,7 +13,7 @@ module.exports = {
},
appId: 'com.hunlongyu.zy',
copyright: 'Copyright @ 2020 Hunlongyu',
productName: 'ZY Player 内测版',
productName: 'ZY Player',
publish: [
{
provider: 'github',

10190
yarn.lock

File diff suppressed because it is too large Load Diff