// 点击
viewer.addEventListener('clickObject', e => {
  window.top.clickObject(e.imgName);
  // 暂停动画
  viewer.setAutoMove(false)
})

// 继续动画 - 给 父页面调用
window.stareMove = (val) => {
  viewer.setAutoMove(val)
}

let flag = false

// 鼠标移入
viewer.addEventListener('hoverObject', e => {
  // console.log('鼠标移入',e);
  flag = true
  window.top.hoverObject(e);
})

// 鼠标移出
viewer.addEventListener('mouseoutObject', e => {
  // console.log('鼠标移出',e);
  flag = false
  window.top.mouseoutObject(e);
})


document.querySelector('#player').onmousemove = (event) => {
  if (!flag) return
  let e = event || window.event;
  window.top.mouseLoc(e.clientX, e.clientY);
}