Skip to content

An Angular module provides service to play music using HTML5 audio

Notifications You must be signed in to change notification settings

hoangps/angular-music-player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

angular-music-player

An Angular module provides service to play music using HTML5 audio

Install

<script src="angularMusicPlayer.js"></script>
var myApp = angular.module('myApp', ['angularMusicPlayer']);
myApp.controller('mainController', function ($scope, $http, $musicPlayer) {}

Usage

$scope.player = $musicPlayer;

Properties

It includes following properies:

this.player = {};
this.player.audio = new Audio();
this.player.isPlaying = false;
this.player.currentTime = 0;
this.player.track = {};
this.player.track.id = "";
this.player.track.stream_url = "";
this.player.playlist = []; // is a collection of tracks
this.player.trackElapsedPercentage = 0;
this.player.trackElapsedPercentageStyle = { 'width': 0 };

Methods

It supports following methods:

this.player.play = function (playlist, track) {}

this.player.resume = function() {}

this.player.pause = function () {}

this.player.prev = function () {}

this.player.next = function () {}

this.player.goToTrack = function (trackIndex) {}

Please see my example for more practical information

About

An Angular module provides service to play music using HTML5 audio

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published