Commit d0f27152 authored by Gautam Chitnis's avatar Gautam Chitnis

Feature (playlist button):Functionality for Play button in playlist section is added

This commit adds the functionality for play button in the playlist section.
The button click start to play the contents of the playlist from the beginning.

Gautam C.
parent bf27e0c1
......@@ -85,7 +85,7 @@
<div class="row">
<button type="button" class="btn-circle col-xs"><i class="glyphicon glyphicon-random"></i></button>
<button type="button" class="btn-circle col-xs" id="repeatButton"><i class="glyphicon glyphicon-repeat"></i></button>
<button type="button" class="btn-circle col-xs"><i class="glyphicon glyphicon-play-circle"></i></button>
<button type="button" class="btn-circle col-xs" id="playButton"><i class="glyphicon glyphicon-play-circle"></i></button>
</div>
<div class="row">
<button type="button" class="btn-circle col-xs" data-toggle="modal" data-target="#equalizerModal"><i class="glyphicon glyphicon-equalizer"></i></button>
......
import { bus } from '../../services/bus.service.js';
import { bus, notifyBus } from '../../services/bus.service.js';
import { sendCommand } from '../../services/command.service.js';
let playlistItems;
Vue.component('playlist-buttons', {
template: '#button-template',
methods: {
toggleRepeat: function ()
{
sendCommand(0,"command=pl_repeat");
},
startPlaylist: function()
{
playlistItems = this.$parent.$parent.$data.playlistItems;
if(playlistItems[0])
{
notifyBus("play",playlistItems[0].src,playlistItems[0].id);
}
}
},
created: function()
......@@ -15,5 +25,9 @@ Vue.component('playlist-buttons', {
{
this.toggleRepeat();
}.bind(this));
bus.$on('startPlaylist', function() {
this.startPlaylist();
}.bind(this));
}
});
\ No newline at end of file
......@@ -78,6 +78,9 @@ Vue.component('playlist', {
bus.$on('refreshPlaylist', function() {
this.refreshPlaylist();
}.bind(this));
bus.$on('play', function(arg) {
this.play(arg[0],arg[1]);
}.bind(this));
this.refreshPlaylist();
}
......
......@@ -37,6 +37,9 @@ $(function() { // Handler for .ready() called.
$('#repeatButton').on('click',function (e){
notifyBus("toggleRepeat");
});
$('#playButton').on('click',function (e){
notifyBus("startPlaylist");
});
$('#mobilePlaylistNavButton').on('click',function (e){
notifyBus("openPlaylist");
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment