Giter Club home page Giter Club logo

vue-waveform-template's Introduction

New Project

โœจ Bootstrapped with Create Snowpack App (CSA).

Available Scripts

npm start

Runs the app in the development mode. Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits. You will also see any lint errors in the console.

npm run build

Builds a static copy of your site to the build/ folder. Your app is ready to be deployed!

For the best production performance: Add a build bundler plugin like @snowpack/plugin-webpack or snowpack-plugin-rollup-bundle to your snowpack.config.mjs config file.

Q: What about Eject?

No eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.

vue-waveform-template's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

edestes

vue-waveform-template's Issues

Peaks as reactive data option?

I am trying to understand how Peaks works in this Vue example. It seems that peaks is not available on Vue's data options. Or am I mistaken?

Here is what I did in order to make peaks to data:

I tried to move the cues-generating part of the onWaveformLoaded to its own function showCues and call that one from a button event listener:

export default {
  data () {
    return {
      peaks: null
    }
  },
  mounted() {
    document.querySelector('[data-action="show-cues"]').addEventListener('click', () => {
      this.showCues();
    });
  },
  methods: {
    onWaveformLoaded(error, peaks) {
      [...]
      this.peaks = peaks
    },
    showCues () {
      this.cues.forEach(cue => this.peaks.points.add(cue))
      this.peaks.on('points.dragmove', ({ id, time:newTime }) => {
        const time = parseFloat(newTime.toFixed(4))
        this.$store.commit('programme/cueUpdate', { id, time })
      })

      // Test: log out `this._waveform`
      console.log("this._waveform =", this._waveform)
    },
  }
}

This makes it work for this scenario. But I wonder, if this is the way to go. I have no idea what this._waveform is actually doing. Logging it out at the end of showCues only results in undefined.

I wanted to have the destroy function available as a separate function (n case it is needed somewhere else) and did this:

beforeDestroy () {
  this.destroyWaveform()
},
methods: {
    destroyWaveform () {
      this._waveform.destroy()
    }
}

However, this_waveform is not available, the console throws this error.

Uncaught TypeError: Cannot read property 'destroy' of undefined

Any thoughts on what I am doing wrong?

"Vue.set" in "store/programme.js" does not work with Nuxt.js

To update cues, Vue.set is used:
https://github.com/oncletom/vue-waveform-template/blob/main/src/store/modules/programme.js#L37-L39

This does not work in Nuxt.js, unless "export const strict = true" is set in "store/index.js" (vuex standard folder in nuxt).

I posted this problem on the Vue Forums:
https://forum.vuejs.org/t/nuxt-2-vuex-updating-an-object-within-an-array-with-vue-set-throws-error/125558

I hope this finds an answer, and if so, it should probably be mentioned in this excellent template!

Peaks updates

There have been quite some update on peaks. On npm is v 0.28.1, and on github the event model has changed completely: bbc/peaks.js#427

I was looking forward to that change, since it opens the possibility to include a right-click menu (new event "contextmenu"). But first and foremost my app completely broke. I am wondering if this is due to the way Vuex stores cue data. So I tried to setup your template, but to no avail, I couldn't get it running with v0.28.1

Is there any chance I could motivate you to update this template, maybe even to the latest version on github?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.