|
@@ -22,6 +22,11 @@ function PanoVideo({ lodingOk }: Propr) {
|
|
|
const [activeIdx, setActiveIdx] = useState(-1)
|
|
|
const middlewareIns = useRef<KrpanoMiddlewareMethods>(null)
|
|
|
|
|
|
+ const wechatJSReadyHandler = () => {
|
|
|
+ videoSceneModel.pause()
|
|
|
+ videoSceneModel.play()
|
|
|
+ }
|
|
|
+
|
|
|
useEffect(() => {
|
|
|
const readyEvent = videoSceneModel.event.on('Event.videoScene.play', () => {
|
|
|
console.log('加载完成')
|
|
@@ -30,6 +35,8 @@ function PanoVideo({ lodingOk }: Propr) {
|
|
|
}, 4000)
|
|
|
})
|
|
|
|
|
|
+ document.addEventListener('WeixinJSBridgeReady', wechatJSReadyHandler, false)
|
|
|
+
|
|
|
return () => {
|
|
|
// 记得清理监听事件
|
|
|
readyEvent()
|