parent
6201f78c93
commit
1e23fff664
@ -1,5 +1,5 @@ |
||||
TARO_APP_API=https://yjx.dev.yaojiankang.top |
||||
#TARO_APP_API=https://playedu.yaojiankang.top |
||||
#TARO_APP_API=https://yjx.dev.yaojiankang.top |
||||
TARO_APP_API=https://playedu.yaojiankang.top |
||||
TARO_APP_LGOIN=true |
||||
|
||||
|
||||
|
@ -0,0 +1,40 @@ |
||||
import Taro from "@tarojs/taro"; |
||||
|
||||
const KEY = "VIDEO_EVENT" |
||||
const SET_KEY = 'SET_VIDEO_EVENT' |
||||
|
||||
type StateChangeName = 'play' | 'pause' |
||||
|
||||
/** 视频状态播改变播放 */ |
||||
function videoState(name: StateChangeName) { |
||||
Taro.eventCenter.trigger(KEY, {name}) |
||||
} |
||||
|
||||
/** 接受状态播放改变 */ |
||||
function onVideoState(fn: ({name: StateChangeName}) => void) { |
||||
Taro.eventCenter.once(KEY, fn) |
||||
} |
||||
|
||||
/** 设置视频状态 */ |
||||
function setVideoState(name: StateChangeName) { |
||||
Taro.eventCenter.trigger(SET_KEY, {name}) |
||||
} |
||||
|
||||
/** 接受状态改变 */ |
||||
function onSetVideoState(fn: (data: { name: StateChangeName }) => void) { |
||||
Taro.eventCenter.on(SET_KEY, fn) |
||||
} |
||||
|
||||
function videoOff() { |
||||
Taro.eventCenter.off(KEY) |
||||
Taro.eventCenter.off(SET_KEY) |
||||
} |
||||
|
||||
|
||||
export default { |
||||
videoState, |
||||
onVideoState, |
||||
onSetVideoState, |
||||
setVideoState, |
||||
videoOff |
||||
} |
@ -1,4 +1,4 @@ |
||||
export default definePageConfig({ |
||||
navigationBarTitleText: '见面会', |
||||
navigationBarTitleText: '现场会', |
||||
enableShareAppMessage: true |
||||
}) |
||||
|
Loading…
Reference in new issue