Unable to get video src to display in Nuxt
See original GitHub issuevue.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:
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:
Any advice greatly appreciated!
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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