videojs-player icon indicating copy to clipboard operation
videojs-player copied to clipboard

How to play youtube videos?

Open kentforth opened this issue 3 years ago • 1 comments

The player shows an error: "No compatible source found for this media" How can I fix it to play you tuibe video?

      <video-player
        class="video-player-box"
        ref="videoPlayer"
        :options="playerOptions"
      />

playerOptions: {
        sources: [
          {
            type: "video/youtube",
            src: "https://www.youtube.com/watch?v=W-4GcIC7G7A",
          },
        ],
      },

computed: {
    player() {
      return this.$refs.videoPlayer.player;
    },
  },

kentforth avatar May 08 '21 00:05 kentforth

Hello! You need plugin https://github.com/videojs/videojs-youtube Based on: https://videojs.com/guides/troubleshooting/#make-sure-you-are-using-formats-that-videojs-can-play

IgorShayderov avatar Sep 19 '22 10:09 IgorShayderov