silvermine / videojs-chromecast

MIT License
148 stars 75 forks source link

Chromecast not working properly #113

Closed damisparks closed 2 years ago

damisparks commented 2 years ago

I am having these errors.

image image

My setup is similar to this one here

Issue explanation

damisparks commented 2 years ago

I do not need assistance on this anymore. I fixed it. See the code below.

// AppVideoPlayer.vue
<script>
import videojs from 'video.js'
import chromecast from '@silvermine/videojs-chromecast'

export default {
  data() {
    return {
      player: null,
    }
  },
  mounted() {
    chromecast(videojs)
    this.player = videojs(
      this.$refs.videoPlayer,
      this.options,
      function onPlayerReady() {
        // this.chromecast({ addButtonToControlBar: true })
        // console.log(this)
      }
    )
  },
  beforeDestroy() {
    if (this.player) {
      this.player.dispose()
    }
    this.player = null
  },
  created() {}
}
</script>
// inside the head object of the nuxt.config.js
    script: [
      {
        src: 'https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1',
        // defer: true,
      },
    ],