diff --git a/mopidy_musicbox_webclient/static/index.html b/mopidy_musicbox_webclient/static/index.html index ea65134..d9cca6c 100644 --- a/mopidy_musicbox_webclient/static/index.html +++ b/mopidy_musicbox_webclient/static/index.html @@ -408,6 +408,10 @@ +
+
diff --git a/mopidy_musicbox_webclient/static/js/controls.js b/mopidy_musicbox_webclient/static/js/controls.js index 3f63315..2a2f6f2 100644 --- a/mopidy_musicbox_webclient/static/js/controls.js +++ b/mopidy_musicbox_webclient/static/js/controls.js @@ -276,7 +276,11 @@ function doPlay() { if (!play) { mopidy.playback.play(); } else { - mopidy.playback.pause(); + if(isStreamUri(songdata.uri)) { + mopidy.playback.stop(); + } else { + mopidy.playback.pause(); + } } setPlayState(!play); } diff --git a/mopidy_musicbox_webclient/static/js/functionsvars.js b/mopidy_musicbox_webclient/static/js/functionsvars.js index ca002d0..22fbcc4 100644 --- a/mopidy_musicbox_webclient/static/js/functionsvars.js +++ b/mopidy_musicbox_webclient/static/js/functionsvars.js @@ -461,47 +461,6 @@ function validServiceUri(str) { return validUri(str) || isServiceUri(str); } -/* -$.event.special.swipe = $.extend($.event.special.swipe, { - start: function( event ) { - var data = event.originalEvent.touches ? - event.originalEvent.touches[ 0 ] : event; - return { - time: ( new Date() ).getTime(), - coords: [ data.pageX, data.pageY ], - origin: $( event.target ), - offset: $('body').scrollTop() - }; - }, - - stop: function( event ) { - var data = event.originalEvent.touches ? - event.originalEvent.touches[ 0 ] : event; - return { - time: ( new Date() ).getTime(), - coords: [ data.pageX, data.pageY ], - offset: $('body').scrollTop() - }; - alert.log('stop'); - }, - - handleSwipe: function( start, stop ) { - var swipe = $.event.special.swipe, - x = Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ), - y = Math.abs( start.coords[ 1 ] - stop.coords[ 1 ] ), - offset = Math.abs( start.offset - stop.offset ), - time = stop.time - start.time; - if ( time < swipe.durationThreshold && x > swipe.horizontalDistanceThreshold && ( y + offset ) - < swipe.verticalDistanceThreshold ) { - - start.origin.trigger( "swipe" ).trigger( ( start.coords[ 0 ] - stop.coords[ 0 ] ) ? "swipeleft" : "swiperight" ); - -// alert(x + ' ' + y + ' ' + time + ' ' + offset + ' ' + swipe.verticalDistanceThreshold); - } - } -}); -*/ - function isStreamUri(uri) { var uriSplit = uri.split(":"); var a = validUri(uri); @@ -544,6 +503,5 @@ function isServiceUri(uri) { retVal = true; } } - return retVal; }