Skip to content

Latest commit

 

History

History
36 lines (29 loc) · 1.02 KB

README.md

File metadata and controls

36 lines (29 loc) · 1.02 KB

Single file vue component media player.
Essentially just a front end to HTMLMediaElement. You can bind an array of media files (name/src pair objects) and they will be listed as available files to play when rendered. Demo at https://www.michaelcuccaro.com/

alt text

Import the vueamp component into your vue app component and provide some audio source objects

import AudioPlayer from './vueamp.vue';

export default {
  components: {
    'audio-player': AudioPlayer  
  }
},

data () {
    	return {
    	  audio_sources: [{
    			src:'http://thirdpartyinterface.com/mp3/3pi.call_of_shinebox.2014-4-25.mp3',
    			name:'Call of Shinebox'
    		},{
    			src:'http://thirdpartyinterface.com/mp3/3pi.the_periss_correlation.2014-4-25.2.mp3',
    			name: 'The Periss Correlation'
    		}]
    	}
}

put the audio-player element in your html and bind the array of audio sources

<audio-player :audio-sources="audio_sources"></audio-player>