Commit fa7f579c by 胡悦

Merge branch 'dev_2.8.3' of http://192.168.3.233:8090/glsx/scrm-wx-merchant-activity into dev_2.8.3

2 parents 5957b1f8 3d629bf1
......@@ -256,7 +256,7 @@ const date_format = num => {
}
return `${days}天${hours}:${minutes}:${second}`
}
const draggable = (drag, fun) => {
const draggable = (drag, fun, target) => {
var startEvt, moveEvt, endEvt
// 判断是否支持触摸事件
if ('ontouchstart' in window) {
......@@ -273,6 +273,7 @@ const draggable = (drag, fun) => {
drag.addEventListener(startEvt, startFun)
function startFun (event) {
if(!drag.id) return
// 阻止页面的滚动,缩放
event.preventDefault()
// 兼容IE浏览器
......@@ -310,8 +311,8 @@ const draggable = (drag, fun) => {
}
drag.style.left = left + 'px'
drag.style.top = top + 'px'
}
}
function endFun (event) {
drag.style.cursor = ''
document.removeEventListener(moveEvt, moveFun)
......
<template>
<div
:class="['live-box',{'videoFullscreen':videoFullscreen}]"
:style="videoStyle"
id="live-box"
>
<div
class="mask"
@click="openFullscreen"
>
<div class="mask">
<div class="sprite-icon icon-live-close"></div>
<div class="status flex">
<div class="live-line">
......@@ -90,7 +86,7 @@ export default {
_this.player.ready(function () { //设置播放器初始化完成后的回调
console.log('-------------------------', _this.player.poster())
_this.player.play() //播放视频
_this.draggable(document.getElementById('live-box'))
_this.draggable(document.getElementById('live-box'), _this.openFullscreen)
})
}
})
......@@ -105,12 +101,13 @@ export default {
},
methods: {
openFullscreen (status = true) { //打开关闭全屏
let [live] = document.getElementsByClassName('live-box')
let [volumePanel] = document.getElementsByClassName('vjs-volume-panel ')
let [volume] = volumePanel.getElementsByClassName('vjs-mute-control')
volume.click()
this.player.play()
this.videoFullscreen = status
live.id = status ? '' : 'live-box'
},
}
}
......@@ -126,7 +123,6 @@ export default {
height: 148px;
border-radius: 4px;
overflow: hidden;
-webkit-user-select: auto;
.mask {
width: 100%;
height: 100%;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!