<input type="text" class="form-control" id="mpdstream" />
</div>
</div>
- <div class="row">
- <div class="form-group col-md-12">
- <button type="button" class="btn btn-default" onclick="updateDB();">
- <span class="glyphicon glyphicon-refresh"></span> Update DB
- </button>
- </div>
- </div>
</form>
+ <div class="row">
+ <div class="form-group col-md-12" data-toggle="buttons">
+ <button type="button" class="btn btn-default btn-block" id="btnautoplay">
+ <span class="glyphicon glyphicon-play"></span> Autoplay stream in this browser when mpd is playing
+ </button>
+ </div>
+ </div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
if ($.cookie("notification") === "true")
$('#btnnotify').addClass("active")
+ if ($.cookie("autoplay") === "true")
+ $('#btnautoplay').addClass("active")
+
document.getElementById('player').addEventListener('stalled', function() {
if ( !document.getElementById('player').paused ) {
this.pause();
} else if(state == 2) { // play
$("#play-icon").addClass("glyphicon-pause");
$('#track-icon').addClass("glyphicon-play");
+ if ( ($.cookie("autoplay") === "true") && (player.paused) ) {
+ clickLocalPlay();
+ }
} else { // pause
$("#play-icon").addClass("glyphicon-play");
$('#track-icon').addClass("glyphicon-pause");
}
});
+$('#btnautoplay').on('click', function (e) {
+ if($.cookie("autoplay") === "true") {
+ $.cookie("autoplay", false);
+ } else {
+ $.cookie("autoplay", true, { expires: 424242 });
+ $('#btnautoplay').addClass("active");
+ }
+});
+
function getHost() {
socket.send('MPD_API_GET_MPDHOST');