async switchURL (url, options = {}) {
    const defaultOpts = {
      seamless: false,
      startTime: 0,
      bitrate: 0
    }
    switch (typeof options) {
      case 'number':
        options = {startTime: options}
        break
      case 'boolean':
        options = {seamless: options}
        break
      case 'object':
        for (const key in options) {
          if (options[key] === undefined || options[key] === null) {
            delete options[key]
          }
        }
        break
      default:
        throw `unsupported switchURL args: ${options}`
    }

    options = Object.assign({}, defaultOpts, options)
    const { seamless, startTime } = options
    this.config.url = url
    this.config.startTime = startTime
    this._switchUrlOpts = options

    if (!seamless) {
      let appended
      try {
        appended = this.config.softDecode ? this.load(url) : (await this.load(url))
      } catch (error) {
        this.emit(Event.SWITCH_URL_FAILED, error)
        throw error
      }
      this._reloadOnPlay = false

      if (appended) {
        this.emit(Event.SWITCH_URL_SUCCESS, { url })
      }
      return this.media.play(true)
    } else {
      this._urlSwitching = true
      if (!this.isLive) {
        this._prevSegSn = null
        this._prevSegCc = null
      }

      this._playlist.reset()
      this._bufferService.seamlessSwitch()
      await this._clear()
      await this._loadData(url)
      this._startTick()
    }

    this._switchUrlOpts = null
  }
@param {string} url
@param {?SwitchUrlOptions} options
@returns