stop streams, not pause; button to copy streamurl
This commit is contained in:
parent
e2f98232b8
commit
dfd79da8e6
@ -408,6 +408,10 @@
|
||||
<button class="btn" type="button" onclick="return saveStreamUri();">
|
||||
Save
|
||||
</button>
|
||||
<br/>
|
||||
<button class="btn" type="button" onclick="$('#streamuriinput').val(songdata.uri); return true;">
|
||||
Add currently playing url
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="ui-block-b" style="padding: 5px">
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user