mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-02-19 21:20:52 +01:00
Disable getVideoUrl() method.
This method uses some assuptions on endpoint urls. The right way is to use stream() api call to get video stream. Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
This commit is contained in:
parent
7f5e04ebb2
commit
4b789e4c88
@ -110,7 +110,7 @@ public interface MusicService
|
|||||||
*/
|
*/
|
||||||
Pair<InputStream, Boolean> getDownloadInputStream(Context context, MusicDirectory.Entry song, long offset, int maxBitrate, CancellableTask task) throws Exception;
|
Pair<InputStream, Boolean> getDownloadInputStream(Context context, MusicDirectory.Entry song, long offset, int maxBitrate, CancellableTask task) throws Exception;
|
||||||
|
|
||||||
String getVideoUrl(Context context, String id, boolean useFlash) throws Exception;
|
@Deprecated String getVideoUrl(Context context, String id, boolean useFlash) throws Exception;
|
||||||
|
|
||||||
JukeboxStatus updateJukeboxPlaylist(List<String> ids, Context context, ProgressListener progressListener) throws Exception;
|
JukeboxStatus updateJukeboxPlaylist(List<String> ids, Context context, ProgressListener progressListener) throws Exception;
|
||||||
|
|
||||||
|
@ -812,29 +812,14 @@ public class RESTMusicService implements MusicService {
|
|||||||
return new Pair<>(response.getStream(), partial);
|
return new Pair<>(response.getStream(), partial);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getVideoUrl(Context context, String id, boolean useFlash) throws Exception
|
public String getVideoUrl(Context context, String id, boolean useFlash) throws Exception {
|
||||||
{
|
// This method should not exists as video should be loaded using stream method
|
||||||
StringBuilder builder = new StringBuilder(5);
|
// Previous method implementation uses assumption that video will be available
|
||||||
if (useFlash)
|
// by videoPlayer.view?id=<id>&maxBitRate=500&autoplay=true, but this url is not
|
||||||
{
|
// official Subsonic API call.
|
||||||
builder.append(Util.getRestUrl(context, "videoPlayer"));
|
throw new UnsupportedOperationException("This method is not longer supported");
|
||||||
builder.append("&id=").append(id);
|
}
|
||||||
builder.append("&maxBitRate=500");
|
|
||||||
builder.append("&autoplay=true");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
checkServerVersion(context, "1.9", "Video streaming not supported.");
|
|
||||||
builder.append(Util.getRestUrl(context, "stream"));
|
|
||||||
builder.append("&id=").append(id);
|
|
||||||
builder.append("&format=raw");
|
|
||||||
}
|
|
||||||
|
|
||||||
String url = rewriteUrlWithRedirect(context, builder.toString());
|
|
||||||
Log.i(TAG, String.format("Using video URL: %s", url));
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JukeboxStatus updateJukeboxPlaylist(List<String> ids,
|
public JukeboxStatus updateJukeboxPlaylist(List<String> ids,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user