question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to get video src to display in Nuxt

See original GitHub issue

vue.js version 2.12

You can see it live here: https://www.thedales.me/video/

The page is blank, unable to get src to display when I inspect front end. Here is a screen shot: image

Was expecting to see a .m3u8 video or even the player showing some kind of error. Here is the template I am using:

<template>
  <section class="container">
    <video-player
      v-video-player:myVideoPlayer="playerOptions"
      class="video-player-box"
      :playsinline="playsinline"
      @play="onPlayerPlay($event)"
      @pause="onPlayerPause($event)"
      @ended="onPlayerEnded($event)"
      @loadeddata="onPlayerLoadeddata($event)"
      @waiting="onPlayerWaiting($event)"
      @playing="onPlayerPlaying($event)"
      @timeupdate="onPlayerTimeupdate($event)"
      @canplay="onPlayerCanplay($event)"
      @canplaythrough="onPlayerCanplaythrough($event)"
      @ready="playerReadied"
      @statechanged="playerStateChanged($event)"
    ></video-player>
  </section>
</template>

<script>
export default {
  data() {
    return {
      playsinline: true,
      playerOptions: {
        muted: false,
        controls: true,
        language: 'en',
        playbackRates: [0.7, 1.0, 1.5, 2.0],
        sources: [
          {
            type: 'application/x-mpegURL',
            src:
              'https://stream.mux.com/GvgMD02G02mv0200fDiP71cLF9RrbRlEq8V9.m3u8',
            poster:
              'https://images.mux.com/GvgMD02G02mv0200fDiP71cLF9RrbRlEq8V9/thumbnail.jpg'
          }
        ]
      }
    }
  },
  mounted() {
    // console.log('this is current player instance object', this.myVideoPlayer)
  },
  methods: {
    onPlayerPlay(player) {
      // console.log('player play!', player)
    },
    onPlayerPause(player) {
      // console.log('player pause!', player)
    },
    onPlayerEnded(player) {
      // console.log('player ended!', player)
    },
    onPlayerLoadeddata(player) {
      // console.log('player Loadeddata!', player)
    },
    onPlayerWaiting(player) {
      // console.log('player Waiting!', player)
    },
    onPlayerPlaying(player) {
      // console.log('player Playing!', player)
    },
    onPlayerTimeupdate(player) {
      // console.log('player Timeupdate!', player.currentTime())
    },
    onPlayerCanplay(player) {
      // console.log('player Canplay!', player)
    },
    onPlayerCanplaythrough(player) {
      // console.log('player Canplaythrough!', player)
    },
    playerStateChanged(playerCurrentState) {
      // console.log('player current update state', playerCurrentState)
    },
    playerReadied(player) {
      // console.log('example 01: the player is readied', player)
    }
  }
}

I’ve also done this in the plugins: import Vue from ‘vue’

const VueVideoPlayer = require(‘vue-video-player/dist/ssr’) Vue.use(VueVideoPlayer)

and I believe I included it correctly in my nuxt.config: image

Any advice greatly appreciated!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
daletomcommented, Sep 22, 2020

Thanks for sending that @Nabute . Is the example even using the Vue-Video-Player? Yes, your example absolutely works. But I guess this Vue-Video-Player isnt very easy to use, thats for sure. Thanks for all the help.

1reaction
Nabutecommented, Sep 13, 2020

I ran into this issue a few days ago and fixed it by installing Video-js 7 and used the builtin HTML5 player.Take a look at this gist

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to get video src to display in Nuxt · Issue #356 - GitHub
Here is a screen shot: Was expecting to see a .m3u8 video or even the player showing s. ... Unable to get video...
Read more >
Nuxt video not loading on mount from URL - Stack Overflow
The ":src" property works fine whenever i have the user load the video from their own files. However after the file is saved...
Read more >
Assets directory - Nuxt
The assets directory contains your un-compiled assets such as Stylus or Sass files, images, or fonts.
Read more >
Commands and Deployment - Nuxt
Nuxt comes with a set of useful commands, both for development and production purpose. Using in package.json. You should have these commands in...
Read more >
Data Fetching - Nuxt
In Nuxt we have 2 ways of getting data from an API. We can use the fetch method or the asyncData method. Nuxt...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found