Git Product home page Git Product logo

vue-simple-audio's Introduction

A simple music player component base on Vuejs

Effect:

demo

How to use

  • install with npm
npm install --save vue-simple-audio
  • use it in your component
<template>
  <div id="app">
    <img src="./assets/logo.png">
    <hello></hello>
    <vue-simple-audio 
        :songs="songs" 
        width="500" 
        initial-volume="40" 
        loop auto-play
        repeat
        bg-color="#345345">
    </vue-simple-audio>
  </div>
  </div>
</template>

<script>
import VueSimpleAudio from 'vue-simple-audio'

export default {
  name: 'app',
  components: {
    'vue-simple-audio':VueSimpleAudio
  },
  data(){
    return {
      songs: [{
        "url": "http://fs.open.kugou.com/7840167216f9b80284d2bb2a9bd9554b/58ac0322/G076/M0A/0C/1D/7IYBAFgu5wmAOS2gAEuViOk9tuk748.mp3",
        "songname": "林俊杰-你的唯一"
      }, {
        "url": "http://fs.open.kugou.com/aecae9884f5c9ca2063864958ddb799e/58ac03ae/G008/M07/06/09/qIYBAFUK1BuAB-aSADmE5bqELvQ099.mp3",
        "songname": "Maroon-sugar"
      }]
    }
  }
}
</script>

props

params description default
songs A array of objects,it contains song's infomation,it has two property,the song's url and name --
auto-play auto play? true
repeat repeat the list? true
loop repeat one? false
width the player's width 300
initial-volume volume 60
bg-color the player's color rgb(0,0,0)

vue-simple-audio's People

Contributors

lavyun avatar

Watchers

 avatar

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.