mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-02-11 06:25:21 +08:00
@@ -216,7 +216,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { mapMutations } from 'vuex'
|
||||
import { star, history, setting, shortcut, channelList, sites } from '../lib/dexie'
|
||||
import { star, history, setting, shortcut, mini, channelList, sites } from '../lib/dexie'
|
||||
import zy from '../lib/site/tools'
|
||||
import Player from 'xgplayer'
|
||||
import HlsJsPlayer from 'xgplayer-hls.js'
|
||||
@@ -728,11 +728,28 @@ export default {
|
||||
}
|
||||
},
|
||||
async miniEvent () {
|
||||
this.mainWindowBounds = JSON.parse(JSON.stringify(win.getBounds()))
|
||||
let miniWindowBounds
|
||||
await mini.find().then(res => { if (res) miniWindowBounds = res.bounds })
|
||||
if (!miniWindowBounds) miniWindowBounds = { x: win.getPosition()[0], y: win.getPosition()[1], width: 550, height: 340 }
|
||||
win.setBounds(miniWindowBounds)
|
||||
this.xg.getCssFullscreen()
|
||||
document.querySelector('xg-btn-quitMiniMode').style.display = 'block'
|
||||
this.miniMode = true
|
||||
},
|
||||
async exitMiniEvent () {
|
||||
await mini.find().then(res => {
|
||||
let doc = {}
|
||||
doc = {
|
||||
id: 0,
|
||||
bounds: win.getBounds()
|
||||
}
|
||||
if (res) {
|
||||
mini.update(doc)
|
||||
} else {
|
||||
mini.add(doc)
|
||||
}
|
||||
})
|
||||
win.setBounds(this.mainWindowBounds)
|
||||
this.xg.exitCssFullscreen()
|
||||
document.querySelector('xg-btn-quitMiniMode').style.display = 'none'
|
||||
@@ -1087,6 +1104,13 @@ export default {
|
||||
this.miniEvent()
|
||||
return false
|
||||
}
|
||||
if (e === 'resetMini') {
|
||||
if (this.miniMode) {
|
||||
const miniWindowBounds = { x: this.mainWindowBounds.x, y: this.mainWindowBounds.y, width: 550, height: 340 }
|
||||
win.setBounds(miniWindowBounds)
|
||||
}
|
||||
return false
|
||||
}
|
||||
},
|
||||
changeSetting () {
|
||||
this.mtEvent()
|
||||
|
||||
@@ -11,6 +11,7 @@ db.version(4).stores({
|
||||
recommendation: '++id, [key+ids], site, name, detail, index, rate, hasUpdate',
|
||||
sites: '++id, key, name, api, download, isActive, group',
|
||||
history: '++id, [site+ids], name, type, year, index, time, duration, detail',
|
||||
mini: 'id, bounds',
|
||||
iptv: '++id, name, url, isActive',
|
||||
channelList: '++id, name, prefer, channels, group, isActive'
|
||||
})
|
||||
|
||||
@@ -113,6 +113,11 @@ const localKey = [
|
||||
name: 'mini',
|
||||
desc: '进入或退出mini模式',
|
||||
key: 'alt+m'
|
||||
},
|
||||
{
|
||||
name: 'resetMini',
|
||||
desc: '恢复mini窗口默认',
|
||||
key: 'ctrl+0'
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user