鍍金池/ 問答/Java  網(wǎng)絡(luò)安全  HTML/ 如何在vue項目中引入騰訊播放器Tcplayer

如何在vue項目中引入騰訊播放器Tcplayer

之前是直接cdn引入,然后在本地new一下就好了。。。
現(xiàn)在換成vue的項目不知道該如何入手了。
我目前在 index.html中引入

clipboard.png

然后在externals中添加

   'TcPlayer': window.TcPlayer

在需要用到播放器的組件引入

import TcPlayer from 'Tcplayer'

  ready () {
// 聲明一個播放器
// eslint-disable-next-line
    const player = new TcPlayer(this.$refs.mov, {
  mp4: this.movMsg.videourl,
  'autoplay': false,
  'coverpic': {'style': 'default', 'src': this.movMsg.pictureurl},
  'width': '100%',
  'height': '100%',
  'wording': {
    2032: '網(wǎng)絡(luò)錯誤',
    2048: '請求m3u8文件失敗,請檢查是否跨域',
    13: '直播已經(jīng)結(jié)束,請稍后再來'
  }
})

}

然而并沒有效果。。。請教 我這個方法是不是對的,我該怎么做呢?

另外 我在NPM上找到了Tcplayer的鏡像,如果安裝到項目的話,我該怎么用? 我看好像不能用new啊。。。

回答
編輯回答
墨染殤
2018年8月29日 02:44
編輯回答
喵小咪

你好 請問你是怎么引入的 我按照你的方法在index.html的script標(biāo)簽中引入報錯了

2018年7月7日 14:41
編輯回答
神經(jīng)質(zhì)

請問一個 如果是路由跳轉(zhuǎn)過來的這個頁面 怎么改呢?

2017年12月7日 18:03