mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-07-04 10:36:13 +08:00
mini模式,大小直接设置为当前窗口大小,无需记录到数据库中
This commit is contained in:
@@ -221,7 +221,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { mapMutations } from 'vuex'
|
||||
import { star, history, setting, shortcut, mini, channelList, iptvSearch, sites } from '../lib/dexie'
|
||||
import { star, history, setting, shortcut, channelList, iptvSearch, sites } from '../lib/dexie'
|
||||
import zy from '../lib/site/tools'
|
||||
import Player from 'xgplayer'
|
||||
import HlsJsPlayer from 'xgplayer-hls.js'
|
||||
@@ -775,27 +775,12 @@ 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 }
|
||||
const miniWindowBounds = { x: win.getPosition()[0], y: win.getPosition()[1], width: win.getSize()[0], height: win.getSize()[1] }
|
||||
win.setBounds(miniWindowBounds)
|
||||
this.xg.getCssFullscreen()
|
||||
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()
|
||||
this.miniMode = false
|
||||
|
||||
Reference in New Issue
Block a user