import { watchTime } from './API/apiWS';

export default function() {
  const store = this.$store
  const userInfo = store.getters['userInfo']
  const channelInfo = store.getters['channelInfo']
  const websocketHeartbeat = require('./timer').default;
  const info = {
      "userId": userInfo.id || 0,
      //  "token": this.token,
      "id": channelInfo.id,
      "type":"live",
      "uin": channelInfo.uin,
      "liveNowStatus": channelInfo.liveNowStatus
  }
  return websocketHeartbeat({
    url: watchTime,
    pingTimeout: 5000,
    pongTimeout: 5000,
    manualStart: false,
    repeatLimit: 10,
    userInfo: info,
    webworker: false
  }).useIt('uuid').useIt('ua')
}